summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-10-12 11:14:13 (UTC)
committer zautrix <zautrix>2005-10-12 11:14:13 (UTC)
commita72f3f3acfac791715a1c512fc4cc4c3facdbb62 (patch) (unidiff)
tree202c588777f8d4585a8c57164b1b412d7ad73e8a
parent3ecfc912f657a710ed35c93dc6eb2991cce06835 (diff)
downloadkdepimpi-a72f3f3acfac791715a1c512fc4cc4c3facdbb62.zip
kdepimpi-a72f3f3acfac791715a1c512fc4cc4c3facdbb62.tar.gz
kdepimpi-a72f3f3acfac791715a1c512fc4cc4c3facdbb62.tar.bz2
fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt8
-rw-r--r--korganizer/mainwindow.cpp75
-rw-r--r--korganizer/mainwindow.h4
3 files changed, 70 insertions, 17 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index ea653b2..e8b54fd 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1566,2 +1566,10 @@
1566{ " (Duration: %1 days)"," (Dauer: %1 Tage)" }, 1566{ " (Duration: %1 days)"," (Dauer: %1 Tage)" },
1567{ "Autosave enabled!","Auto-Speichern angeschaltet!" },
1568{ "Autosave disabled! Save timer stopped!","Auto-Speichern ausgeschaltet! Speicher Timer gestoppt!" },
1569{ "Autosave disabled!","Auto-Speichern ist ausgeschaltet!" },
1570{ "Yes, Save!","Ja, Speichern!" },
1571{ "Calendar is modified\nbut Autosave is disabled!\nDo you want\nto save the data?","Der Kalender wurde verändert,\naber Auto-Speichern ist\nabgeschaltet. Möchten Sie\ndie Daten speichern?" },
1572{ "<p><b>C+ctrl</b>: Dis/enable automatic saving</p>\n","<p><b>C+ctrl</b>: Auto-Speichern ab/anschalten</p>\n" },
1573{ "","" },
1574{ "","" },
1567{ "","" }, 1575{ "","" },
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index c597138..66bb19b 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -172,2 +172,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
172 } 172 }
173 mAutoSaveDisabled = false;
173 mClosed = false; 174 mClosed = false;
@@ -539,13 +540,29 @@ bool MainWindow::askForQuitOnSaveError()
539} 540}
540 541bool MainWindow::checkAutosave()
542{
543 bool savedata = true;
544 if ( mAutoSaveDisabled && mCalendarModifiedFlag ) {
545 switch( QMessageBox::information( this, "KO/Pi",
546 i18n("Calendar is modified\nbut Autosave is disabled!\nDo you want\nto save the data?"),
547 i18n("Yes, Save!"), i18n("No"),
548 0, 0 ) ) {
549 case 1:
550 case 2:
551 savedata = false;
552 break;
553 default:
554 break;
555 }
556 }
557 return savedata;
558}
541void MainWindow::closeEvent( QCloseEvent* ce ) 559void MainWindow::closeEvent( QCloseEvent* ce )
542{ 560{
543
544
545
546 if ( ! KOPrefs::instance()->mAskForQuit ) { 561 if ( ! KOPrefs::instance()->mAskForQuit ) {
547 saveOnClose(); 562 if ( checkAutosave() ) {
548 if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) { 563 saveOnClose();
549 ce->ignore(); 564 if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) {
550 return; 565 ce->ignore();
566 return;
567 }
551 } 568 }
@@ -561,7 +578,9 @@ void MainWindow::closeEvent( QCloseEvent* ce )
561 0, 0 ) ) { 578 0, 0 ) ) {
562 case 0: 579 case 0:
563 saveOnClose(); 580 if ( checkAutosave() ) {
564 if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) { 581 saveOnClose();
565 ce->ignore(); 582 if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) {
566 return; 583 ce->ignore();
584 return;
585 }
567 } 586 }
@@ -1659,2 +1678,3 @@ void MainWindow::keyBindings()
1659 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + 1678 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") +
1679 i18n("<p><b>C+ctrl</b>: Dis/enable automatic saving</p>\n") +
1660 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1680 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
@@ -1974,2 +1994,6 @@ void MainWindow::slotModifiedChanged( bool )
1974 int msec; 1994 int msec;
1995 if ( mAutoSaveDisabled ) {
1996 QTimer::singleShot( 0, this , SLOT ( autoSaveWarning() ) );
1997 qDebug("KO: Autosave disabled (data change deteced)!");
1998 }
1975 if ( mCalendarModifiedFlag ) { 1999 if ( mCalendarModifiedFlag ) {
@@ -1978,2 +2002,6 @@ void MainWindow::slotModifiedChanged( bool )
1978 } 2002 }
2003 mCalendarModifiedFlag = true;
2004 if ( mAutoSaveDisabled ) {
2005 return;
2006 }
1979 // we store the changes after 1 minute, 2007 // we store the changes after 1 minute,
@@ -1988,3 +2016,6 @@ void MainWindow::slotModifiedChanged( bool )
1988 qDebug("KO: Saving File in %d secs!", msec/1000); 2016 qDebug("KO: Saving File in %d secs!", msec/1000);
1989 mCalendarModifiedFlag = true; 2017}
2018void MainWindow::autoSaveWarning()
2019{
2020 setCaption(i18n("Autosave disabled!" ));
1990} 2021}
@@ -1993,2 +2024,3 @@ void MainWindow::saveStopTimer()
1993 mSaveTimer.stop(); 2024 mSaveTimer.stop();
2025 mSaveDelay = 0;
1994} 2026}
@@ -2209,4 +2241,15 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
2209 break; 2241 break;
2210 case Qt::Key_C: 2242 case Qt::Key_C:
2211 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 2243 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) {
2244 if ( mAutoSaveDisabled ) {
2245 mAutoSaveDisabled = false;
2246 setCaption(i18n("Autosave enabled!" ));
2247 return;
2248 } else {
2249 mAutoSaveDisabled = true;
2250 saveStopTimer();
2251 setCaption(i18n("Autosave disabled! Save timer stopped!" ));
2252 }
2253 } else
2254 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
2212 break; 2255 break;
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 71c069b..d8018b6 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -54,2 +54,3 @@ class MainWindow : public QMainWindow
54 protected slots: 54 protected slots:
55 void autoSaveWarning();
55 void loadDataAfterStart(); 56 void loadDataAfterStart();
@@ -123,3 +124,4 @@ class MainWindow : public QMainWindow
123 private: 124 private:
124 125 bool mAutoSaveDisabled;
126 bool checkAutosave();
125 QCString mCStringMess; 127 QCString mCStringMess;