summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp46
1 files changed, 43 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 543897a..15c5dd9 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -488,12 +488,19 @@ CalendarView::~CalendarView()
delete mViewManager;
delete mStorage;
delete mDateFrame ;
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() ");
computeAlarm(mAlarmNotification );
}
@@ -2206,12 +2213,13 @@ void CalendarView::edit_paste()
void CalendarView::edit_options()
{
mDialogManager->showOptionsDialog();
//writeSettings();
}
+
void CalendarView::slotSelectPickerDate( QDate d)
{
mDateFrame->hide();
if ( mDatePickerMode == 1 ) {
mNavigator->slotDaySelect( d );
} else if ( mDatePickerMode == 2 ) {
@@ -2226,12 +2234,25 @@ void CalendarView::slotSelectPickerDate( QDate d)
to->setHasDueDate( true );
}
QDateTime dt ( d,tim );
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 );
mMoveIncidence->setDtStart( dt );
((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
@@ -2423,12 +2444,14 @@ void CalendarView::moveIncidence(Incidence * inc )
da = to->dtDue().date();
else
da = QDate::currentDate();
} else {
da = mMoveIncidence->dtStart().date();
}
+ //PENDING set date for recurring incidence to date of recurrence
+ //mMoveIncidenceOldDate;
mDatePicker->setDate( da );
}
void CalendarView::showDatePicker( )
{
//qDebug("CalendarView::showDatePicker( ) ");
if ( mDateFrame->isVisible() )
@@ -2881,21 +2904,21 @@ void CalendarView::deleteEvent(Event *anEvent)
if (anEvent->recurrence()->doesRecur()) {
QDate itemDate = mViewManager->currentSelectionDate();
int km;
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 )
km = KMessageBox::No; // No = all below
} 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"),
i18n("All"));
}
switch(km) {
@@ -2930,13 +2953,13 @@ void CalendarView::deleteEvent(Event *anEvent)
}
break;
//#endif
} // 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
if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
schedule(Scheduler::Cancel,anEvent);
checkExternalId( anEvent);
@@ -3796,6 +3819,23 @@ void CalendarView::setSyncManager(KSyncManager* manager)
void CalendarView::removeSyncInfo( QString syncProfile)
{
qDebug("removeSyncInfo for profile %s ", syncProfile.latin1());
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();
+ }
+}