author | zautrix <zautrix> | 2005-02-03 00:01:07 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-03 00:01:07 (UTC) |
commit | ca3c58c09b1b7d2733eeacc9e8ca568134926e93 (patch) (side-by-side diff) | |
tree | dbee3bfe638d1ae44288ae6c209e014e40206c0d /korganizer | |
parent | 279354f19275e5e654636acb87c465edf652eeae (diff) | |
download | kdepimpi-ca3c58c09b1b7d2733eeacc9e8ca568134926e93.zip kdepimpi-ca3c58c09b1b7d2733eeacc9e8ca568134926e93.tar.gz kdepimpi-ca3c58c09b1b7d2733eeacc9e8ca568134926e93.tar.bz2 |
tz fixes
-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 @@ -2252,6 +2252,22 @@ void CalendarView::edit_paste() 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 @@ -118,4 +118,6 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser signals: + void save (); + void saveStopTimer (); void tempDisableBR(bool); /** This todo has been modified */ diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 3feb4ab..a2c20a8 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -260,4 +260,6 @@ 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() ) ); connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); @@ -1448,4 +1450,5 @@ void MainWindow::slotModifiedChanged( bool changed ) if ( mBlockAtStartup ) return; + int msec; // we store the changes after 1 minute, @@ -1459,16 +1462,27 @@ void MainWindow::slotModifiedChanged( bool changed ) mCalendarModifiedFlag = true; } +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() ) return; mSyncManager->setBlockSave(true); if ( mView->checkFileVersion( defaultFileName()) ) { - QTime neededSaveTime = QDateTime::currentDateTime().time(); setCaption(i18n("KO/Pi:Saving Data to File ..." )); qDebug("KO: Start saving data to file!"); mView->saveCalendar( defaultFileName() ); - + mCalendarModifiedFlag = false; int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); qDebug("KO: Needed %d ms for saving.",msNeeded ); @@ -1478,5 +1492,4 @@ void MainWindow::save() } else 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 @@ -73,4 +73,5 @@ class MainWindow : public QMainWindow void save(); + void saveStopTimer(); void configureToolBar( int ); void printSel(); |