author | zautrix <zautrix> | 2004-12-07 09:55:57 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-12-07 09:55:57 (UTC) |
commit | 17b25691f0332e648dd1d800e89ccf4e1da8955d (patch) (unidiff) | |
tree | b7bc28e6c57c043fc49328a7ebd86e1b5cd0f17a | |
parent | dcd2bbbc8d3064b35f268a831c567feaafea5fd8 (diff) | |
download | kdepimpi-17b25691f0332e648dd1d800e89ccf4e1da8955d.zip kdepimpi-17b25691f0332e648dd1d800e89ccf4e1da8955d.tar.gz kdepimpi-17b25691f0332e648dd1d800e89ccf4e1da8955d.tar.bz2 |
some kopi usebility fixes
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 13 | ||||
-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 | ||||
-rw-r--r-- | libkcal/calendar.cpp | 11 | ||||
-rw-r--r-- | libkcal/calendar.h | 3 | ||||
-rw-r--r-- | libkcal/calendarlocal.cpp | 17 | ||||
-rw-r--r-- | libkcal/incidence.cpp | 14 | ||||
-rw-r--r-- | libkcal/incidence.h | 1 | ||||
-rw-r--r-- | version | 2 |
14 files changed, 123 insertions, 14 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 5021212..46d59a3 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,18 +1,31 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 1.9.15 ************ | ||
4 | |||
5 | Usebilty enhancements in KO/Pi: | ||
6 | When clicking on the date in a month view cell, the day view is shown. | ||
7 | Old behaviour was, that the "new event" dialog popped up. | ||
8 | |||
9 | Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). | ||
10 | That means, you can restore the latest | ||
11 | event/todo/journal you have deleted. | ||
12 | A journal is deleted, if you clear all the text of the journal. | ||
13 | |||
14 | |||
15 | |||
3 | ********** VERSION 1.9.14 ************ | 16 | ********** VERSION 1.9.14 ************ |
4 | 17 | ||
5 | Fixed some problems with the dialog sizes when switching | 18 | Fixed some problems with the dialog sizes when switching |
6 | portrait/landscape mode on 640x480 PDA display. | 19 | portrait/landscape mode on 640x480 PDA display. |
7 | 20 | ||
8 | Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. | 21 | Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. |
9 | 22 | ||
10 | Fixed an ugly bug in KOpieMail: | 23 | Fixed an ugly bug in KOpieMail: |
11 | KOpieMail was not able to write files (mails) to MSDOS file system, | 24 | KOpieMail was not able to write files (mails) to MSDOS file system, |
12 | like on an usual preformatted SD card. That should work now. | 25 | like on an usual preformatted SD card. That should work now. |
13 | To save your mail data on the Sd card do the following: | 26 | To save your mail data on the Sd card do the following: |
14 | Create a dir on the SD card: | 27 | Create a dir on the SD card: |
15 | mkdir /mnt/card/localmail | 28 | mkdir /mnt/card/localmail |
16 | Go to your home dir: | 29 | Go to your home dir: |
17 | cd | 30 | cd |
18 | Go to kopiemail data storage dir: | 31 | Go to kopiemail data storage dir: |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 543897a..15c5dd9 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -478,32 +478,39 @@ void CalendarView::init() | |||
478 | #endif | 478 | #endif |
479 | 479 | ||
480 | } | 480 | } |
481 | 481 | ||
482 | 482 | ||
483 | CalendarView::~CalendarView() | 483 | CalendarView::~CalendarView() |
484 | { | 484 | { |
485 | // kdDebug() << "~CalendarView()" << endl; | 485 | // kdDebug() << "~CalendarView()" << endl; |
486 | //qDebug("CalendarView::~CalendarView() "); | 486 | //qDebug("CalendarView::~CalendarView() "); |
487 | delete mDialogManager; | 487 | delete mDialogManager; |
488 | delete mViewManager; | 488 | delete mViewManager; |
489 | delete mStorage; | 489 | delete mStorage; |
490 | delete mDateFrame ; | 490 | delete mDateFrame ; |
491 | delete beamDialog; | 491 | delete beamDialog; |
492 | //kdDebug() << "~CalendarView() done" << endl; | 492 | //kdDebug() << "~CalendarView() done" << endl; |
493 | } | 493 | } |
494 | |||
495 | void CalendarView::showDay( QDate d ) | ||
496 | { | ||
497 | dateNavigator()->selectDate( d ); | ||
498 | mViewManager->showWeekView(); | ||
499 | dateNavigator()->selectDate( d ); | ||
500 | } | ||
494 | void CalendarView::timerAlarm() | 501 | void CalendarView::timerAlarm() |
495 | { | 502 | { |
496 | //qDebug("CalendarView::timerAlarm() "); | 503 | //qDebug("CalendarView::timerAlarm() "); |
497 | computeAlarm(mAlarmNotification ); | 504 | computeAlarm(mAlarmNotification ); |
498 | } | 505 | } |
499 | 506 | ||
500 | void CalendarView::suspendAlarm() | 507 | void CalendarView::suspendAlarm() |
501 | { | 508 | { |
502 | //qDebug(" CalendarView::suspendAlarm() "); | 509 | //qDebug(" CalendarView::suspendAlarm() "); |
503 | computeAlarm(mSuspendAlarmNotification ); | 510 | computeAlarm(mSuspendAlarmNotification ); |
504 | 511 | ||
505 | } | 512 | } |
506 | 513 | ||
507 | void CalendarView::startAlarm( QString mess , QString filename) | 514 | void CalendarView::startAlarm( QString mess , QString filename) |
508 | { | 515 | { |
509 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); | 516 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); |
@@ -2196,52 +2203,66 @@ void CalendarView::edit_copy() | |||
2196 | void CalendarView::edit_paste() | 2203 | void CalendarView::edit_paste() |
2197 | { | 2204 | { |
2198 | QDate date = mNavigator->selectedDates().first(); | 2205 | QDate date = mNavigator->selectedDates().first(); |
2199 | 2206 | ||
2200 | DndFactory factory( mCalendar ); | 2207 | DndFactory factory( mCalendar ); |
2201 | Event *pastedEvent = factory.pasteEvent( date ); | 2208 | Event *pastedEvent = factory.pasteEvent( date ); |
2202 | 2209 | ||
2203 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); | 2210 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); |
2204 | } | 2211 | } |
2205 | 2212 | ||
2206 | void CalendarView::edit_options() | 2213 | void CalendarView::edit_options() |
2207 | { | 2214 | { |
2208 | mDialogManager->showOptionsDialog(); | 2215 | mDialogManager->showOptionsDialog(); |
2209 | //writeSettings(); | 2216 | //writeSettings(); |
2210 | } | 2217 | } |
2211 | 2218 | ||
2219 | |||
2212 | void CalendarView::slotSelectPickerDate( QDate d) | 2220 | void CalendarView::slotSelectPickerDate( QDate d) |
2213 | { | 2221 | { |
2214 | mDateFrame->hide(); | 2222 | mDateFrame->hide(); |
2215 | if ( mDatePickerMode == 1 ) { | 2223 | if ( mDatePickerMode == 1 ) { |
2216 | mNavigator->slotDaySelect( d ); | 2224 | mNavigator->slotDaySelect( d ); |
2217 | } else if ( mDatePickerMode == 2 ) { | 2225 | } else if ( mDatePickerMode == 2 ) { |
2218 | if ( mMoveIncidence->type() == "Todo" ) { | 2226 | if ( mMoveIncidence->type() == "Todo" ) { |
2219 | Todo * to = (Todo *) mMoveIncidence; | 2227 | Todo * to = (Todo *) mMoveIncidence; |
2220 | QTime tim; | 2228 | QTime tim; |
2221 | if ( to->hasDueDate() ) | 2229 | if ( to->hasDueDate() ) |
2222 | tim = to->dtDue().time(); | 2230 | tim = to->dtDue().time(); |
2223 | else { | 2231 | else { |
2224 | tim = QTime ( 0,0,0 ); | 2232 | tim = QTime ( 0,0,0 ); |
2225 | to->setFloats( true ); | 2233 | to->setFloats( true ); |
2226 | to->setHasDueDate( true ); | 2234 | to->setHasDueDate( true ); |
2227 | } | 2235 | } |
2228 | QDateTime dt ( d,tim ); | 2236 | QDateTime dt ( d,tim ); |
2229 | to->setDtDue( dt ); | 2237 | to->setDtDue( dt ); |
2230 | todoChanged( to ); | 2238 | todoChanged( to ); |
2231 | } else { | 2239 | } else { |
2240 | if ( mMoveIncidence->doesRecur() ) { | ||
2241 | #if 0 | ||
2242 | // PENDING implement this | ||
2243 | Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); | ||
2244 | mCalendar()->addIncidence( newInc ); | ||
2245 | if ( mMoveIncidence->type() == "Todo" ) | ||
2246 | emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); | ||
2247 | else | ||
2248 | emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); | ||
2249 | mMoveIncidence = newInc; | ||
2250 | |||
2251 | #endif | ||
2252 | } | ||
2232 | QTime tim = mMoveIncidence->dtStart().time(); | 2253 | QTime tim = mMoveIncidence->dtStart().time(); |
2233 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); | 2254 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); |
2234 | QDateTime dt ( d,tim ); | 2255 | QDateTime dt ( d,tim ); |
2235 | mMoveIncidence->setDtStart( dt ); | 2256 | mMoveIncidence->setDtStart( dt ); |
2236 | ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); | 2257 | ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); |
2237 | changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); | 2258 | changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); |
2238 | } | 2259 | } |
2239 | 2260 | ||
2240 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); | 2261 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); |
2241 | } | 2262 | } |
2242 | } | 2263 | } |
2243 | 2264 | ||
2244 | void CalendarView::removeCategories() | 2265 | void CalendarView::removeCategories() |
2245 | { | 2266 | { |
2246 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 2267 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
2247 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2268 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
@@ -2413,32 +2434,34 @@ void CalendarView::moveIncidence(Incidence * inc ) | |||
2413 | int dh = QApplication::desktop()->height(); | 2434 | int dh = QApplication::desktop()->height(); |
2414 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2435 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2415 | mDateFrame->show(); | 2436 | mDateFrame->show(); |
2416 | } | 2437 | } |
2417 | mDatePickerMode = 2; | 2438 | mDatePickerMode = 2; |
2418 | mMoveIncidence = inc ; | 2439 | mMoveIncidence = inc ; |
2419 | QDate da; | 2440 | QDate da; |
2420 | if ( mMoveIncidence->type() == "Todo" ) { | 2441 | if ( mMoveIncidence->type() == "Todo" ) { |
2421 | Todo * to = (Todo *) mMoveIncidence; | 2442 | Todo * to = (Todo *) mMoveIncidence; |
2422 | if ( to->hasDueDate() ) | 2443 | if ( to->hasDueDate() ) |
2423 | da = to->dtDue().date(); | 2444 | da = to->dtDue().date(); |
2424 | else | 2445 | else |
2425 | da = QDate::currentDate(); | 2446 | da = QDate::currentDate(); |
2426 | } else { | 2447 | } else { |
2427 | da = mMoveIncidence->dtStart().date(); | 2448 | da = mMoveIncidence->dtStart().date(); |
2428 | } | 2449 | } |
2450 | //PENDING set date for recurring incidence to date of recurrence | ||
2451 | //mMoveIncidenceOldDate; | ||
2429 | mDatePicker->setDate( da ); | 2452 | mDatePicker->setDate( da ); |
2430 | } | 2453 | } |
2431 | void CalendarView::showDatePicker( ) | 2454 | void CalendarView::showDatePicker( ) |
2432 | { | 2455 | { |
2433 | //qDebug("CalendarView::showDatePicker( ) "); | 2456 | //qDebug("CalendarView::showDatePicker( ) "); |
2434 | if ( mDateFrame->isVisible() ) | 2457 | if ( mDateFrame->isVisible() ) |
2435 | mDateFrame->hide(); | 2458 | mDateFrame->hide(); |
2436 | else { | 2459 | else { |
2437 | int w =mDatePicker->sizeHint().width() ; | 2460 | int w =mDatePicker->sizeHint().width() ; |
2438 | int h = mDatePicker->sizeHint().height() ; | 2461 | int h = mDatePicker->sizeHint().height() ; |
2439 | int dw = QApplication::desktop()->width(); | 2462 | int dw = QApplication::desktop()->width(); |
2440 | int dh = QApplication::desktop()->height(); | 2463 | int dh = QApplication::desktop()->height(); |
2441 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2464 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2442 | mDateFrame->show(); | 2465 | mDateFrame->show(); |
2443 | } | 2466 | } |
2444 | mDatePickerMode = 1; | 2467 | mDatePickerMode = 1; |
@@ -2871,41 +2894,41 @@ void CalendarView::deleteJournal(Journal *jour) | |||
2871 | emit updateSearchDialog(); | 2894 | emit updateSearchDialog(); |
2872 | } | 2895 | } |
2873 | 2896 | ||
2874 | void CalendarView::deleteEvent(Event *anEvent) | 2897 | void CalendarView::deleteEvent(Event *anEvent) |
2875 | { | 2898 | { |
2876 | if (!anEvent) { | 2899 | if (!anEvent) { |
2877 | KNotifyClient::beep(); | 2900 | KNotifyClient::beep(); |
2878 | return; | 2901 | return; |
2879 | } | 2902 | } |
2880 | 2903 | ||
2881 | if (anEvent->recurrence()->doesRecur()) { | 2904 | if (anEvent->recurrence()->doesRecur()) { |
2882 | QDate itemDate = mViewManager->currentSelectionDate(); | 2905 | QDate itemDate = mViewManager->currentSelectionDate(); |
2883 | int km; | 2906 | int km; |
2884 | if (!itemDate.isValid()) { | 2907 | if (!itemDate.isValid()) { |
2885 | //kdDebug() << "Date Not Valid" << endl; | 2908 | //kdDebug() << "Date Not Valid" << endl; |
2886 | if (KOPrefs::instance()->mConfirm) { | 2909 | if (KOPrefs::instance()->mConfirm) { |
2887 | km = KMessageBox::warningContinueCancel(this,anEvent->summary() + | 2910 | km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + |
2888 | i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), | 2911 | i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), |
2889 | i18n("KO/Pi Confirmation"),i18n("Delete All")); | 2912 | i18n("KO/Pi Confirmation"),i18n("Delete All")); |
2890 | if ( km == KMessageBox::Continue ) | 2913 | if ( km == KMessageBox::Continue ) |
2891 | km = KMessageBox::No; // No = all below | 2914 | km = KMessageBox::No; // No = all below |
2892 | } else | 2915 | } else |
2893 | km = KMessageBox::No; | 2916 | km = KMessageBox::No; |
2894 | } else { | 2917 | } else { |
2895 | km = KMessageBox::warningYesNoCancel(this,anEvent->summary() + | 2918 | km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) + |
2896 | i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ | 2919 | i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ |
2897 | KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), | 2920 | KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), |
2898 | i18n("KO/Pi Confirmation"),i18n("Current"), | 2921 | i18n("KO/Pi Confirmation"),i18n("Current"), |
2899 | i18n("All")); | 2922 | i18n("All")); |
2900 | } | 2923 | } |
2901 | switch(km) { | 2924 | switch(km) { |
2902 | 2925 | ||
2903 | case KMessageBox::No: // Continue // all | 2926 | case KMessageBox::No: // Continue // all |
2904 | //qDebug("KMessageBox::No "); | 2927 | //qDebug("KMessageBox::No "); |
2905 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 2928 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
2906 | schedule(Scheduler::Cancel,anEvent); | 2929 | schedule(Scheduler::Cancel,anEvent); |
2907 | 2930 | ||
2908 | checkExternalId( anEvent); | 2931 | checkExternalId( anEvent); |
2909 | mCalendar->deleteEvent(anEvent); | 2932 | mCalendar->deleteEvent(anEvent); |
2910 | changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); | 2933 | changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); |
2911 | break; | 2934 | break; |
@@ -2920,33 +2943,33 @@ void CalendarView::deleteEvent(Event *anEvent) | |||
2920 | // return; | 2943 | // return; |
2921 | //} | 2944 | //} |
2922 | //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); | 2945 | //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); |
2923 | if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { | 2946 | if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { |
2924 | anEvent->addExDate(itemDate); | 2947 | anEvent->addExDate(itemDate); |
2925 | int duration = anEvent->recurrence()->duration(); | 2948 | int duration = anEvent->recurrence()->duration(); |
2926 | if ( duration > 0 ) { | 2949 | if ( duration > 0 ) { |
2927 | anEvent->recurrence()->setDuration( duration - 1 ); | 2950 | anEvent->recurrence()->setDuration( duration - 1 ); |
2928 | } | 2951 | } |
2929 | changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); | 2952 | changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); |
2930 | } | 2953 | } |
2931 | break; | 2954 | break; |
2932 | //#endif | 2955 | //#endif |
2933 | } // switch | 2956 | } // switch |
2934 | } else { | 2957 | } else { |
2935 | if (KOPrefs::instance()->mConfirm) { | 2958 | if (KOPrefs::instance()->mConfirm) { |
2936 | switch (KMessageBox::warningContinueCancel(this,anEvent->summary() + | 2959 | switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + |
2937 | i18n("\nAre you sure you want\nto delete this event?"), | 2960 | i18n("\nAre you sure you want\nto delete this event?"), |
2938 | i18n("KO/Pi Confirmation"),i18n("Delete"))) { | 2961 | i18n("KO/Pi Confirmation"),i18n("Delete"))) { |
2939 | case KMessageBox::Continue: // OK | 2962 | case KMessageBox::Continue: // OK |
2940 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 2963 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
2941 | schedule(Scheduler::Cancel,anEvent); | 2964 | schedule(Scheduler::Cancel,anEvent); |
2942 | checkExternalId( anEvent); | 2965 | checkExternalId( anEvent); |
2943 | mCalendar->deleteEvent(anEvent); | 2966 | mCalendar->deleteEvent(anEvent); |
2944 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 2967 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
2945 | break; | 2968 | break; |
2946 | } // switch | 2969 | } // switch |
2947 | } else { | 2970 | } else { |
2948 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 2971 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
2949 | schedule(Scheduler::Cancel,anEvent); | 2972 | schedule(Scheduler::Cancel,anEvent); |
2950 | checkExternalId( anEvent); | 2973 | checkExternalId( anEvent); |
2951 | mCalendar->deleteEvent(anEvent); | 2974 | mCalendar->deleteEvent(anEvent); |
2952 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 2975 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
@@ -3786,16 +3809,33 @@ bool CalendarView::syncExternal(KSyncManager* manager, QString resource) | |||
3786 | if ( resource == "phone" ) | 3809 | if ( resource == "phone" ) |
3787 | syncExternal( 1 ); | 3810 | syncExternal( 1 ); |
3788 | // pending setmodified | 3811 | // pending setmodified |
3789 | return true; | 3812 | return true; |
3790 | } | 3813 | } |
3791 | void CalendarView::setSyncManager(KSyncManager* manager) | 3814 | void CalendarView::setSyncManager(KSyncManager* manager) |
3792 | { | 3815 | { |
3793 | mSyncManager = manager; | 3816 | mSyncManager = manager; |
3794 | } | 3817 | } |
3795 | 3818 | ||
3796 | void CalendarView::removeSyncInfo( QString syncProfile) | 3819 | void CalendarView::removeSyncInfo( QString syncProfile) |
3797 | { | 3820 | { |
3798 | qDebug("removeSyncInfo for profile %s ", syncProfile.latin1()); | 3821 | qDebug("removeSyncInfo for profile %s ", syncProfile.latin1()); |
3799 | mCalendar->removeSyncInfo( syncProfile ); | 3822 | mCalendar->removeSyncInfo( syncProfile ); |
3800 | 3823 | ||
3801 | } | 3824 | } |
3825 | |||
3826 | void CalendarView::undo_delete() | ||
3827 | { | ||
3828 | //qDebug("undo_delete() "); | ||
3829 | Incidence* undo = mCalendar->undoIncidence(); | ||
3830 | if ( !undo ) { | ||
3831 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), | ||
3832 | i18n("KO/Pi")); | ||
3833 | return; | ||
3834 | } | ||
3835 | if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + | ||
3836 | i18n("\nAre you sure you want\nto restore this?"), | ||
3837 | i18n("KO/Pi Confirmation"),i18n("Restore"))) { | ||
3838 | mCalendar->undoDeleteIncidence(); | ||
3839 | updateView(); | ||
3840 | } | ||
3841 | } | ||
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 437a51c..646973d 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -437,32 +437,34 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
437 | bool importQtopia( const QString &categoriesFile, | 437 | bool importQtopia( const QString &categoriesFile, |
438 | const QString &datebookFile, | 438 | const QString &datebookFile, |
439 | const QString &tasklistFile ); | 439 | const QString &tasklistFile ); |
440 | void syncExternal( int mode ); | 440 | void syncExternal( int mode ); |
441 | void slotSelectPickerDate( QDate ) ; | 441 | void slotSelectPickerDate( QDate ) ; |
442 | void showDatePicker( ) ; | 442 | void showDatePicker( ) ; |
443 | void moveIncidence(Incidence *) ; | 443 | void moveIncidence(Incidence *) ; |
444 | void beamIncidence(Incidence *) ; | 444 | void beamIncidence(Incidence *) ; |
445 | void beamCalendar() ; | 445 | void beamCalendar() ; |
446 | void beamFilteredCalendar() ; | 446 | void beamFilteredCalendar() ; |
447 | void beamIncidenceList(QPtrList<Incidence>) ; | 447 | void beamIncidenceList(QPtrList<Incidence>) ; |
448 | void manageCategories(); | 448 | void manageCategories(); |
449 | int addCategories(); | 449 | int addCategories(); |
450 | void removeCategories(); | 450 | void removeCategories(); |
451 | void setSyncDevice( QString ); | 451 | void setSyncDevice( QString ); |
452 | void setSyncName( QString ); | 452 | void setSyncName( QString ); |
453 | void showDay( QDate ); | ||
454 | void undo_delete(); | ||
453 | protected slots: | 455 | protected slots: |
454 | void timerAlarm(); | 456 | void timerAlarm(); |
455 | void suspendAlarm(); | 457 | void suspendAlarm(); |
456 | void beamDone( Ir *ir ); | 458 | void beamDone( Ir *ir ); |
457 | /** Select a view or adapt the current view to display the specified dates. */ | 459 | /** Select a view or adapt the current view to display the specified dates. */ |
458 | void showDates( const KCal::DateList & ); | 460 | void showDates( const KCal::DateList & ); |
459 | void selectWeekNum ( int ); | 461 | void selectWeekNum ( int ); |
460 | 462 | ||
461 | public: | 463 | public: |
462 | // show a standard warning | 464 | // show a standard warning |
463 | // returns KMsgBox::yesNoCancel() | 465 | // returns KMsgBox::yesNoCancel() |
464 | int msgCalModified(); | 466 | int msgCalModified(); |
465 | virtual bool sync(KSyncManager* manager, QString filename, int mode); | 467 | virtual bool sync(KSyncManager* manager, QString filename, int mode); |
466 | 468 | ||
467 | virtual bool syncExternal(KSyncManager* manager, QString resource); | 469 | virtual bool syncExternal(KSyncManager* manager, QString resource); |
468 | virtual void removeSyncInfo( QString syncProfile); | 470 | virtual void removeSyncInfo( QString syncProfile); |
@@ -541,32 +543,33 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
541 | 543 | ||
542 | DateNavigator *mNavigator; | 544 | DateNavigator *mNavigator; |
543 | 545 | ||
544 | KOViewManager *mViewManager; | 546 | KOViewManager *mViewManager; |
545 | KODialogManager *mDialogManager; | 547 | KODialogManager *mDialogManager; |
546 | 548 | ||
547 | // Calendar filters | 549 | // Calendar filters |
548 | QPtrList<CalFilter> mFilters; | 550 | QPtrList<CalFilter> mFilters; |
549 | 551 | ||
550 | // various housekeeping variables. | 552 | // various housekeeping variables. |
551 | bool mModified; // flag indicating if calendar is modified | 553 | bool mModified; // flag indicating if calendar is modified |
552 | bool mReadOnly; // flag indicating if calendar is read-only | 554 | bool mReadOnly; // flag indicating if calendar is read-only |
553 | QDate mSaveSingleDate; | 555 | QDate mSaveSingleDate; |
554 | 556 | ||
555 | Incidence *mSelectedIncidence; | 557 | Incidence *mSelectedIncidence; |
556 | Incidence *mMoveIncidence; | 558 | Incidence *mMoveIncidence; |
559 | QDate mMoveIncidenceOldDate; | ||
557 | KOTodoView *mTodoList; | 560 | KOTodoView *mTodoList; |
558 | KOEventEditor * mEventEditor; | 561 | KOEventEditor * mEventEditor; |
559 | KOTodoEditor * mTodoEditor; | 562 | KOTodoEditor * mTodoEditor; |
560 | KOEventViewerDialog * mEventViewerDialog; | 563 | KOEventViewerDialog * mEventViewerDialog; |
561 | void keyPressEvent ( QKeyEvent *e) ; | 564 | void keyPressEvent ( QKeyEvent *e) ; |
562 | //QMap<Incidence*,KOIncidenceEditor*> mDialogList; | 565 | //QMap<Incidence*,KOIncidenceEditor*> mDialogList; |
563 | }; | 566 | }; |
564 | 567 | ||
565 | 568 | ||
566 | class CalendarViewVisitor : public Incidence::Visitor | 569 | class CalendarViewVisitor : public Incidence::Visitor |
567 | { | 570 | { |
568 | public: | 571 | public: |
569 | CalendarViewVisitor() : mView( 0 ) {} | 572 | CalendarViewVisitor() : mView( 0 ) {} |
570 | 573 | ||
571 | bool act( Incidence *incidence, CalendarView *view ) | 574 | bool act( Incidence *incidence, CalendarView *view ) |
572 | { | 575 | { |
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index f027343..46184ac 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -137,43 +137,45 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | |||
137 | QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); | 137 | QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); |
138 | mFontPixelSize = fontinf.height();; | 138 | mFontPixelSize = fontinf.height();; |
139 | hide(); | 139 | hide(); |
140 | xPaintCoord = -1; | 140 | xPaintCoord = -1; |
141 | yPaintCoord = -1; | 141 | yPaintCoord = -1; |
142 | } | 142 | } |
143 | 143 | ||
144 | 144 | ||
145 | KOAgendaItem::~KOAgendaItem() | 145 | KOAgendaItem::~KOAgendaItem() |
146 | { | 146 | { |
147 | // qDebug("deleteKOAgendaItem::~KOAgendaItem( "); | 147 | // qDebug("deleteKOAgendaItem::~KOAgendaItem( "); |
148 | 148 | ||
149 | } | 149 | } |
150 | 150 | ||
151 | void KOAgendaItem::recreateIncidence() | 151 | void KOAgendaItem::recreateIncidence() |
152 | { | 152 | { |
153 | #if 0 | ||
153 | Incidence* newInc = mIncidence->clone(); | 154 | Incidence* newInc = mIncidence->clone(); |
154 | newInc->recreate(); | 155 | newInc->recreate(); |
155 | if ( mIncidence->doesRecur() ) { | 156 | if ( mIncidence->doesRecur() ) { |
156 | mIncidence->addExDate( mDate ); | 157 | mIncidence->addExDate( mDate ); |
157 | newInc->recurrence()->unsetRecurs(); | 158 | newInc->recurrence()->unsetRecurs(); |
158 | int len = mIncidence->dtStart().secsTo( ((Event*)mIncidence)->dtEnd()); | 159 | int len = mIncidence->dtStart().secsTo( ((Event*)mIncidence)->dtEnd()); |
159 | QTime tim = mIncidence->dtStart().time(); | 160 | QTime tim = mIncidence->dtStart().time(); |
160 | newInc->setDtStart( QDateTime(mDate, tim) ); | 161 | newInc->setDtStart( QDateTime(mDate, tim) ); |
161 | ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); | 162 | ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); |
162 | } | 163 | } |
163 | mIncidence = newInc; | 164 | #endif |
165 | mIncidence = mIncidence->recreateCloneException( mDate ); | ||
164 | } | 166 | } |
165 | bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) | 167 | bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) |
166 | { | 168 | { |
167 | int size = AGENDA_ICON_SIZE; | 169 | int size = AGENDA_ICON_SIZE; |
168 | 170 | ||
169 | int yOff = 0; | 171 | int yOff = 0; |
170 | int xOff = 0; | 172 | int xOff = 0; |
171 | int x = pos().x() +3; | 173 | int x = pos().x() +3; |
172 | int y; | 174 | int y; |
173 | if ( mAllDay ) | 175 | if ( mAllDay ) |
174 | y = pos().y()+3; | 176 | y = pos().y()+3; |
175 | else | 177 | else |
176 | y = mCellYTop * ( height() / cellHeight() ) +3; | 178 | y = mCellYTop * ( height() / cellHeight() ) +3; |
177 | if (mIncidence->cancelled()) { | 179 | if (mIncidence->cancelled()) { |
178 | int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; | 180 | int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; |
179 | int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; | 181 | int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 7d1e82f..08232e2 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -268,34 +268,34 @@ MonthViewCell::MonthViewCell( KOMonthView *parent) | |||
268 | //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain ); | 268 | //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain ); |
269 | //mLabel->setLineWidth( 1 ); | 269 | //mLabel->setLineWidth( 1 ); |
270 | //mLabel->setAlignment( AlignCenter ); | 270 | //mLabel->setAlignment( AlignCenter ); |
271 | mLabel->setFlat( true ); | 271 | mLabel->setFlat( true ); |
272 | mItemList = new KNoScrollListBox( this ); | 272 | mItemList = new KNoScrollListBox( this ); |
273 | mItemList->setMinimumSize( 10, 10 ); | 273 | mItemList->setMinimumSize( 10, 10 ); |
274 | mItemList->setFrameStyle( QFrame::Panel | QFrame::Plain ); | 274 | mItemList->setFrameStyle( QFrame::Panel | QFrame::Plain ); |
275 | mItemList->setLineWidth( 1 ); | 275 | mItemList->setLineWidth( 1 ); |
276 | topLayout->addWidget( mItemList ); | 276 | topLayout->addWidget( mItemList ); |
277 | mLabel->raise(); | 277 | mLabel->raise(); |
278 | // QColor( 0,0,255 ) QColor( 160,1600,255 ) | 278 | // QColor( 0,0,255 ) QColor( 160,1600,255 ) |
279 | mStandardPalette = palette(); | 279 | mStandardPalette = palette(); |
280 | mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) ); | 280 | mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) ); |
281 | 281 | ||
282 | enableScrollBars( false ); | 282 | enableScrollBars( false ); |
283 | updateConfig(); | 283 | updateConfig(); |
284 | connect( mLabel, SIGNAL( clicked( )), | 284 | //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() )); |
285 | SLOT( newEvent() )); | 285 | connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() )); |
286 | connect( mItemList, SIGNAL( doubleClicked( QListBoxItem *) ), | 286 | connect( mItemList, SIGNAL( doubleClicked( QListBoxItem *) ), |
287 | SLOT( defaultAction( QListBoxItem * ) ) ); | 287 | SLOT( defaultAction( QListBoxItem * ) ) ); |
288 | connect( mItemList, SIGNAL( rightButtonPressed( QListBoxItem *, | 288 | connect( mItemList, SIGNAL( rightButtonPressed( QListBoxItem *, |
289 | const QPoint &) ), | 289 | const QPoint &) ), |
290 | SLOT( contextMenu( QListBoxItem * ) ) ); | 290 | SLOT( contextMenu( QListBoxItem * ) ) ); |
291 | connect( mItemList, SIGNAL( highlighted( QListBoxItem *) ), | 291 | connect( mItemList, SIGNAL( highlighted( QListBoxItem *) ), |
292 | SLOT( selection( QListBoxItem * ) ) ); | 292 | SLOT( selection( QListBoxItem * ) ) ); |
293 | connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ), | 293 | connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ), |
294 | SLOT( cellClicked( QListBoxItem * ) ) ); | 294 | SLOT( cellClicked( QListBoxItem * ) ) ); |
295 | connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ), | 295 | connect( mItemList, SIGNAL( clicked( QListBoxItem * ) ), |
296 | SLOT( selection( QListBoxItem * ) ) ); | 296 | SLOT( selection( QListBoxItem * ) ) ); |
297 | } | 297 | } |
298 | 298 | ||
299 | void MonthViewCell::setDate( const QDate &date ) | 299 | void MonthViewCell::setDate( const QDate &date ) |
300 | { | 300 | { |
301 | // kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl; | 301 | // kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl; |
@@ -616,32 +616,36 @@ void MonthViewCell::resizeEvent ( QResizeEvent * ) | |||
616 | mItemList->verticalScrollBar()->setMaximumHeight( size ); | 616 | mItemList->verticalScrollBar()->setMaximumHeight( size ); |
617 | size = width() - mLabel->width(); | 617 | size = width() - mLabel->width(); |
618 | if ( size > 0 ) | 618 | if ( size > 0 ) |
619 | mItemList->horizontalScrollBar()->setMaximumWidth( size ); | 619 | mItemList->horizontalScrollBar()->setMaximumWidth( size ); |
620 | mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() ); | 620 | mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() ); |
621 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); | 621 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); |
622 | } | 622 | } |
623 | 623 | ||
624 | void MonthViewCell::defaultAction( QListBoxItem *item ) | 624 | void MonthViewCell::defaultAction( QListBoxItem *item ) |
625 | { | 625 | { |
626 | if ( !item ) return; | 626 | if ( !item ) return; |
627 | 627 | ||
628 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); | 628 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); |
629 | Incidence *incidence = eventItem->incidence(); | 629 | Incidence *incidence = eventItem->incidence(); |
630 | if ( incidence ) mMonthView->defaultAction( incidence ); | 630 | if ( incidence ) mMonthView->defaultAction( incidence ); |
631 | } | 631 | } |
632 | void MonthViewCell::showDay() | ||
633 | { | ||
634 | emit showDaySignal( date() ); | ||
635 | } | ||
632 | void MonthViewCell::newEvent() | 636 | void MonthViewCell::newEvent() |
633 | { | 637 | { |
634 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 638 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
635 | emit newEventSignal( dt ); | 639 | emit newEventSignal( dt ); |
636 | } | 640 | } |
637 | void MonthViewCell::cellClicked( QListBoxItem *item ) | 641 | void MonthViewCell::cellClicked( QListBoxItem *item ) |
638 | { | 642 | { |
639 | static QListBoxItem * lastClicked = 0; | 643 | static QListBoxItem * lastClicked = 0; |
640 | if ( item == 0 ) { | 644 | if ( item == 0 ) { |
641 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 645 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
642 | emit newEventSignal( dt ); | 646 | emit newEventSignal( dt ); |
643 | return; | 647 | return; |
644 | } | 648 | } |
645 | /* | 649 | /* |
646 | if ( lastClicked ) | 650 | if ( lastClicked ) |
647 | if ( ! item ) { | 651 | if ( ! item ) { |
@@ -716,32 +720,34 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
716 | //label->setLineWidth(1); | 720 | //label->setLineWidth(1); |
717 | //label->setAlignment(AlignCenter); | 721 | //label->setAlignment(AlignCenter); |
718 | mWeekLabels.insert( i, label ); | 722 | mWeekLabels.insert( i, label ); |
719 | } | 723 | } |
720 | mWeekLabels[mNumWeeks]->setText( i18n("W")); | 724 | mWeekLabels[mNumWeeks]->setText( i18n("W")); |
721 | int row, col; | 725 | int row, col; |
722 | mCells.resize( mNumCells ); | 726 | mCells.resize( mNumCells ); |
723 | for( row = 0; row < mNumWeeks; ++row ) { | 727 | for( row = 0; row < mNumWeeks; ++row ) { |
724 | for( col = 0; col < mDaysPerWeek; ++col ) { | 728 | for( col = 0; col < mDaysPerWeek; ++col ) { |
725 | MonthViewCell *cell = new MonthViewCell( this ); | 729 | MonthViewCell *cell = new MonthViewCell( this ); |
726 | mCells.insert( row * mDaysPerWeek + col, cell ); | 730 | mCells.insert( row * mDaysPerWeek + col, cell ); |
727 | 731 | ||
728 | connect( cell, SIGNAL( defaultAction( Incidence * ) ), | 732 | connect( cell, SIGNAL( defaultAction( Incidence * ) ), |
729 | SLOT( defaultAction( Incidence * ) ) ); | 733 | SLOT( defaultAction( Incidence * ) ) ); |
730 | connect( cell, SIGNAL( newEventSignal( QDateTime ) ), | 734 | connect( cell, SIGNAL( newEventSignal( QDateTime ) ), |
731 | SIGNAL( newEventSignal( QDateTime ) ) ); | 735 | SIGNAL( newEventSignal( QDateTime ) ) ); |
736 | connect( cell, SIGNAL( showDaySignal( QDate ) ), | ||
737 | SIGNAL( showDaySignal( QDate ) ) ); | ||
732 | } | 738 | } |
733 | } | 739 | } |
734 | 740 | ||
735 | mContextMenu = eventPopup(); | 741 | mContextMenu = eventPopup(); |
736 | // updateConfig(); //useless here | 742 | // updateConfig(); //useless here |
737 | 743 | ||
738 | emit incidenceSelected( 0 ); | 744 | emit incidenceSelected( 0 ); |
739 | } | 745 | } |
740 | 746 | ||
741 | KOMonthView::~KOMonthView() | 747 | KOMonthView::~KOMonthView() |
742 | { | 748 | { |
743 | delete mContextMenu; | 749 | delete mContextMenu; |
744 | } | 750 | } |
745 | 751 | ||
746 | int KOMonthView::maxDatesHint() | 752 | int KOMonthView::maxDatesHint() |
747 | { | 753 | { |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index e94952f..5124057 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -130,42 +130,44 @@ class MonthViewCell : public QWidget | |||
130 | 130 | ||
131 | void updateCell(); | 131 | void updateCell(); |
132 | 132 | ||
133 | void updateConfig(); | 133 | void updateConfig(); |
134 | 134 | ||
135 | void enableScrollBars( bool ); | 135 | void enableScrollBars( bool ); |
136 | 136 | ||
137 | Incidence *selectedIncidence(); | 137 | Incidence *selectedIncidence(); |
138 | QDate selectedIncidenceDate(); | 138 | QDate selectedIncidenceDate(); |
139 | 139 | ||
140 | void deselect(); | 140 | void deselect(); |
141 | void select(); | 141 | void select(); |
142 | 142 | ||
143 | signals: | 143 | signals: |
144 | void defaultAction( Incidence * ); | 144 | void defaultAction( Incidence * ); |
145 | void newEventSignal( QDateTime ); | 145 | void newEventSignal( QDateTime ); |
146 | void showDaySignal( QDate ); | ||
146 | 147 | ||
147 | protected: | 148 | protected: |
148 | void resizeEvent( QResizeEvent * ); | 149 | void resizeEvent( QResizeEvent * ); |
149 | 150 | ||
150 | protected slots: | 151 | protected slots: |
151 | void defaultAction( QListBoxItem * ); | 152 | void defaultAction( QListBoxItem * ); |
152 | void contextMenu( QListBoxItem * ); | 153 | void contextMenu( QListBoxItem * ); |
153 | void selection( QListBoxItem * ); | 154 | void selection( QListBoxItem * ); |
154 | void cellClicked( QListBoxItem * ); | 155 | void cellClicked( QListBoxItem * ); |
155 | void newEvent(); | 156 | void newEvent(); |
157 | void showDay(); | ||
156 | 158 | ||
157 | private: | 159 | private: |
158 | KOMonthView *mMonthView; | 160 | KOMonthView *mMonthView; |
159 | 161 | ||
160 | QDate mDate; | 162 | QDate mDate; |
161 | bool mPrimary; | 163 | bool mPrimary; |
162 | bool mHoliday; | 164 | bool mHoliday; |
163 | QString mHolidayString; | 165 | QString mHolidayString; |
164 | 166 | ||
165 | //QLabel *mLabel; | 167 | //QLabel *mLabel; |
166 | QPushButton *mLabel; | 168 | QPushButton *mLabel; |
167 | QListBox *mItemList; | 169 | QListBox *mItemList; |
168 | 170 | ||
169 | QSize mLabelSize; | 171 | QSize mLabelSize; |
170 | QSize mLabelBigSize; | 172 | QSize mLabelBigSize; |
171 | QPalette mHolidayPalette; | 173 | QPalette mHolidayPalette; |
@@ -208,32 +210,33 @@ class KOMonthView: public KOEventView | |||
208 | virtual void updateConfig(); | 210 | virtual void updateConfig(); |
209 | virtual void showDates(const QDate &start, const QDate &end); | 211 | virtual void showDates(const QDate &start, const QDate &end); |
210 | virtual void showEvents(QPtrList<Event> eventList); | 212 | virtual void showEvents(QPtrList<Event> eventList); |
211 | 213 | ||
212 | void changeEventDisplay(Event *, int); | 214 | void changeEventDisplay(Event *, int); |
213 | 215 | ||
214 | void clearSelection(); | 216 | void clearSelection(); |
215 | 217 | ||
216 | void showContextMenu( Incidence * ); | 218 | void showContextMenu( Incidence * ); |
217 | 219 | ||
218 | void setSelectedCell( MonthViewCell * ); | 220 | void setSelectedCell( MonthViewCell * ); |
219 | 221 | ||
220 | protected slots: | 222 | protected slots: |
221 | void processSelectionChange(); | 223 | void processSelectionChange(); |
222 | signals: | 224 | signals: |
223 | void selectWeekNum ( int ); | 225 | void selectWeekNum ( int ); |
226 | void showDaySignal( QDate ); | ||
224 | protected: | 227 | protected: |
225 | void resizeEvent(QResizeEvent *); | 228 | void resizeEvent(QResizeEvent *); |
226 | void viewChanged(); | 229 | void viewChanged(); |
227 | void updateDayLabels(); | 230 | void updateDayLabels(); |
228 | 231 | ||
229 | private: | 232 | private: |
230 | int mDaysPerWeek; | 233 | int mDaysPerWeek; |
231 | int mNumWeeks; | 234 | int mNumWeeks; |
232 | int mNumCells; | 235 | int mNumCells; |
233 | bool mWeekStartsMonday; | 236 | bool mWeekStartsMonday; |
234 | bool mShowSatSunComp; | 237 | bool mShowSatSunComp; |
235 | void computeLayout(); | 238 | void computeLayout(); |
236 | 239 | ||
237 | QPtrVector<MonthViewCell> mCells; | 240 | QPtrVector<MonthViewCell> mCells; |
238 | QPtrVector<QLabel> mDayLabels; | 241 | QPtrVector<QLabel> mDayLabels; |
239 | QPtrVector<KOWeekButton> mWeekLabels; | 242 | QPtrVector<KOWeekButton> mWeekLabels; |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 391f98c..6e151f9 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -19,32 +19,33 @@ | |||
19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
20 | 20 | ||
21 | As a special exception, permission is given to link this program | 21 | As a special exception, permission is given to link this program |
22 | with any edition of Qt, and distribute the resulting executable, | 22 | with any edition of Qt, and distribute the resulting executable, |
23 | without including the source code for Qt in the source distribution. | 23 | without including the source code for Qt in the source distribution. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <qwidgetstack.h> | 26 | #include <qwidgetstack.h> |
27 | 27 | ||
28 | #include <kconfig.h> | 28 | #include <kconfig.h> |
29 | #include <kglobal.h> | 29 | #include <kglobal.h> |
30 | #ifndef DESKTOP_VERSION | 30 | #ifndef DESKTOP_VERSION |
31 | #include <qpe/qpeapplication.h> | 31 | #include <qpe/qpeapplication.h> |
32 | #else | 32 | #else |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #endif | 34 | #endif |
35 | #include <qdatetime.h> | ||
35 | #include "calendarview.h" | 36 | #include "calendarview.h" |
36 | #include "datenavigator.h" | 37 | #include "datenavigator.h" |
37 | #include "kotodoview.h" | 38 | #include "kotodoview.h" |
38 | #include "koagendaview.h" | 39 | #include "koagendaview.h" |
39 | #include "kodialogmanager.h" | 40 | #include "kodialogmanager.h" |
40 | #include "komonthview.h" | 41 | #include "komonthview.h" |
41 | #include "kolistview.h" | 42 | #include "kolistview.h" |
42 | #include "kowhatsnextview.h" | 43 | #include "kowhatsnextview.h" |
43 | #include "kojournalview.h" | 44 | #include "kojournalview.h" |
44 | #include "kotimespanview.h" | 45 | #include "kotimespanview.h" |
45 | #include "koprefs.h" | 46 | #include "koprefs.h" |
46 | #include "navigatorbar.h" | 47 | #include "navigatorbar.h" |
47 | 48 | ||
48 | #include "koviewmanager.h" | 49 | #include "koviewmanager.h" |
49 | //extern bool externFlagMonthviewBlockPainting; | 50 | //extern bool externFlagMonthviewBlockPainting; |
50 | 51 | ||
@@ -431,32 +432,34 @@ void KOViewManager::showMonthView() | |||
431 | connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 432 | connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
432 | mMainView, SLOT(deleteIncidence(Incidence *))); | 433 | mMainView, SLOT(deleteIncidence(Incidence *))); |
433 | 434 | ||
434 | connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), | 435 | connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), |
435 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 436 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
436 | connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 437 | connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
437 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 438 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
438 | connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 439 | connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
439 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 440 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
440 | 441 | ||
441 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 442 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
442 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 443 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
443 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 444 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
444 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 445 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
445 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), | 446 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), |
446 | mMainView, SLOT ( selectWeekNum( int ) ) ); | 447 | mMainView, SLOT ( selectWeekNum( int ) ) ); |
448 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), | ||
449 | mMainView, SLOT ( showDay( QDate ) ) ); | ||
447 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); | 450 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); |
448 | mMonthView->updateConfig(); | 451 | mMonthView->updateConfig(); |
449 | } | 452 | } |
450 | 453 | ||
451 | globalFlagBlockAgenda = 1; | 454 | globalFlagBlockAgenda = 1; |
452 | //mFlagShowNextxDays = false; | 455 | //mFlagShowNextxDays = false; |
453 | // if(mMonthView == mCurrentView) return; | 456 | // if(mMonthView == mCurrentView) return; |
454 | mMainView->dateNavigator()->selectMonth(); | 457 | mMainView->dateNavigator()->selectMonth(); |
455 | // DateList tmpList = mMainView->dateNavigator()->selectedDates( ); | 458 | // DateList tmpList = mMainView->dateNavigator()->selectedDates( ); |
456 | //mMonthView->showDates(tmpList.first(), tmpList.last()); | 459 | //mMonthView->showDates(tmpList.first(), tmpList.last()); |
457 | 460 | ||
458 | showView(mMonthView, true ); | 461 | showView(mMonthView, true ); |
459 | 462 | ||
460 | } | 463 | } |
461 | 464 | ||
462 | void KOViewManager::showTodoView() | 465 | void KOViewManager::showTodoView() |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 46ae6a0..a652c05 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -563,32 +563,39 @@ void MainWindow::initActions() | |||
563 | configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); | 563 | configureAgendaMenu->insertItem(i18n("Tiny"), 4 ); |
564 | configureAgendaMenu->insertItem(i18n("Small"), 6 ); | 564 | configureAgendaMenu->insertItem(i18n("Small"), 6 ); |
565 | configureAgendaMenu->insertItem(i18n("Medium"), 8 ); | 565 | configureAgendaMenu->insertItem(i18n("Medium"), 8 ); |
566 | configureAgendaMenu->insertItem(i18n("Normal"), 10 ); | 566 | configureAgendaMenu->insertItem(i18n("Normal"), 10 ); |
567 | configureAgendaMenu->insertItem(i18n("Large"), 12 ); | 567 | configureAgendaMenu->insertItem(i18n("Large"), 12 ); |
568 | configureAgendaMenu->insertItem(i18n("Big"), 14 ); | 568 | configureAgendaMenu->insertItem(i18n("Big"), 14 ); |
569 | configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); | 569 | configureAgendaMenu->insertItem(i18n("Bigger"), 16 ); |
570 | configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); | 570 | configureAgendaMenu->insertItem(i18n("Biggest"), 18 ); |
571 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 571 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
572 | 572 | ||
573 | icon = loadPixmap( pathString + "configure" ); | 573 | icon = loadPixmap( pathString + "configure" ); |
574 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 574 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
575 | action->addTo( actionMenu ); | 575 | action->addTo( actionMenu ); |
576 | connect( action, SIGNAL( activated() ), | 576 | connect( action, SIGNAL( activated() ), |
577 | mView, SLOT( edit_options() ) ); | 577 | mView, SLOT( edit_options() ) ); |
578 | actionMenu->insertSeparator(); | 578 | actionMenu->insertSeparator(); |
579 | |||
580 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | ||
581 | action->addTo( actionMenu ); | ||
582 | connect( action, SIGNAL( activated() ), | ||
583 | mView, SLOT( undo_delete() ) ); | ||
584 | actionMenu->insertSeparator(); | ||
585 | |||
579 | icon = loadPixmap( pathString + "newevent" ); | 586 | icon = loadPixmap( pathString + "newevent" ); |
580 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 587 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
581 | configureToolBarMenu->insertSeparator(); | 588 | configureToolBarMenu->insertSeparator(); |
582 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 589 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
583 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 590 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
584 | ne_action->addTo( actionMenu ); | 591 | ne_action->addTo( actionMenu ); |
585 | connect( ne_action, SIGNAL( activated() ), | 592 | connect( ne_action, SIGNAL( activated() ), |
586 | mView, SLOT( newEvent() ) ); | 593 | mView, SLOT( newEvent() ) ); |
587 | icon = loadPixmap( pathString + "newtodo" ); | 594 | icon = loadPixmap( pathString + "newtodo" ); |
588 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 595 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
589 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 596 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
590 | nt_action->addTo( actionMenu ); | 597 | nt_action->addTo( actionMenu ); |
591 | connect( nt_action, SIGNAL( activated() ), | 598 | connect( nt_action, SIGNAL( activated() ), |
592 | mView, SLOT( newTodo() ) ); | 599 | mView, SLOT( newTodo() ) ); |
593 | icon = loadPixmap( pathString + "navi" ); | 600 | icon = loadPixmap( pathString + "navi" ); |
594 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 601 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp index 52daaaa..88351eb 100644 --- a/libkcal/calendar.cpp +++ b/libkcal/calendar.cpp | |||
@@ -39,33 +39,33 @@ Calendar::Calendar() | |||
39 | 39 | ||
40 | init(); | 40 | init(); |
41 | setTimeZoneId( i18n (" 00:00 Europe/London(UTC)") ); | 41 | setTimeZoneId( i18n (" 00:00 Europe/London(UTC)") ); |
42 | } | 42 | } |
43 | 43 | ||
44 | Calendar::Calendar( const QString &timeZoneId ) | 44 | Calendar::Calendar( const QString &timeZoneId ) |
45 | { | 45 | { |
46 | 46 | ||
47 | init(); | 47 | init(); |
48 | setTimeZoneId(timeZoneId); | 48 | setTimeZoneId(timeZoneId); |
49 | } | 49 | } |
50 | 50 | ||
51 | void Calendar::init() | 51 | void Calendar::init() |
52 | { | 52 | { |
53 | mObserver = 0; | 53 | mObserver = 0; |
54 | mNewObserver = false; | 54 | mNewObserver = false; |
55 | 55 | mUndoIncidence = 0; | |
56 | mModified = false; | 56 | mModified = false; |
57 | 57 | ||
58 | // Setup default filter, which does nothing | 58 | // Setup default filter, which does nothing |
59 | mDefaultFilter = new CalFilter; | 59 | mDefaultFilter = new CalFilter; |
60 | mFilter = mDefaultFilter; | 60 | mFilter = mDefaultFilter; |
61 | mFilter->setEnabled(false); | 61 | mFilter->setEnabled(false); |
62 | 62 | ||
63 | // initialize random numbers. This is a hack, and not | 63 | // initialize random numbers. This is a hack, and not |
64 | // even that good of one at that. | 64 | // even that good of one at that. |
65 | // srandom(time(0)); | 65 | // srandom(time(0)); |
66 | 66 | ||
67 | // user information... | 67 | // user information... |
68 | setOwner(i18n("Unknown Name")); | 68 | setOwner(i18n("Unknown Name")); |
69 | setEmail(i18n("unknown@nowhere")); | 69 | setEmail(i18n("unknown@nowhere")); |
70 | 70 | ||
71 | #if 0 | 71 | #if 0 |
@@ -96,39 +96,48 @@ void Calendar::init() | |||
96 | // to rewrite these settings to the config file. | 96 | // to rewrite these settings to the config file. |
97 | if ((now->tm_isdst && !dstSetting) || | 97 | if ((now->tm_isdst && !dstSetting) || |
98 | (!now->tm_isdst && dstSetting)) { | 98 | (!now->tm_isdst && dstSetting)) { |
99 | KOPrefs::instance()->mTimeZone = tzStr; | 99 | KOPrefs::instance()->mTimeZone = tzStr; |
100 | KOPrefs::instance()->mDaylightSavings = now->tm_isdst; | 100 | KOPrefs::instance()->mDaylightSavings = now->tm_isdst; |
101 | } | 101 | } |
102 | 102 | ||
103 | setTimeZone(tzStr); | 103 | setTimeZone(tzStr); |
104 | #endif | 104 | #endif |
105 | 105 | ||
106 | // KOPrefs::instance()->writeConfig(); | 106 | // KOPrefs::instance()->writeConfig(); |
107 | } | 107 | } |
108 | 108 | ||
109 | Calendar::~Calendar() | 109 | Calendar::~Calendar() |
110 | { | 110 | { |
111 | delete mDefaultFilter; | 111 | delete mDefaultFilter; |
112 | if ( mUndoIncidence ) | ||
113 | delete mUndoIncidence; | ||
112 | } | 114 | } |
113 | 115 | ||
114 | const QString &Calendar::getOwner() const | 116 | const QString &Calendar::getOwner() const |
115 | { | 117 | { |
116 | return mOwner; | 118 | return mOwner; |
117 | } | 119 | } |
118 | 120 | ||
121 | bool Calendar::undoDeleteIncidence() | ||
122 | { | ||
123 | if (!mUndoIncidence) | ||
124 | return false; | ||
125 | addIncidence(mUndoIncidence); | ||
126 | mUndoIncidence = 0; | ||
127 | } | ||
119 | void Calendar::setOwner(const QString &os) | 128 | void Calendar::setOwner(const QString &os) |
120 | { | 129 | { |
121 | int i; | 130 | int i; |
122 | mOwner = os; | 131 | mOwner = os; |
123 | i = mOwner.find(','); | 132 | i = mOwner.find(','); |
124 | if (i != -1) | 133 | if (i != -1) |
125 | mOwner = mOwner.left(i); | 134 | mOwner = mOwner.left(i); |
126 | 135 | ||
127 | setModified( true ); | 136 | setModified( true ); |
128 | } | 137 | } |
129 | 138 | ||
130 | void Calendar::setTimeZone(const QString & tz) | 139 | void Calendar::setTimeZone(const QString & tz) |
131 | { | 140 | { |
132 | bool neg = FALSE; | 141 | bool neg = FALSE; |
133 | int hours, minutes; | 142 | int hours, minutes; |
134 | QString tmpStr(tz); | 143 | QString tmpStr(tz); |
diff --git a/libkcal/calendar.h b/libkcal/calendar.h index b7d6a1f..2f2c3aa 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h | |||
@@ -52,32 +52,34 @@ namespace KCal { | |||
52 | Ownership of events etc. is handled by the following policy: As soon as an | 52 | Ownership of events etc. is handled by the following policy: As soon as an |
53 | event (or any other subclass of IncidenceBase) object is added to the | 53 | event (or any other subclass of IncidenceBase) object is added to the |
54 | Calendar by addEvent() it is owned by the Calendar object. The Calendar takes | 54 | Calendar by addEvent() it is owned by the Calendar object. The Calendar takes |
55 | care of deleting it. All Events returned by the query functions are returned | 55 | care of deleting it. All Events returned by the query functions are returned |
56 | as pointers, that means all changes to the returned events are immediately | 56 | as pointers, that means all changes to the returned events are immediately |
57 | visible in the Calendar. You shouldn't delete any Event object you get from | 57 | visible in the Calendar. You shouldn't delete any Event object you get from |
58 | Calendar. | 58 | Calendar. |
59 | */ | 59 | */ |
60 | class Calendar : public QObject, public CustomProperties, | 60 | class Calendar : public QObject, public CustomProperties, |
61 | public IncidenceBase::Observer | 61 | public IncidenceBase::Observer |
62 | { | 62 | { |
63 | Q_OBJECT | 63 | Q_OBJECT |
64 | public: | 64 | public: |
65 | Calendar(); | 65 | Calendar(); |
66 | Calendar(const QString &timeZoneId); | 66 | Calendar(const QString &timeZoneId); |
67 | virtual ~Calendar(); | 67 | virtual ~Calendar(); |
68 | Incidence * undoIncidence() { return mUndoIncidence; }; | ||
69 | bool undoDeleteIncidence(); | ||
68 | void deleteIncidence(Incidence *in); | 70 | void deleteIncidence(Incidence *in); |
69 | void resetTempSyncStat(); | 71 | void resetTempSyncStat(); |
70 | void resetPilotStat(int id); | 72 | void resetPilotStat(int id); |
71 | /** | 73 | /** |
72 | Clears out the current calendar, freeing all used memory etc. | 74 | Clears out the current calendar, freeing all used memory etc. |
73 | */ | 75 | */ |
74 | virtual void close() = 0; | 76 | virtual void close() = 0; |
75 | 77 | ||
76 | /** | 78 | /** |
77 | Sync changes in memory to persistant storage. | 79 | Sync changes in memory to persistant storage. |
78 | */ | 80 | */ |
79 | virtual void save() = 0; | 81 | virtual void save() = 0; |
80 | virtual QPtrList<Event> getExternLastSyncEvents() = 0; | 82 | virtual QPtrList<Event> getExternLastSyncEvents() = 0; |
81 | virtual void removeSyncInfo( QString syncProfile) = 0; | 83 | virtual void removeSyncInfo( QString syncProfile) = 0; |
82 | virtual bool isSaving() { return false; } | 84 | virtual bool isSaving() { return false; } |
83 | 85 | ||
@@ -309,32 +311,33 @@ public: | |||
309 | /** | 311 | /** |
310 | Get unfiltered events, which occur on the given date. | 312 | Get unfiltered events, which occur on the given date. |
311 | */ | 313 | */ |
312 | virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0; | 314 | virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0; |
313 | /** | 315 | /** |
314 | Get unfiltered events, which occur on the given date. | 316 | Get unfiltered events, which occur on the given date. |
315 | */ | 317 | */ |
316 | virtual QPtrList<Event> rawEventsForDate( const QDate &date, | 318 | virtual QPtrList<Event> rawEventsForDate( const QDate &date, |
317 | bool sorted = false ) = 0; | 319 | bool sorted = false ) = 0; |
318 | /** | 320 | /** |
319 | Get events in a range of dates. If inclusive is set to true, only events | 321 | Get events in a range of dates. If inclusive is set to true, only events |
320 | are returned, which are completely included in the range. | 322 | are returned, which are completely included in the range. |
321 | */ | 323 | */ |
322 | virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end, | 324 | virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end, |
323 | bool inclusive = false ) = 0; | 325 | bool inclusive = false ) = 0; |
324 | Incidence *mNextAlarmIncidence; | 326 | Incidence *mNextAlarmIncidence; |
327 | Incidence *mUndoIncidence; | ||
325 | 328 | ||
326 | private: | 329 | private: |
327 | void init(); | 330 | void init(); |
328 | 331 | ||
329 | QString mOwner; // who the calendar belongs to | 332 | QString mOwner; // who the calendar belongs to |
330 | QString mOwnerEmail; // email address of the owner | 333 | QString mOwnerEmail; // email address of the owner |
331 | int mTimeZone; // timezone OFFSET from GMT (MINUTES) | 334 | int mTimeZone; // timezone OFFSET from GMT (MINUTES) |
332 | bool mLocalTime; // use local time, not UTC or a time zone | 335 | bool mLocalTime; // use local time, not UTC or a time zone |
333 | 336 | ||
334 | CalFilter *mFilter; | 337 | CalFilter *mFilter; |
335 | CalFilter *mDefaultFilter; | 338 | CalFilter *mDefaultFilter; |
336 | 339 | ||
337 | QString mTimeZoneId; | 340 | QString mTimeZoneId; |
338 | 341 | ||
339 | Observer *mObserver; | 342 | Observer *mObserver; |
340 | bool mNewObserver; | 343 | bool mNewObserver; |
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 3f46d53..12294c0 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp | |||
@@ -139,37 +139,37 @@ bool CalendarLocal::addEventNoDup( Event *event ) | |||
139 | return addEvent( event ); | 139 | return addEvent( event ); |
140 | } | 140 | } |
141 | 141 | ||
142 | bool CalendarLocal::addEvent( Event *event ) | 142 | bool CalendarLocal::addEvent( Event *event ) |
143 | { | 143 | { |
144 | insertEvent( event ); | 144 | insertEvent( event ); |
145 | 145 | ||
146 | event->registerObserver( this ); | 146 | event->registerObserver( this ); |
147 | 147 | ||
148 | setModified( true ); | 148 | setModified( true ); |
149 | 149 | ||
150 | return true; | 150 | return true; |
151 | } | 151 | } |
152 | 152 | ||
153 | void CalendarLocal::deleteEvent( Event *event ) | 153 | void CalendarLocal::deleteEvent( Event *event ) |
154 | { | 154 | { |
155 | 155 | if ( mUndoIncidence ) delete mUndoIncidence; | |
156 | 156 | mUndoIncidence = event->clone(); | |
157 | if ( mEventList.removeRef( event ) ) { | 157 | if ( mEventList.removeRef( event ) ) { |
158 | setModified( true ); | 158 | setModified( true ); |
159 | } | 159 | } |
160 | } | 160 | } |
161 | 161 | ||
162 | 162 | ||
163 | Event *CalendarLocal::event( const QString &uid ) | 163 | Event *CalendarLocal::event( const QString &uid ) |
164 | { | 164 | { |
165 | 165 | ||
166 | Event *event; | 166 | Event *event; |
167 | 167 | ||
168 | for ( event = mEventList.first(); event; event = mEventList.next() ) { | 168 | for ( event = mEventList.first(); event; event = mEventList.next() ) { |
169 | if ( event->uid() == uid ) { | 169 | if ( event->uid() == uid ) { |
170 | return event; | 170 | return event; |
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | return 0; | 174 | return 0; |
175 | } | 175 | } |
@@ -188,33 +188,35 @@ bool CalendarLocal::addTodo( Todo *todo ) | |||
188 | { | 188 | { |
189 | mTodoList.append( todo ); | 189 | mTodoList.append( todo ); |
190 | 190 | ||
191 | todo->registerObserver( this ); | 191 | todo->registerObserver( this ); |
192 | 192 | ||
193 | // Set up subtask relations | 193 | // Set up subtask relations |
194 | setupRelations( todo ); | 194 | setupRelations( todo ); |
195 | 195 | ||
196 | setModified( true ); | 196 | setModified( true ); |
197 | 197 | ||
198 | return true; | 198 | return true; |
199 | } | 199 | } |
200 | 200 | ||
201 | void CalendarLocal::deleteTodo( Todo *todo ) | 201 | void CalendarLocal::deleteTodo( Todo *todo ) |
202 | { | 202 | { |
203 | // Handle orphaned children | 203 | // Handle orphaned children |
204 | removeRelations( todo ); | 204 | if ( mUndoIncidence ) delete mUndoIncidence; |
205 | mUndoIncidence = todo->clone(); | ||
206 | removeRelations( todo ); | ||
205 | 207 | ||
206 | if ( mTodoList.removeRef( todo ) ) { | 208 | if ( mTodoList.removeRef( todo ) ) { |
207 | setModified( true ); | 209 | setModified( true ); |
208 | } | 210 | } |
209 | } | 211 | } |
210 | 212 | ||
211 | QPtrList<Todo> CalendarLocal::rawTodos() | 213 | QPtrList<Todo> CalendarLocal::rawTodos() |
212 | { | 214 | { |
213 | return mTodoList; | 215 | return mTodoList; |
214 | } | 216 | } |
215 | Todo *CalendarLocal::todo( QString syncProf, QString id ) | 217 | Todo *CalendarLocal::todo( QString syncProf, QString id ) |
216 | { | 218 | { |
217 | Todo *todo; | 219 | Todo *todo; |
218 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { | 220 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { |
219 | if ( todo->getID( syncProf ) == id ) return todo; | 221 | if ( todo->getID( syncProf ) == id ) return todo; |
220 | } | 222 | } |
@@ -674,32 +676,35 @@ bool CalendarLocal::addJournal(Journal *journal) | |||
674 | if ( journal->dtStart().isValid()) | 676 | if ( journal->dtStart().isValid()) |
675 | kdDebug(5800) << "Adding Journal on " << journal->dtStart().toString() << endl; | 677 | kdDebug(5800) << "Adding Journal on " << journal->dtStart().toString() << endl; |
676 | else | 678 | else |
677 | kdDebug(5800) << "Adding Journal without a DTSTART" << endl; | 679 | kdDebug(5800) << "Adding Journal without a DTSTART" << endl; |
678 | 680 | ||
679 | mJournalList.append(journal); | 681 | mJournalList.append(journal); |
680 | 682 | ||
681 | journal->registerObserver( this ); | 683 | journal->registerObserver( this ); |
682 | 684 | ||
683 | setModified( true ); | 685 | setModified( true ); |
684 | 686 | ||
685 | return true; | 687 | return true; |
686 | } | 688 | } |
687 | 689 | ||
688 | void CalendarLocal::deleteJournal( Journal *journal ) | 690 | void CalendarLocal::deleteJournal( Journal *journal ) |
689 | { | 691 | { |
692 | if ( mUndoIncidence ) delete mUndoIncidence; | ||
693 | mUndoIncidence = journal->clone(); | ||
694 | mUndoIncidence->setSummary( mUndoIncidence->description().left(25)); | ||
690 | if ( mJournalList.removeRef(journal) ) { | 695 | if ( mJournalList.removeRef(journal) ) { |
691 | setModified( true ); | 696 | setModified( true ); |
692 | } | 697 | } |
693 | } | 698 | } |
694 | 699 | ||
695 | Journal *CalendarLocal::journal( const QDate &date ) | 700 | Journal *CalendarLocal::journal( const QDate &date ) |
696 | { | 701 | { |
697 | // kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl; | 702 | // kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl; |
698 | 703 | ||
699 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | 704 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) |
700 | if ( it->dtStart().date() == date ) | 705 | if ( it->dtStart().date() == date ) |
701 | return it; | 706 | return it; |
702 | 707 | ||
703 | return 0; | 708 | return 0; |
704 | } | 709 | } |
705 | 710 | ||
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 5a9ef0e..28402ae 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -160,32 +160,46 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 ) | |||
160 | return | 160 | return |
161 | // i1.created() == i2.created() && | 161 | // i1.created() == i2.created() && |
162 | stringCompare( i1.description(), i2.description() ) && | 162 | stringCompare( i1.description(), i2.description() ) && |
163 | stringCompare( i1.summary(), i2.summary() ) && | 163 | stringCompare( i1.summary(), i2.summary() ) && |
164 | i1.categories() == i2.categories() && | 164 | i1.categories() == i2.categories() && |
165 | // no need to compare mRelatedTo | 165 | // no need to compare mRelatedTo |
166 | stringCompare( i1.relatedToUid(), i2.relatedToUid() ) && | 166 | stringCompare( i1.relatedToUid(), i2.relatedToUid() ) && |
167 | // i1.relations() == i2.relations() && | 167 | // i1.relations() == i2.relations() && |
168 | i1.exDates() == i2.exDates() && | 168 | i1.exDates() == i2.exDates() && |
169 | i1.attachments() == i2.attachments() && | 169 | i1.attachments() == i2.attachments() && |
170 | i1.resources() == i2.resources() && | 170 | i1.resources() == i2.resources() && |
171 | i1.secrecy() == i2.secrecy() && | 171 | i1.secrecy() == i2.secrecy() && |
172 | i1.priority() == i2.priority() && | 172 | i1.priority() == i2.priority() && |
173 | stringCompare( i1.location(), i2.location() ); | 173 | stringCompare( i1.location(), i2.location() ); |
174 | } | 174 | } |
175 | 175 | ||
176 | Incidence* Incidence::recreateCloneException( QDate d ) | ||
177 | { | ||
178 | Incidence* newInc = clone(); | ||
179 | newInc->recreate(); | ||
180 | if ( doesRecur() ) { | ||
181 | addExDate( d ); | ||
182 | newInc->recurrence()->unsetRecurs(); | ||
183 | int len = dtStart().secsTo( ((Event*)this)->dtEnd()); | ||
184 | QTime tim = dtStart().time(); | ||
185 | newInc->setDtStart( QDateTime(d, tim) ); | ||
186 | ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); | ||
187 | } | ||
188 | return newInc; | ||
189 | } | ||
176 | 190 | ||
177 | void Incidence::recreate() | 191 | void Incidence::recreate() |
178 | { | 192 | { |
179 | setCreated(QDateTime::currentDateTime()); | 193 | setCreated(QDateTime::currentDateTime()); |
180 | 194 | ||
181 | setUid(CalFormat::createUniqueId()); | 195 | setUid(CalFormat::createUniqueId()); |
182 | 196 | ||
183 | setRevision(0); | 197 | setRevision(0); |
184 | setIDStr( ":" ); | 198 | setIDStr( ":" ); |
185 | setLastModified(QDateTime::currentDateTime()); | 199 | setLastModified(QDateTime::currentDateTime()); |
186 | } | 200 | } |
187 | 201 | ||
188 | void Incidence::setReadOnly( bool readOnly ) | 202 | void Incidence::setReadOnly( bool readOnly ) |
189 | { | 203 | { |
190 | IncidenceBase::setReadOnly( readOnly ); | 204 | IncidenceBase::setReadOnly( readOnly ); |
191 | recurrence()->setRecurReadOnly( readOnly); | 205 | recurrence()->setRecurReadOnly( readOnly); |
diff --git a/libkcal/incidence.h b/libkcal/incidence.h index 7dc6f10..1807bc4 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h | |||
@@ -109,32 +109,33 @@ class Incidence : public IncidenceBase | |||
109 | bool accept(Visitor &v) { return v.visit(this); } | 109 | bool accept(Visitor &v) { return v.visit(this); } |
110 | </pre> | 110 | </pre> |
111 | */ | 111 | */ |
112 | virtual bool accept(Visitor &) { return false; } | 112 | virtual bool accept(Visitor &) { return false; } |
113 | 113 | ||
114 | virtual Incidence *clone() = 0; | 114 | virtual Incidence *clone() = 0; |
115 | 115 | ||
116 | virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const = 0; | 116 | virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const = 0; |
117 | void setReadOnly( bool ); | 117 | void setReadOnly( bool ); |
118 | 118 | ||
119 | /** | 119 | /** |
120 | Recreate event. The event is made a new unique event, but already stored | 120 | Recreate event. The event is made a new unique event, but already stored |
121 | event information is preserved. Sets uniquie id, creation date, last | 121 | event information is preserved. Sets uniquie id, creation date, last |
122 | modification date and revision number. | 122 | modification date and revision number. |
123 | */ | 123 | */ |
124 | void recreate(); | 124 | void recreate(); |
125 | Incidence* recreateCloneException(QDate); | ||
125 | 126 | ||
126 | /** set creation date */ | 127 | /** set creation date */ |
127 | void setCreated(QDateTime); | 128 | void setCreated(QDateTime); |
128 | /** return time and date of creation. */ | 129 | /** return time and date of creation. */ |
129 | QDateTime created() const; | 130 | QDateTime created() const; |
130 | 131 | ||
131 | /** set the number of revisions this event has seen */ | 132 | /** set the number of revisions this event has seen */ |
132 | void setRevision(int rev); | 133 | void setRevision(int rev); |
133 | /** return the number of revisions this event has seen */ | 134 | /** return the number of revisions this event has seen */ |
134 | int revision() const; | 135 | int revision() const; |
135 | 136 | ||
136 | /** Set starting date/time. */ | 137 | /** Set starting date/time. */ |
137 | virtual void setDtStart(const QDateTime &dtStart); | 138 | virtual void setDtStart(const QDateTime &dtStart); |
138 | /** Return the incidence's ending date/time as a QDateTime. */ | 139 | /** Return the incidence's ending date/time as a QDateTime. */ |
139 | virtual QDateTime dtEnd() const { return QDateTime(); } | 140 | virtual QDateTime dtEnd() const { return QDateTime(); } |
140 | 141 | ||
@@ -1 +1 @@ | |||
version = "1.9.14"; | version = "1.9.15"; | ||