-rw-r--r-- | korganizer/calendarview.cpp | 18 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 19 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 |
4 files changed, 36 insertions, 4 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index e0380fa..77de94f 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2253,4 +2253,20 @@ void CalendarView::edit_options() { + QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; + emit save(); + emit saveStopTimer(); mDialogManager->showOptionsDialog(); - //writeSettings(); + if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { + emit saveStopTimer(); + if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto apply timezone changes?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), + i18n("Timezone settings"),i18n("Reload"))) { + qDebug("KO: TZ reload cancelled "); + return; + } + qDebug("KO: Timezone change "); + openCalendar( MainWindow::defaultFileName() ); + setModified(true); + } + else + qDebug("KO: No tz change "); + } diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 6ea8287..8d7ff36 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -119,2 +119,4 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser signals: + void save (); + void saveStopTimer (); void tempDisableBR(bool); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 3feb4ab..a2c20a8 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -261,2 +261,4 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); + connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); + connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); @@ -1449,2 +1451,3 @@ void MainWindow::slotModifiedChanged( bool changed ) return; + int msec; @@ -1460,4 +1463,16 @@ void MainWindow::slotModifiedChanged( bool changed ) } +void MainWindow::saveStopTimer() +{ + mSaveTimer.stop(); + if (mSaveTimer.isActive() ) + qDebug("ti active "); + else + qDebug("KO: Save timer stopped"); +} void MainWindow::save() { + if ( !mCalendarModifiedFlag ) { + qDebug("KO: Calendar not modified. Nothing saved."); + return; + } if ( mSyncManager->blockSave() ) @@ -1466,3 +1481,2 @@ void MainWindow::save() if ( mView->checkFileVersion( defaultFileName()) ) { - QTime neededSaveTime = QDateTime::currentDateTime().time(); @@ -1471,3 +1485,3 @@ void MainWindow::save() mView->saveCalendar( defaultFileName() ); - + mCalendarModifiedFlag = false; int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); @@ -1479,3 +1493,2 @@ void MainWindow::save() setCaption(i18n("Saving cancelled!")); - mCalendarModifiedFlag = false; mSyncManager->setBlockSave( false ); diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 6de0543..8dd55ac 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h @@ -74,2 +74,3 @@ class MainWindow : public QMainWindow void save(); + void saveStopTimer(); void configureToolBar( int ); |