summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-08-17 19:50:38 (UTC)
committer zautrix <zautrix>2005-08-17 19:50:38 (UTC)
commit39f1119563e038a029fd23c4b3af03eda02fe308 (patch) (side-by-side diff)
treeb552570e883436ec451cdb7d4b215206c2ca3ba3 /korganizer
parentdfb9cdc7d39b988e23e5491e1c8f0e8c5713dae5 (diff)
downloadkdepimpi-39f1119563e038a029fd23c4b3af03eda02fe308.zip
kdepimpi-39f1119563e038a029fd23c4b3af03eda02fe308.tar.gz
kdepimpi-39f1119563e038a029fd23c4b3af03eda02fe308.tar.bz2
kopi save error warning
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp14
-rw-r--r--korganizer/mainwindow.cpp10
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
@@ -835,7 +835,7 @@ 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;
if ( firstTime ) {
@@ -2531,7 +2531,9 @@ bool CalendarView::saveCalendars()
KopiCalendarFile * cal = calendars.first();
mCalendar->setDefaultCalendar( 1 );
mCalendar->setDefaultCalendarEnabledOnly();
- saveCalendar( MainWindow::defaultFileName() );
+ QString saveError;
+ if ( !saveCalendar( MainWindow::defaultFileName() ) )
+ saveError = cal->mName +"\n";
cal = calendars.next();
while ( cal ) {
if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
@@ -2539,10 +2541,18 @@ bool CalendarView::saveCalendars()
mCalendar->setDefaultCalendarEnabledOnly();
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;
}
bool CalendarView::saveCalendar( QString filename )
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 94bc4c1..9c55e9f 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -506,6 +506,10 @@ void MainWindow::closeEvent( QCloseEvent* ce )
if ( ! KOPrefs::instance()->mAskForQuit ) {
saveOnClose();
+ if ( mCalendarModifiedFlag ) {
+ ce->ignore();
+ return;
+ }
mClosed = true;
ce->accept();
return;
@@ -518,6 +522,10 @@ void MainWindow::closeEvent( QCloseEvent* ce )
0, 0 ) ) {
case 0:
saveOnClose();
+ if ( mCalendarModifiedFlag ) {
+ ce->ignore();
+ return;
+ }
mClosed = true;
ce->accept();
break;
@@ -2002,7 +2010,7 @@ void MainWindow::save()
if ( !isMinimized () )
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() );
qDebug("KO: Needed %d ms for saving.",msNeeded );