-rw-r--r-- | korganizer/calendarview.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index db33017..cca73f2 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2067,193 +2067,192 @@ void CalendarView::writeLocale() | |||
2067 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); | 2067 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); |
2068 | KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); | 2068 | KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); |
2069 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; | 2069 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; |
2070 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); | 2070 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); |
2071 | dummy = KOPrefs::instance()->mUserDateFormatShort; | 2071 | dummy = KOPrefs::instance()->mUserDateFormatShort; |
2072 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); | 2072 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); |
2073 | KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, | 2073 | KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, |
2074 | KOPrefs::instance()->mDaylightsavingStart, | 2074 | KOPrefs::instance()->mDaylightsavingStart, |
2075 | KOPrefs::instance()->mDaylightsavingEnd ); | 2075 | KOPrefs::instance()->mDaylightsavingEnd ); |
2076 | KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); | 2076 | KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); |
2077 | #endif | 2077 | #endif |
2078 | } | 2078 | } |
2079 | void CalendarView::updateConfig() | 2079 | void CalendarView::updateConfig() |
2080 | { | 2080 | { |
2081 | writeLocale(); | 2081 | writeLocale(); |
2082 | if ( KOPrefs::instance()->mUseAppColors ) | 2082 | if ( KOPrefs::instance()->mUseAppColors ) |
2083 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 2083 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
2084 | emit configChanged(); | 2084 | emit configChanged(); |
2085 | mTodoList->updateConfig(); | 2085 | mTodoList->updateConfig(); |
2086 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); | 2086 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); |
2087 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2087 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2088 | // To make the "fill window" configurations work | 2088 | // To make the "fill window" configurations work |
2089 | //mViewManager->raiseCurrentView(); | 2089 | //mViewManager->raiseCurrentView(); |
2090 | } | 2090 | } |
2091 | 2091 | ||
2092 | 2092 | ||
2093 | void CalendarView::eventChanged(Event *event) | 2093 | void CalendarView::eventChanged(Event *event) |
2094 | { | 2094 | { |
2095 | changeEventDisplay(event,KOGlobals::EVENTEDITED); | 2095 | changeEventDisplay(event,KOGlobals::EVENTEDITED); |
2096 | //updateUnmanagedViews(); | 2096 | //updateUnmanagedViews(); |
2097 | } | 2097 | } |
2098 | 2098 | ||
2099 | void CalendarView::eventAdded(Event *event) | 2099 | void CalendarView::eventAdded(Event *event) |
2100 | { | 2100 | { |
2101 | changeEventDisplay(event,KOGlobals::EVENTADDED); | 2101 | changeEventDisplay(event,KOGlobals::EVENTADDED); |
2102 | } | 2102 | } |
2103 | 2103 | ||
2104 | void CalendarView::eventToBeDeleted(Event *) | 2104 | void CalendarView::eventToBeDeleted(Event *) |
2105 | { | 2105 | { |
2106 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; | 2106 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; |
2107 | } | 2107 | } |
2108 | 2108 | ||
2109 | void CalendarView::eventDeleted() | 2109 | void CalendarView::eventDeleted() |
2110 | { | 2110 | { |
2111 | changeEventDisplay(0,KOGlobals::EVENTDELETED); | 2111 | changeEventDisplay(0,KOGlobals::EVENTDELETED); |
2112 | } | 2112 | } |
2113 | void CalendarView::changeTodoDisplay(Todo *which, int action) | 2113 | void CalendarView::changeTodoDisplay(Todo *which, int action) |
2114 | { | 2114 | { |
2115 | changeIncidenceDisplay((Incidence *)which, action); | 2115 | changeIncidenceDisplay((Incidence *)which, action); |
2116 | mDateNavigator->updateView(); //LR | 2116 | mDateNavigator->updateView(); //LR |
2117 | //mDialogManager->updateSearchDialog(); | 2117 | //mDialogManager->updateSearchDialog(); |
2118 | 2118 | ||
2119 | if (which) { | 2119 | if (which) { |
2120 | mViewManager->updateWNview(); | 2120 | mViewManager->updateWNview(); |
2121 | //mTodoList->updateView(); | 2121 | //mTodoList->updateView(); |
2122 | } | 2122 | } |
2123 | 2123 | ||
2124 | } | 2124 | } |
2125 | 2125 | ||
2126 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) | 2126 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) |
2127 | { | 2127 | { |
2128 | updateUnmanagedViews(); | 2128 | updateUnmanagedViews(); |
2129 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); | 2129 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); |
2130 | if ( action == KOGlobals::EVENTDELETED ) { //delete | 2130 | if ( action == KOGlobals::EVENTDELETED ) { //delete |
2131 | mCalendar->checkAlarmForIncidence( 0, true ); | 2131 | mCalendar->checkAlarmForIncidence( 0, true ); |
2132 | if ( mEventViewerDialog ) | 2132 | if ( mEventViewerDialog ) |
2133 | mEventViewerDialog->hide(); | 2133 | mEventViewerDialog->hide(); |
2134 | } | 2134 | } |
2135 | else | 2135 | else |
2136 | mCalendar->checkAlarmForIncidence( which , false ); | 2136 | mCalendar->checkAlarmForIncidence( which , false ); |
2137 | } | 2137 | } |
2138 | 2138 | ||
2139 | // most of the changeEventDisplays() right now just call the view's | 2139 | // most of the changeEventDisplays() right now just call the view's |
2140 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. | 2140 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. |
2141 | void CalendarView::changeEventDisplay(Event *which, int action) | 2141 | void CalendarView::changeEventDisplay(Event *which, int action) |
2142 | { | 2142 | { |
2143 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; | 2143 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; |
2144 | changeIncidenceDisplay((Incidence *)which, action); | 2144 | changeIncidenceDisplay((Incidence *)which, action); |
2145 | mDateNavigator->updateView(); | 2145 | mDateNavigator->updateView(); |
2146 | //mDialogManager->updateSearchDialog(); | 2146 | //mDialogManager->updateSearchDialog(); |
2147 | 2147 | ||
2148 | if (which) { | 2148 | if (which) { |
2149 | // If there is an event view visible update the display | 2149 | // If there is an event view visible update the display |
2150 | mViewManager->currentView()->changeEventDisplay(which,action); | 2150 | mViewManager->currentView()->changeEventDisplay(which,action); |
2151 | // TODO: check, if update needed | 2151 | // TODO: check, if update needed |
2152 | // if (which->getTodoStatus()) { | 2152 | // if (which->getTodoStatus()) { |
2153 | mTodoList->updateView(); | 2153 | mTodoList->updateView(); |
2154 | // } | 2154 | // } |
2155 | } else { | 2155 | } else { |
2156 | mViewManager->currentView()->updateView(); | 2156 | mViewManager->currentView()->updateView(); |
2157 | } | 2157 | } |
2158 | } | 2158 | } |
2159 | 2159 | ||
2160 | 2160 | ||
2161 | void CalendarView::updateTodoViews() | 2161 | void CalendarView::updateTodoViews() |
2162 | { | 2162 | { |
2163 | |||
2164 | mTodoList->updateView(); | 2163 | mTodoList->updateView(); |
2165 | mViewManager->currentView()->updateView(); | 2164 | mViewManager->currentView()->updateView(); |
2166 | 2165 | ||
2167 | } | 2166 | } |
2168 | 2167 | ||
2169 | 2168 | ||
2170 | void CalendarView::updateView(const QDate &start, const QDate &end) | 2169 | void CalendarView::updateView(const QDate &start, const QDate &end) |
2171 | { | 2170 | { |
2172 | mTodoList->updateView(); | 2171 | mTodoList->updateView(); |
2173 | mViewManager->updateView(start, end); | 2172 | mViewManager->updateView(start, end); |
2174 | //mDateNavigator->updateView(); | 2173 | //mDateNavigator->updateView(); |
2175 | } | 2174 | } |
2176 | 2175 | ||
2177 | void CalendarView::updateView() | 2176 | void CalendarView::updateView() |
2178 | { | 2177 | { |
2179 | DateList tmpList = mNavigator->selectedDates(); | 2178 | DateList tmpList = mNavigator->selectedDates(); |
2180 | 2179 | ||
2181 | if ( KOPrefs::instance()->mHideNonStartedTodos ) | 2180 | if ( KOPrefs::instance()->mHideNonStartedTodos ) |
2182 | mTodoList->updateView(); | 2181 | mTodoList->updateView(); |
2183 | // We assume that the navigator only selects consecutive days. | 2182 | // We assume that the navigator only selects consecutive days. |
2184 | updateView( tmpList.first(), tmpList.last() ); | 2183 | updateView( tmpList.first(), tmpList.last() ); |
2185 | } | 2184 | } |
2186 | 2185 | ||
2187 | void CalendarView::updateUnmanagedViews() | 2186 | void CalendarView::updateUnmanagedViews() |
2188 | { | 2187 | { |
2189 | mDateNavigator->updateDayMatrix(); | 2188 | mDateNavigator->updateDayMatrix(); |
2190 | } | 2189 | } |
2191 | 2190 | ||
2192 | int CalendarView::msgItemDelete(const QString name) | 2191 | int CalendarView::msgItemDelete(const QString name) |
2193 | { | 2192 | { |
2194 | return KMessageBox::warningContinueCancel(this,name +"\n\n"+ | 2193 | return KMessageBox::warningContinueCancel(this,name +"\n\n"+ |
2195 | i18n("This item will be\npermanently deleted."), | 2194 | i18n("This item will be\npermanently deleted."), |
2196 | i18n("KO/Pi Confirmation"),i18n("Delete")); | 2195 | i18n("KO/Pi Confirmation"),i18n("Delete")); |
2197 | } | 2196 | } |
2198 | 2197 | ||
2199 | 2198 | ||
2200 | void CalendarView::edit_cut() | 2199 | void CalendarView::edit_cut() |
2201 | { | 2200 | { |
2202 | Event *anEvent=0; | 2201 | Event *anEvent=0; |
2203 | 2202 | ||
2204 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2203 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2205 | 2204 | ||
2206 | if (mViewManager->currentView()->isEventView()) { | 2205 | if (mViewManager->currentView()->isEventView()) { |
2207 | if ( incidence && incidence->type() == "Event" ) { | 2206 | if ( incidence && incidence->type() == "Event" ) { |
2208 | anEvent = static_cast<Event *>(incidence); | 2207 | anEvent = static_cast<Event *>(incidence); |
2209 | } | 2208 | } |
2210 | } | 2209 | } |
2211 | 2210 | ||
2212 | if (!anEvent) { | 2211 | if (!anEvent) { |
2213 | KNotifyClient::beep(); | 2212 | KNotifyClient::beep(); |
2214 | return; | 2213 | return; |
2215 | } | 2214 | } |
2216 | DndFactory factory( mCalendar ); | 2215 | DndFactory factory( mCalendar ); |
2217 | factory.cutIncidence(anEvent); | 2216 | factory.cutIncidence(anEvent); |
2218 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 2217 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
2219 | } | 2218 | } |
2220 | 2219 | ||
2221 | void CalendarView::edit_copy() | 2220 | void CalendarView::edit_copy() |
2222 | { | 2221 | { |
2223 | Event *anEvent=0; | 2222 | Event *anEvent=0; |
2224 | 2223 | ||
2225 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2224 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2226 | 2225 | ||
2227 | if (mViewManager->currentView()->isEventView()) { | 2226 | if (mViewManager->currentView()->isEventView()) { |
2228 | if ( incidence && incidence->type() == "Event" ) { | 2227 | if ( incidence && incidence->type() == "Event" ) { |
2229 | anEvent = static_cast<Event *>(incidence); | 2228 | anEvent = static_cast<Event *>(incidence); |
2230 | } | 2229 | } |
2231 | } | 2230 | } |
2232 | 2231 | ||
2233 | if (!anEvent) { | 2232 | if (!anEvent) { |
2234 | KNotifyClient::beep(); | 2233 | KNotifyClient::beep(); |
2235 | return; | 2234 | return; |
2236 | } | 2235 | } |
2237 | DndFactory factory( mCalendar ); | 2236 | DndFactory factory( mCalendar ); |
2238 | factory.copyIncidence(anEvent); | 2237 | factory.copyIncidence(anEvent); |
2239 | } | 2238 | } |
2240 | 2239 | ||
2241 | void CalendarView::edit_paste() | 2240 | void CalendarView::edit_paste() |
2242 | { | 2241 | { |
2243 | QDate date = mNavigator->selectedDates().first(); | 2242 | QDate date = mNavigator->selectedDates().first(); |
2244 | 2243 | ||
2245 | DndFactory factory( mCalendar ); | 2244 | DndFactory factory( mCalendar ); |
2246 | Event *pastedEvent = (Event *)factory.pasteIncidence( date ); | 2245 | Event *pastedEvent = (Event *)factory.pasteIncidence( date ); |
2247 | 2246 | ||
2248 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); | 2247 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); |
2249 | } | 2248 | } |
2250 | 2249 | ||
2251 | void CalendarView::edit_options() | 2250 | void CalendarView::edit_options() |
2252 | { | 2251 | { |
2253 | mDialogManager->showOptionsDialog(); | 2252 | mDialogManager->showOptionsDialog(); |
2254 | //writeSettings(); | 2253 | //writeSettings(); |
2255 | } | 2254 | } |
2256 | 2255 | ||
2257 | 2256 | ||
2258 | void CalendarView::slotSelectPickerDate( QDate d) | 2257 | void CalendarView::slotSelectPickerDate( QDate d) |
2259 | { | 2258 | { |