From ca3c58c09b1b7d2733eeacc9e8ca568134926e93 Mon Sep 17 00:00:00 2001 From: zautrix Date: Thu, 03 Feb 2005 00:01:07 +0000 Subject: tz fixes --- (limited to 'korganizer') diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index e0380fa..77de94f 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2251,8 +2251,24 @@ 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 @@ -117,6 +117,8 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser Incidence *currentSelection(); signals: + void save (); + void saveStopTimer (); void tempDisableBR(bool); /** This todo has been modified */ void todoModified(Todo *, int); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 3feb4ab..a2c20a8 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -259,6 +259,8 @@ 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 ) ) ); mSyncManager->setDefaultFileName( defaultFileName()); @@ -1447,6 +1449,7 @@ void MainWindow::slotModifiedChanged( bool changed ) { if ( mBlockAtStartup ) return; + int msec; // we store the changes after 1 minute, // and for safety reasons after 10 minutes again @@ -1458,18 +1461,29 @@ void MainWindow::slotModifiedChanged( bool changed ) qDebug("KO: Saving File in %d secs!", msec/1000); 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 ); QString savemes; @@ -1477,7 +1491,6 @@ void MainWindow::save() setCaption(savemes); } 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 @@ -72,6 +72,7 @@ class MainWindow : public QMainWindow void slotModifiedChanged( bool ); void save(); + void saveStopTimer(); void configureToolBar( int ); void printSel(); void printCal(); -- cgit v0.9.0.2