summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
authorzautrix <zautrix>2005-08-17 19:50:38 (UTC)
committer zautrix <zautrix>2005-08-17 19:50:38 (UTC)
commit39f1119563e038a029fd23c4b3af03eda02fe308 (patch) (unidiff)
treeb552570e883436ec451cdb7d4b215206c2ca3ba3 /korganizer/mainwindow.cpp
parentdfb9cdc7d39b988e23e5491e1c8f0e8c5713dae5 (diff)
downloadkdepimpi-39f1119563e038a029fd23c4b3af03eda02fe308.zip
kdepimpi-39f1119563e038a029fd23c4b3af03eda02fe308.tar.gz
kdepimpi-39f1119563e038a029fd23c4b3af03eda02fe308.tar.bz2
kopi save error warning
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 94bc4c1..9c55e9f 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -503,24 +503,32 @@ void MainWindow::closeEvent( QCloseEvent* ce )
503{ 503{
504 504
505 505
506 506
507 if ( ! KOPrefs::instance()->mAskForQuit ) { 507 if ( ! KOPrefs::instance()->mAskForQuit ) {
508 saveOnClose(); 508 saveOnClose();
509 if ( mCalendarModifiedFlag ) {
510 ce->ignore();
511 return;
512 }
509 mClosed = true; 513 mClosed = true;
510 ce->accept(); 514 ce->accept();
511 return; 515 return;
512 516
513 } 517 }
514 518
515 switch( QMessageBox::information( this, "KO/Pi", 519 switch( QMessageBox::information( this, "KO/Pi",
516 i18n("Do you really want\nto close KO/Pi?"), 520 i18n("Do you really want\nto close KO/Pi?"),
517 i18n("Close"), i18n("No"), 521 i18n("Close"), i18n("No"),
518 0, 0 ) ) { 522 0, 0 ) ) {
519 case 0: 523 case 0:
520 saveOnClose(); 524 saveOnClose();
525 if ( mCalendarModifiedFlag ) {
526 ce->ignore();
527 return;
528 }
521 mClosed = true; 529 mClosed = true;
522 ce->accept(); 530 ce->accept();
523 break; 531 break;
524 case 1: 532 case 1:
525 ce->ignore(); 533 ce->ignore();
526 break; 534 break;
@@ -1999,14 +2007,14 @@ void MainWindow::save()
1999 ; // KPimGlobalPrefs::instance()->mLastBackupDate 2007 ; // KPimGlobalPrefs::instance()->mLastBackupDate
2000 } 2008 }
2001 QTime neededSaveTime = QDateTime::currentDateTime().time(); 2009 QTime neededSaveTime = QDateTime::currentDateTime().time();
2002 if ( !isMinimized () ) 2010 if ( !isMinimized () )
2003 setCaption(i18n("KO/Pi:Saving Data to File ..." )); 2011 setCaption(i18n("KO/Pi:Saving Data to File ..." ));
2004 qDebug("KO: Start saving data to file!"); 2012 qDebug("KO: Start saving data to file!");
2005 mView->saveCalendars(); 2013 if ( mView->saveCalendars() )
2006 mCalendarModifiedFlag = false; 2014 mCalendarModifiedFlag = false;
2007 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 2015 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
2008 qDebug("KO: Needed %d ms for saving.",msNeeded ); 2016 qDebug("KO: Needed %d ms for saving.",msNeeded );
2009 QString savemes; 2017 QString savemes;
2010 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); 2018 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
2011 if ( !isMinimized () ) 2019 if ( !isMinimized () )
2012 setCaption(savemes); 2020 setCaption(savemes);