From 17b25691f0332e648dd1d800e89ccf4e1da8955d Mon Sep 17 00:00:00 2001 From: zautrix Date: Tue, 07 Dec 2004 09:55:57 +0000 Subject: some kopi usebility fixes --- (limited to 'korganizer/calendarview.cpp') diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 543897a..15c5dd9 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -491,6 +491,13 @@ CalendarView::~CalendarView() delete beamDialog; //kdDebug() << "~CalendarView() done" << endl; } + +void CalendarView::showDay( QDate d ) +{ + dateNavigator()->selectDate( d ); + mViewManager->showWeekView(); + dateNavigator()->selectDate( d ); +} void CalendarView::timerAlarm() { //qDebug("CalendarView::timerAlarm() "); @@ -2209,6 +2216,7 @@ void CalendarView::edit_options() //writeSettings(); } + void CalendarView::slotSelectPickerDate( QDate d) { mDateFrame->hide(); @@ -2229,6 +2237,19 @@ void CalendarView::slotSelectPickerDate( QDate d) to->setDtDue( dt ); todoChanged( to ); } else { + if ( mMoveIncidence->doesRecur() ) { +#if 0 + // PENDING implement this + Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); + mCalendar()->addIncidence( newInc ); + if ( mMoveIncidence->type() == "Todo" ) + emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); + else + emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); + mMoveIncidence = newInc; + +#endif + } QTime tim = mMoveIncidence->dtStart().time(); int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); QDateTime dt ( d,tim ); @@ -2426,6 +2447,8 @@ void CalendarView::moveIncidence(Incidence * inc ) } else { da = mMoveIncidence->dtStart().date(); } + //PENDING set date for recurring incidence to date of recurrence + //mMoveIncidenceOldDate; mDatePicker->setDate( da ); } void CalendarView::showDatePicker( ) @@ -2884,7 +2907,7 @@ void CalendarView::deleteEvent(Event *anEvent) if (!itemDate.isValid()) { //kdDebug() << "Date Not Valid" << endl; if (KOPrefs::instance()->mConfirm) { - km = KMessageBox::warningContinueCancel(this,anEvent->summary() + + km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), i18n("KO/Pi Confirmation"),i18n("Delete All")); if ( km == KMessageBox::Continue ) @@ -2892,7 +2915,7 @@ void CalendarView::deleteEvent(Event *anEvent) } else km = KMessageBox::No; } else { - km = KMessageBox::warningYesNoCancel(this,anEvent->summary() + + km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) + i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), i18n("KO/Pi Confirmation"),i18n("Current"), @@ -2933,7 +2956,7 @@ void CalendarView::deleteEvent(Event *anEvent) } // switch } else { if (KOPrefs::instance()->mConfirm) { - switch (KMessageBox::warningContinueCancel(this,anEvent->summary() + + switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + i18n("\nAre you sure you want\nto delete this event?"), i18n("KO/Pi Confirmation"),i18n("Delete"))) { case KMessageBox::Continue: // OK @@ -3799,3 +3822,20 @@ void CalendarView::removeSyncInfo( QString syncProfile) mCalendar->removeSyncInfo( syncProfile ); } + +void CalendarView::undo_delete() +{ + //qDebug("undo_delete() "); + Incidence* undo = mCalendar->undoIncidence(); + if ( !undo ) { + KMessageBox::sorry(this,i18n("There is nothing to undo!"), + i18n("KO/Pi")); + return; + } + if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + + i18n("\nAre you sure you want\nto restore this?"), + i18n("KO/Pi Confirmation"),i18n("Restore"))) { + mCalendar->undoDeleteIncidence(); + updateView(); + } +} -- cgit v0.9.0.2