-rw-r--r-- | korganizer/calendarview.cpp | 14 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 10 |
2 files changed, 21 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 316826a..ca071b2 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -836,5 +836,5 @@ void CalendarView::checkFiles() if ( !message.isEmpty() ) { message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); - KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); + KMessageBox::error(this,message, i18n("Loading of calendar(s) failed")); } static bool firstTime = true; @@ -2532,5 +2532,7 @@ bool CalendarView::saveCalendars() mCalendar->setDefaultCalendar( 1 ); mCalendar->setDefaultCalendarEnabledOnly(); - saveCalendar( MainWindow::defaultFileName() ); + QString saveError; + if ( !saveCalendar( MainWindow::defaultFileName() ) ) + saveError = cal->mName +"\n"; cal = calendars.next(); while ( cal ) { @@ -2540,8 +2542,16 @@ bool CalendarView::saveCalendars() if ( saveCalendar( cal->mFileName ) ) cal->mLoadDt = QDateTime::currentDateTime(); + else + saveError += cal->mName + "\n"; } cal = calendars.next(); } restoreCalendarSettings(); + + if ( !saveError.isEmpty() ) { + saveError = KGlobal::formatMessage( i18n("Calendar(s) not saved:"),0 )+"\n" + saveError; + KMessageBox::error(this, saveError, i18n("Error saving data")); + return false; + } return true; } diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 94bc4c1..9c55e9f 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -507,4 +507,8 @@ void MainWindow::closeEvent( QCloseEvent* ce ) if ( ! KOPrefs::instance()->mAskForQuit ) { saveOnClose(); + if ( mCalendarModifiedFlag ) { + ce->ignore(); + return; + } mClosed = true; ce->accept(); @@ -519,4 +523,8 @@ void MainWindow::closeEvent( QCloseEvent* ce ) case 0: saveOnClose(); + if ( mCalendarModifiedFlag ) { + ce->ignore(); + return; + } mClosed = true; ce->accept(); @@ -2003,5 +2011,5 @@ void MainWindow::save() setCaption(i18n("KO/Pi:Saving Data to File ..." )); qDebug("KO: Start saving data to file!"); - mView->saveCalendars(); + if ( mView->saveCalendars() ) mCalendarModifiedFlag = false; int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |