-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index fd5e4f9..944ee1e 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,30 +1,32 @@ | |||
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 2.2.1 ************ | 3 | ********** VERSION 2.2.1 ************ |
4 | 4 | ||
5 | KO/Pi: | 5 | KO/Pi: |
6 | Fixed a problem displaying very long allday events in agenda view in single day mode. | 6 | Fixed a problem displaying very long allday events in agenda view in single day mode. |
7 | Fixed a problem with the default settings for new todos. | 7 | Fixed a problem with the default settings for new todos. |
8 | Added an error message dialog if saving of calendar files is not possible. | ||
9 | Made it impossible to close KO/Pi if saving fails. | ||
8 | 10 | ||
9 | KA/Pi: | 11 | KA/Pi: |
10 | Added a config option to turn on asking before a contact is deleted. | 12 | Added a config option to turn on asking before a contact is deleted. |
11 | Fixed a problem with the default view and view selection at startup. | 13 | Fixed a problem with the default view and view selection at startup. |
12 | Formatted name is now set on import, if formatted name is empty. | 14 | Formatted name is now set on import, if formatted name is empty. |
13 | 15 | ||
14 | ********** VERSION 2.2.0 ************ | 16 | ********** VERSION 2.2.0 ************ |
15 | 17 | ||
16 | New stable release! | 18 | New stable release! |
17 | Fixed some minor usability problems. | 19 | Fixed some minor usability problems. |
18 | Added writing of next alarm to a file for usage on pdaXrom. | 20 | Added writing of next alarm to a file for usage on pdaXrom. |
19 | 21 | ||
20 | 22 | ||
21 | ************************************* | 23 | ************************************* |
22 | 24 | ||
23 | You can find the complete changelog | 25 | You can find the complete changelog |
24 | from version 1.7.7 to 2.2.0 | 26 | from version 1.7.7 to 2.2.0 |
25 | in the source package or on | 27 | in the source package or on |
26 | 28 | ||
27 | http://www.pi-sync.net/html/changelog.html | 29 | http://www.pi-sync.net/html/changelog.html |
28 | 30 | ||
29 | 31 | ||
30 | 32 | ||
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index ca071b2..26323b1 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2454,193 +2454,192 @@ bool CalendarView::checkFileChanged(QString fn) | |||
2454 | void CalendarView::watchSavedFile() | 2454 | void CalendarView::watchSavedFile() |
2455 | { | 2455 | { |
2456 | QFileInfo finf ( MainWindow::defaultFileName()); | 2456 | QFileInfo finf ( MainWindow::defaultFileName()); |
2457 | if ( !finf.exists() ) | 2457 | if ( !finf.exists() ) |
2458 | return; | 2458 | return; |
2459 | QDateTime dt = finf.lastModified (); | 2459 | QDateTime dt = finf.lastModified (); |
2460 | if ( dt < loadedFileVersion ) { | 2460 | if ( dt < loadedFileVersion ) { |
2461 | //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); | 2461 | //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); |
2462 | QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); | 2462 | QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); |
2463 | return; | 2463 | return; |
2464 | } | 2464 | } |
2465 | loadedFileVersion = dt; | 2465 | loadedFileVersion = dt; |
2466 | } | 2466 | } |
2467 | bool CalendarView::checkAllFileVersions() | 2467 | bool CalendarView::checkAllFileVersions() |
2468 | { | 2468 | { |
2469 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 2469 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
2470 | KopiCalendarFile * cal = calendars.first(); | 2470 | KopiCalendarFile * cal = calendars.first(); |
2471 | mCalendar->setDefaultCalendar( 1 ); | 2471 | mCalendar->setDefaultCalendar( 1 ); |
2472 | mCalendar->setDefaultCalendarEnabledOnly(); | 2472 | mCalendar->setDefaultCalendarEnabledOnly(); |
2473 | if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { | 2473 | if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { |
2474 | if ( !checkFileVersion(MainWindow::defaultFileName())) { | 2474 | if ( !checkFileVersion(MainWindow::defaultFileName())) { |
2475 | restoreCalendarSettings(); | 2475 | restoreCalendarSettings(); |
2476 | return false; | 2476 | return false; |
2477 | } | 2477 | } |
2478 | } | 2478 | } |
2479 | cal = calendars.next(); | 2479 | cal = calendars.next(); |
2480 | QDateTime storeTemp = loadedFileVersion; | 2480 | QDateTime storeTemp = loadedFileVersion; |
2481 | while ( cal ) { | 2481 | while ( cal ) { |
2482 | if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { | 2482 | if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { |
2483 | mCalendar->setDefaultCalendar( cal->mCalNumber ); | 2483 | mCalendar->setDefaultCalendar( cal->mCalNumber ); |
2484 | mCalendar->setDefaultCalendarEnabledOnly(); | 2484 | mCalendar->setDefaultCalendarEnabledOnly(); |
2485 | loadedFileVersion = cal->mLoadDt.addSecs( 15 ); | 2485 | loadedFileVersion = cal->mLoadDt.addSecs( 15 ); |
2486 | if ( !checkFileVersion(cal->mFileName )) { | 2486 | if ( !checkFileVersion(cal->mFileName )) { |
2487 | loadedFileVersion = storeTemp; | 2487 | loadedFileVersion = storeTemp; |
2488 | restoreCalendarSettings(); | 2488 | restoreCalendarSettings(); |
2489 | return false; | 2489 | return false; |
2490 | } | 2490 | } |
2491 | } | 2491 | } |
2492 | cal = calendars.next(); | 2492 | cal = calendars.next(); |
2493 | } | 2493 | } |
2494 | loadedFileVersion = storeTemp; | 2494 | loadedFileVersion = storeTemp; |
2495 | return true; | 2495 | return true; |
2496 | } | 2496 | } |
2497 | bool CalendarView::checkFileVersion(QString fn) | 2497 | bool CalendarView::checkFileVersion(QString fn) |
2498 | { | 2498 | { |
2499 | QFileInfo finf ( fn ); | 2499 | QFileInfo finf ( fn ); |
2500 | if ( !finf.exists() ) | 2500 | if ( !finf.exists() ) |
2501 | return true; | 2501 | return true; |
2502 | QDateTime dt = finf.lastModified (); | 2502 | QDateTime dt = finf.lastModified (); |
2503 | qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1()); | 2503 | qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1()); |
2504 | qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1()); | 2504 | qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1()); |
2505 | if ( dt <= loadedFileVersion ) | 2505 | if ( dt <= loadedFileVersion ) |
2506 | return true; | 2506 | return true; |
2507 | int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg(KGlobal::formatMessage(fn,0)).arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) , | 2507 | int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg(KGlobal::formatMessage(fn,0)).arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) , |
2508 | i18n("KO/Pi Warning"),i18n("Overwrite"), | 2508 | i18n("KO/Pi Warning"),i18n("Overwrite"), |
2509 | i18n("Sync+save")); | 2509 | i18n("Sync+save")); |
2510 | 2510 | ||
2511 | if ( km == KMessageBox::Cancel ) | 2511 | if ( km == KMessageBox::Cancel ) |
2512 | return false; | 2512 | return false; |
2513 | if ( km == KMessageBox::Yes ) | 2513 | if ( km == KMessageBox::Yes ) |
2514 | return true; | 2514 | return true; |
2515 | 2515 | ||
2516 | setSyncDevice("deleteaftersync" ); | 2516 | setSyncDevice("deleteaftersync" ); |
2517 | mSyncManager->mAskForPreferences = true; | 2517 | mSyncManager->mAskForPreferences = true; |
2518 | mSyncManager->mSyncAlgoPrefs = 3; | 2518 | mSyncManager->mSyncAlgoPrefs = 3; |
2519 | mSyncManager->mWriteBackFile = false; | 2519 | mSyncManager->mWriteBackFile = false; |
2520 | mSyncManager->mWriteBackExistingOnly = false; | 2520 | mSyncManager->mWriteBackExistingOnly = false; |
2521 | mSyncManager->mShowSyncSummary = false; | 2521 | mSyncManager->mShowSyncSummary = false; |
2522 | syncCalendar( fn, 3 ); | 2522 | syncCalendar( fn, 3 ); |
2523 | Event * e = getLastSyncEvent(); | 2523 | Event * e = getLastSyncEvent(); |
2524 | if ( e ) | 2524 | if ( e ) |
2525 | mCalendar->deleteEvent( e ); | 2525 | mCalendar->deleteEvent( e ); |
2526 | return true; | 2526 | return true; |
2527 | } | 2527 | } |
2528 | bool CalendarView::saveCalendars() | 2528 | bool CalendarView::saveCalendars() |
2529 | { | 2529 | { |
2530 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 2530 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
2531 | KopiCalendarFile * cal = calendars.first(); | 2531 | KopiCalendarFile * cal = calendars.first(); |
2532 | mCalendar->setDefaultCalendar( 1 ); | 2532 | mCalendar->setDefaultCalendar( 1 ); |
2533 | mCalendar->setDefaultCalendarEnabledOnly(); | 2533 | mCalendar->setDefaultCalendarEnabledOnly(); |
2534 | QString saveError; | 2534 | QString saveError; |
2535 | if ( !saveCalendar( MainWindow::defaultFileName() ) ) | 2535 | if ( !saveCalendar( MainWindow::defaultFileName() ) ) |
2536 | saveError = cal->mName +"\n"; | 2536 | saveError = cal->mName +"\n"; |
2537 | cal = calendars.next(); | 2537 | cal = calendars.next(); |
2538 | while ( cal ) { | 2538 | while ( cal ) { |
2539 | if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { | 2539 | if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { |
2540 | mCalendar->setDefaultCalendar( cal->mCalNumber ); | 2540 | mCalendar->setDefaultCalendar( cal->mCalNumber ); |
2541 | mCalendar->setDefaultCalendarEnabledOnly(); | 2541 | mCalendar->setDefaultCalendarEnabledOnly(); |
2542 | if ( saveCalendar( cal->mFileName ) ) | 2542 | if ( saveCalendar( cal->mFileName ) ) |
2543 | cal->mLoadDt = QDateTime::currentDateTime(); | 2543 | cal->mLoadDt = QDateTime::currentDateTime(); |
2544 | else | 2544 | else |
2545 | saveError += cal->mName + "\n"; | 2545 | saveError += cal->mName + "\n"; |
2546 | } | 2546 | } |
2547 | cal = calendars.next(); | 2547 | cal = calendars.next(); |
2548 | } | 2548 | } |
2549 | restoreCalendarSettings(); | 2549 | restoreCalendarSettings(); |
2550 | |||
2551 | if ( !saveError.isEmpty() ) { | 2550 | if ( !saveError.isEmpty() ) { |
2552 | saveError = KGlobal::formatMessage( i18n("Calendar(s) not saved:"),0 )+"\n" + saveError; | 2551 | saveError = KGlobal::formatMessage( i18n("Calendar(s) not saved:"),0 )+"\n" + saveError; |
2553 | KMessageBox::error(this, saveError, i18n("Error saving data")); | 2552 | KMessageBox::error(this, saveError, i18n("Error saving data")); |
2554 | return false; | 2553 | return false; |
2555 | } | 2554 | } |
2556 | return true; | 2555 | return true; |
2557 | } | 2556 | } |
2558 | bool CalendarView::saveCalendar( QString filename ) | 2557 | bool CalendarView::saveCalendar( QString filename ) |
2559 | { | 2558 | { |
2560 | 2559 | ||
2561 | // Store back all unsaved data into calendar object | 2560 | // Store back all unsaved data into calendar object |
2562 | // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); | 2561 | // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); |
2563 | if ( mViewManager->currentView() ) | 2562 | if ( mViewManager->currentView() ) |
2564 | mViewManager->currentView()->flushView(); | 2563 | mViewManager->currentView()->flushView(); |
2565 | 2564 | ||
2566 | 2565 | ||
2567 | QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); | 2566 | QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); |
2568 | mStorage->setSaveFormat( new ICalFormat() ); | 2567 | mStorage->setSaveFormat( new ICalFormat() ); |
2569 | mStorage->setFileName( filename ); | 2568 | mStorage->setFileName( filename ); |
2570 | bool success; | 2569 | bool success; |
2571 | success = mStorage->save(); | 2570 | success = mStorage->save(); |
2572 | if ( !success ) { | 2571 | if ( !success ) { |
2573 | return false; | 2572 | return false; |
2574 | } | 2573 | } |
2575 | if ( filename == MainWindow::defaultFileName() ) { | 2574 | if ( filename == MainWindow::defaultFileName() ) { |
2576 | setLoadedFileVersion( lfv ); | 2575 | setLoadedFileVersion( lfv ); |
2577 | watchSavedFile(); | 2576 | watchSavedFile(); |
2578 | } | 2577 | } |
2579 | return true; | 2578 | return true; |
2580 | } | 2579 | } |
2581 | 2580 | ||
2582 | void CalendarView::closeCalendar() | 2581 | void CalendarView::closeCalendar() |
2583 | { | 2582 | { |
2584 | 2583 | ||
2585 | // child windows no longer valid | 2584 | // child windows no longer valid |
2586 | clearAllViews(); | 2585 | clearAllViews(); |
2587 | emit closingDown(); | 2586 | emit closingDown(); |
2588 | 2587 | ||
2589 | mCalendar->close(); | 2588 | mCalendar->close(); |
2590 | setModified(false); | 2589 | setModified(false); |
2591 | updateView(); | 2590 | updateView(); |
2592 | } | 2591 | } |
2593 | 2592 | ||
2594 | void CalendarView::archiveCalendar() | 2593 | void CalendarView::archiveCalendar() |
2595 | { | 2594 | { |
2596 | mDialogManager->showArchiveDialog(); | 2595 | mDialogManager->showArchiveDialog(); |
2597 | } | 2596 | } |
2598 | 2597 | ||
2599 | 2598 | ||
2600 | void CalendarView::readSettings() | 2599 | void CalendarView::readSettings() |
2601 | { | 2600 | { |
2602 | 2601 | ||
2603 | 2602 | ||
2604 | // mViewManager->showAgendaView(); | 2603 | // mViewManager->showAgendaView(); |
2605 | QString str; | 2604 | QString str; |
2606 | //qDebug("CalendarView::readSettings() "); | 2605 | //qDebug("CalendarView::readSettings() "); |
2607 | // read settings from the KConfig, supplying reasonable | 2606 | // read settings from the KConfig, supplying reasonable |
2608 | // defaults where none are to be found | 2607 | // defaults where none are to be found |
2609 | KConfig *config = KOGlobals::config(); | 2608 | KConfig *config = KOGlobals::config(); |
2610 | #ifndef KORG_NOSPLITTER | 2609 | #ifndef KORG_NOSPLITTER |
2611 | config->setGroup("KOrganizer Geometry"); | 2610 | config->setGroup("KOrganizer Geometry"); |
2612 | 2611 | ||
2613 | QValueList<int> sizes = config->readIntListEntry("Separator1"); | 2612 | QValueList<int> sizes = config->readIntListEntry("Separator1"); |
2614 | if (sizes.count() != 2) { | 2613 | if (sizes.count() != 2) { |
2615 | sizes << mDateNavigator->minimumSizeHint().width(); | 2614 | sizes << mDateNavigator->minimumSizeHint().width(); |
2616 | sizes << 300; | 2615 | sizes << 300; |
2617 | } | 2616 | } |
2618 | mPanner->setSizes(sizes); | 2617 | mPanner->setSizes(sizes); |
2619 | 2618 | ||
2620 | sizes = config->readIntListEntry("Separator2"); | 2619 | sizes = config->readIntListEntry("Separator2"); |
2621 | if ( ( mResourceView && sizes.count() == 4 ) || | 2620 | if ( ( mResourceView && sizes.count() == 4 ) || |
2622 | ( !mResourceView && sizes.count() == 3 ) ) { | 2621 | ( !mResourceView && sizes.count() == 3 ) ) { |
2623 | mLeftSplitter->setSizes(sizes); | 2622 | mLeftSplitter->setSizes(sizes); |
2624 | } | 2623 | } |
2625 | #endif | 2624 | #endif |
2626 | globalFlagBlockAgenda = 1; | 2625 | globalFlagBlockAgenda = 1; |
2627 | mViewManager->showAgendaView(); | 2626 | mViewManager->showAgendaView(); |
2628 | //mViewManager->readSettings( config ); | 2627 | //mViewManager->readSettings( config ); |
2629 | mTodoList->restoreLayout(config,QString("Todo Layout")); | 2628 | mTodoList->restoreLayout(config,QString("Todo Layout")); |
2630 | readFilterSettings(config); | 2629 | readFilterSettings(config); |
2631 | 2630 | ||
2632 | #ifdef DESKTOP_VERSION | 2631 | #ifdef DESKTOP_VERSION |
2633 | config->setGroup("WidgetLayout"); | 2632 | config->setGroup("WidgetLayout"); |
2634 | QStringList list; | 2633 | QStringList list; |
2635 | list = config->readListEntry("MainLayout"); | 2634 | list = config->readListEntry("MainLayout"); |
2636 | int x,y,w,h; | 2635 | int x,y,w,h; |
2637 | if ( ! list.isEmpty() ) { | 2636 | if ( ! list.isEmpty() ) { |
2638 | x = list[0].toInt(); | 2637 | x = list[0].toInt(); |
2639 | y = list[1].toInt(); | 2638 | y = list[1].toInt(); |
2640 | w = list[2].toInt(); | 2639 | w = list[2].toInt(); |
2641 | h = list[3].toInt(); | 2640 | h = list[3].toInt(); |
2642 | KApplication::testCoords( &x,&y,&w,&h ); | 2641 | KApplication::testCoords( &x,&y,&w,&h ); |
2643 | topLevelWidget()->setGeometry(x,y,w,h); | 2642 | topLevelWidget()->setGeometry(x,y,w,h); |
2644 | 2643 | ||
2645 | } else { | 2644 | } else { |
2646 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); | 2645 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); |