summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Unidiff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index e0380fa..77de94f 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2206,98 +2206,114 @@ void CalendarView::edit_cut()
2206 2206
2207 if (mViewManager->currentView()->isEventView()) { 2207 if (mViewManager->currentView()->isEventView()) {
2208 if ( incidence && incidence->type() == "Event" ) { 2208 if ( incidence && incidence->type() == "Event" ) {
2209 anEvent = static_cast<Event *>(incidence); 2209 anEvent = static_cast<Event *>(incidence);
2210 } 2210 }
2211 } 2211 }
2212 2212
2213 if (!anEvent) { 2213 if (!anEvent) {
2214 KNotifyClient::beep(); 2214 KNotifyClient::beep();
2215 return; 2215 return;
2216 } 2216 }
2217 DndFactory factory( mCalendar ); 2217 DndFactory factory( mCalendar );
2218 factory.cutIncidence(anEvent); 2218 factory.cutIncidence(anEvent);
2219 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2219 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2220} 2220}
2221 2221
2222void CalendarView::edit_copy() 2222void CalendarView::edit_copy()
2223{ 2223{
2224 Event *anEvent=0; 2224 Event *anEvent=0;
2225 2225
2226 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2226 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2227 2227
2228 if (mViewManager->currentView()->isEventView()) { 2228 if (mViewManager->currentView()->isEventView()) {
2229 if ( incidence && incidence->type() == "Event" ) { 2229 if ( incidence && incidence->type() == "Event" ) {
2230 anEvent = static_cast<Event *>(incidence); 2230 anEvent = static_cast<Event *>(incidence);
2231 } 2231 }
2232 } 2232 }
2233 2233
2234 if (!anEvent) { 2234 if (!anEvent) {
2235 KNotifyClient::beep(); 2235 KNotifyClient::beep();
2236 return; 2236 return;
2237 } 2237 }
2238 DndFactory factory( mCalendar ); 2238 DndFactory factory( mCalendar );
2239 factory.copyIncidence(anEvent); 2239 factory.copyIncidence(anEvent);
2240} 2240}
2241 2241
2242void CalendarView::edit_paste() 2242void CalendarView::edit_paste()
2243{ 2243{
2244 QDate date = mNavigator->selectedDates().first(); 2244 QDate date = mNavigator->selectedDates().first();
2245 2245
2246 DndFactory factory( mCalendar ); 2246 DndFactory factory( mCalendar );
2247 Event *pastedEvent = (Event *)factory.pasteIncidence( date ); 2247 Event *pastedEvent = (Event *)factory.pasteIncidence( date );
2248 2248
2249 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2249 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2250} 2250}
2251 2251
2252void CalendarView::edit_options() 2252void CalendarView::edit_options()
2253{ 2253{
2254 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId;
2255 emit save();
2256 emit saveStopTimer();
2254 mDialogManager->showOptionsDialog(); 2257 mDialogManager->showOptionsDialog();
2255 //writeSettings(); 2258 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) {
2259 emit saveStopTimer();
2260 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto apply timezone changes?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"),
2261 i18n("Timezone settings"),i18n("Reload"))) {
2262 qDebug("KO: TZ reload cancelled ");
2263 return;
2264 }
2265 qDebug("KO: Timezone change ");
2266 openCalendar( MainWindow::defaultFileName() );
2267 setModified(true);
2268 }
2269 else
2270 qDebug("KO: No tz change ");
2271
2256} 2272}
2257 2273
2258 2274
2259void CalendarView::slotSelectPickerDate( QDate d) 2275void CalendarView::slotSelectPickerDate( QDate d)
2260{ 2276{
2261 mDateFrame->hide(); 2277 mDateFrame->hide();
2262 if ( mDatePickerMode == 1 ) { 2278 if ( mDatePickerMode == 1 ) {
2263 mNavigator->slotDaySelect( d ); 2279 mNavigator->slotDaySelect( d );
2264 } else if ( mDatePickerMode == 2 ) { 2280 } else if ( mDatePickerMode == 2 ) {
2265 if ( mMoveIncidence->type() == "Todo" ) { 2281 if ( mMoveIncidence->type() == "Todo" ) {
2266 Todo * to = (Todo *) mMoveIncidence; 2282 Todo * to = (Todo *) mMoveIncidence;
2267 QTime tim; 2283 QTime tim;
2268 if ( to->hasDueDate() ) 2284 if ( to->hasDueDate() )
2269 tim = to->dtDue().time(); 2285 tim = to->dtDue().time();
2270 else { 2286 else {
2271 tim = QTime ( 0,0,0 ); 2287 tim = QTime ( 0,0,0 );
2272 to->setFloats( true ); 2288 to->setFloats( true );
2273 to->setHasDueDate( true ); 2289 to->setHasDueDate( true );
2274 } 2290 }
2275 QDateTime dt ( d,tim ); 2291 QDateTime dt ( d,tim );
2276 to->setDtDue( dt ); 2292 to->setDtDue( dt );
2277 todoChanged( to ); 2293 todoChanged( to );
2278 } else { 2294 } else {
2279 if ( mMoveIncidence->doesRecur() ) { 2295 if ( mMoveIncidence->doesRecur() ) {
2280#if 0 2296#if 0
2281 // PENDING implement this 2297 // PENDING implement this
2282 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2298 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2283 mCalendar()->addIncidence( newInc ); 2299 mCalendar()->addIncidence( newInc );
2284 if ( mMoveIncidence->type() == "Todo" ) 2300 if ( mMoveIncidence->type() == "Todo" )
2285 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 2301 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2286 else 2302 else
2287 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 2303 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2288 mMoveIncidence = newInc; 2304 mMoveIncidence = newInc;
2289 2305
2290#endif 2306#endif
2291 } 2307 }
2292 QTime tim = mMoveIncidence->dtStart().time(); 2308 QTime tim = mMoveIncidence->dtStart().time();
2293 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 2309 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
2294 QDateTime dt ( d,tim ); 2310 QDateTime dt ( d,tim );
2295 mMoveIncidence->setDtStart( dt ); 2311 mMoveIncidence->setDtStart( dt );
2296 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 2312 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
2297 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 2313 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
2298 } 2314 }
2299 2315
2300 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 2316 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
2301 } 2317 }
2302} 2318}
2303 2319