author | zautrix <zautrix> | 2004-12-07 09:55:57 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-12-07 09:55:57 (UTC) |
commit | 17b25691f0332e648dd1d800e89ccf4e1da8955d (patch) (side-by-side diff) | |
tree | b7bc28e6c57c043fc49328a7ebd86e1b5cd0f17a /korganizer | |
parent | dcd2bbbc8d3064b35f268a831c567feaafea5fd8 (diff) | |
download | kdepimpi-17b25691f0332e648dd1d800e89ccf4e1da8955d.zip kdepimpi-17b25691f0332e648dd1d800e89ccf4e1da8955d.tar.gz kdepimpi-17b25691f0332e648dd1d800e89ccf4e1da8955d.tar.bz2 |
some kopi usebility fixes
-rw-r--r-- | korganizer/calendarview.cpp | 46 | ||||
-rw-r--r-- | korganizer/calendarview.h | 3 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 4 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 10 | ||||
-rw-r--r-- | korganizer/komonthview.h | 3 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 3 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 7 |
7 files changed, 70 insertions, 6 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 543897a..15c5dd9 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -493,2 +493,9 @@ CalendarView::~CalendarView() } + +void CalendarView::showDay( QDate d ) +{ + dateNavigator()->selectDate( d ); + mViewManager->showWeekView(); + dateNavigator()->selectDate( d ); +} void CalendarView::timerAlarm() @@ -2211,2 +2218,3 @@ void CalendarView::edit_options() + void CalendarView::slotSelectPickerDate( QDate d) @@ -2231,2 +2239,15 @@ void CalendarView::slotSelectPickerDate( QDate d) } 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(); @@ -2428,2 +2449,4 @@ void CalendarView::moveIncidence(Incidence * inc ) } + //PENDING set date for recurring incidence to date of recurrence + //mMoveIncidenceOldDate; mDatePicker->setDate( da ); @@ -2886,3 +2909,3 @@ void CalendarView::deleteEvent(Event *anEvent) 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?"), @@ -2894,3 +2917,3 @@ void CalendarView::deleteEvent(Event *anEvent) } 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")+ @@ -2935,3 +2958,3 @@ void CalendarView::deleteEvent(Event *anEvent) 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?"), @@ -3801 +3824,18 @@ void CalendarView::removeSyncInfo( QString 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(); + } +} diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 437a51c..646973d 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -452,2 +452,4 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser void setSyncName( QString ); + void showDay( QDate ); + void undo_delete(); protected slots: @@ -556,2 +558,3 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser Incidence *mMoveIncidence; + QDate mMoveIncidenceOldDate; KOTodoView *mTodoList; diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index f027343..46184ac 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -152,2 +152,3 @@ void KOAgendaItem::recreateIncidence() { +#if 0 Incidence* newInc = mIncidence->clone(); @@ -162,3 +163,4 @@ void KOAgendaItem::recreateIncidence() } - mIncidence = newInc; +#endif + mIncidence = mIncidence->recreateCloneException( mDate ); } diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 7d1e82f..08232e2 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -283,4 +283,4 @@ MonthViewCell::MonthViewCell( KOMonthView *parent) updateConfig(); - connect( mLabel, SIGNAL( clicked( )), - SLOT( newEvent() )); + //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() )); + connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() )); connect( mItemList, SIGNAL( doubleClicked( QListBoxItem *) ), @@ -631,2 +631,6 @@ void MonthViewCell::defaultAction( QListBoxItem *item ) } +void MonthViewCell::showDay() +{ + emit showDaySignal( date() ); +} void MonthViewCell::newEvent() @@ -731,2 +735,4 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) SIGNAL( newEventSignal( QDateTime ) ) ); + connect( cell, SIGNAL( showDaySignal( QDate ) ), + SIGNAL( showDaySignal( QDate ) ) ); } diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index e94952f..5124057 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -145,2 +145,3 @@ class MonthViewCell : public QWidget void newEventSignal( QDateTime ); + void showDaySignal( QDate ); @@ -155,2 +156,3 @@ class MonthViewCell : public QWidget void newEvent(); + void showDay(); @@ -223,2 +225,3 @@ class KOMonthView: public KOEventView void selectWeekNum ( int ); + void showDaySignal( QDate ); protected: diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 391f98c..6e151f9 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -34,2 +34,3 @@ #endif +#include <qdatetime.h> #include "calendarview.h" @@ -446,2 +447,4 @@ void KOViewManager::showMonthView() mMainView, SLOT ( selectWeekNum( int ) ) ); + connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), + mMainView, SLOT ( showDay( QDate ) ) ); connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 46ae6a0..a652c05 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -578,2 +578,9 @@ void MainWindow::initActions() actionMenu->insertSeparator(); + + action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); + action->addTo( actionMenu ); + connect( action, SIGNAL( activated() ), + mView, SLOT( undo_delete() ) ); + actionMenu->insertSeparator(); + icon = loadPixmap( pathString + "newevent" ); |