-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 9 | ||||
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 8 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 13 | ||||
-rw-r--r-- | korganizer/calendarview.h | 3 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 69 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 5 |
6 files changed, 74 insertions, 33 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 2c0d626..6f76c7e 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -141,3 +141,3 @@ | |||
141 | { "Dinner","Abendessen" }, | 141 | { "Dinner","Abendessen" }, |
142 | { "Do you really want\nto close KO/Pi?","Möchten Sie wirklich\nKO/PI verlassen?" }, | 142 | { "Do you really want\nto close KO/Pi?","Möchten Sie wirklich\nKO/PI beenden?" }, |
143 | { "Due Date","Fällig am" }, | 143 | { "Due Date","Fällig am" }, |
@@ -771,2 +771,3 @@ | |||
771 | { "Export vcal filename(*.vcs)","Export vcal Dateiname(*.vcs)" }, | 771 | { "Export vcal filename(*.vcs)","Export vcal Dateiname(*.vcs)" }, |
772 | { "Export iCal filename(*.ics)","Export iCal Dateiname(*.ics)" }, | ||
772 | { "Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n","Zu speichernde Datei\existiert bereits!\nExist. Datei vom:\n%1\nÜberschreiben?\n" }, | 773 | { "Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n","Zu speichernde Datei\existiert bereits!\nExist. Datei vom:\n%1\nÜberschreiben?\n" }, |
@@ -1560,5 +1561,5 @@ | |||
1560 | { "Conflict detection checks an <b>edited event</b> with <b>other events</b> for overlapping.","Konflikterkennung prüft einen <b>bearbeiteten Termin</b> auf Überschneidungen mit <b>anderen Terminen</b>." }, | 1561 | { "Conflict detection checks an <b>edited event</b> with <b>other events</b> for overlapping.","Konflikterkennung prüft einen <b>bearbeiteten Termin</b> auf Überschneidungen mit <b>anderen Terminen</b>." }, |
1561 | { "","" }, | 1562 | { " Yes, close "," Ja, beenden " }, |
1562 | { "","" }, | 1563 | { "Export All Data","Exportiere alle Daten" }, |
1563 | { "","" }, | 1564 | { "You can save all data\nto another file via\nFile->Export->Export All Data","Sie können alle Daten in\neine andere Datei speichern unter\nDatei->Exportiere->Exportiere alle Daten" }, |
1564 | { "","" }, | 1565 | { "","" }, |
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index 2acfacf..a0ac232 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp | |||
@@ -69,10 +69,2 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) | |||
69 | mTimerPopUp = new QPopupMenu( this ); | 69 | mTimerPopUp = new QPopupMenu( this ); |
70 | QFont fon = mTimerPopUp->font(); | ||
71 | int points = 16; | ||
72 | if ( QApplication::desktop()->width() < 480 ) | ||
73 | points = 12; | ||
74 | fon.setPointSize( points ); | ||
75 | //qDebug("point s %d ", fon.pointSize()); | ||
76 | mTimerPopUp->setFont( fon ); | ||
77 | mPopUp->setFont( fon ); | ||
78 | mBeepPopUp = new QPopupMenu( this ); | 70 | mBeepPopUp = new QPopupMenu( this ); |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 79fb727..2ba8528 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2549,2 +2549,3 @@ bool CalendarView::saveCalendars() | |||
2549 | restoreCalendarSettings(); | 2549 | restoreCalendarSettings(); |
2550 | //saveError = "test error"; | ||
2550 | if ( !saveError.isEmpty() ) { | 2551 | if ( !saveError.isEmpty() ) { |
@@ -4465,7 +4466,4 @@ void CalendarView::printPreview() | |||
4465 | } | 4466 | } |
4466 | 4467 | bool CalendarView::exportICalendar( QString filename ) | |
4467 | void CalendarView::exportICalendar() | ||
4468 | { | 4468 | { |
4469 | QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this); | ||
4470 | |||
4471 | // Force correct extension | 4469 | // Force correct extension |
@@ -4474,3 +4472,8 @@ void CalendarView::exportICalendar() | |||
4474 | FileStorage storage( mCalendar, filename, new ICalFormat() ); | 4472 | FileStorage storage( mCalendar, filename, new ICalFormat() ); |
4475 | storage.save(); | 4473 | return storage.save(); |
4474 | } | ||
4475 | |||
4476 | bool CalendarView::exportICalendar() | ||
4477 | { | ||
4478 | return exportICalendar( KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this) ); | ||
4476 | } | 4479 | } |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index b223315..8670832 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -378,3 +378,4 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
378 | /** Export as iCalendar file */ | 378 | /** Export as iCalendar file */ |
379 | void exportICalendar(); | 379 | bool exportICalendar(); |
380 | bool exportICalendar( QString fn ); | ||
380 | 381 | ||
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 2af605f..98d3e35 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -525,2 +525,21 @@ void MainWindow::showMaximized () | |||
525 | } | 525 | } |
526 | |||
527 | bool MainWindow::askForQuitOnSaveError() | ||
528 | { | ||
529 | bool retval = false; | ||
530 | switch( QMessageBox::information( this, "KO/Pi", | ||
531 | i18n("Error saving data") + "!\n" + | ||
532 | i18n("You can save all data\nto another file via\nFile->Export->Export All Data") + "!\n" + | ||
533 | i18n("Do you really want\nto close KO/Pi?"), | ||
534 | i18n(" Yes, close "), i18n("No"), | ||
535 | 0, 1 ) ) { | ||
536 | case 0: | ||
537 | retval = true; | ||
538 | break; | ||
539 | default: | ||
540 | break; | ||
541 | } | ||
542 | return retval; | ||
543 | } | ||
544 | |||
526 | void MainWindow::closeEvent( QCloseEvent* ce ) | 545 | void MainWindow::closeEvent( QCloseEvent* ce ) |
@@ -532,3 +551,3 @@ void MainWindow::closeEvent( QCloseEvent* ce ) | |||
532 | saveOnClose(); | 551 | saveOnClose(); |
533 | if ( mCalendarModifiedFlag ) { | 552 | if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) { |
534 | ce->ignore(); | 553 | ce->ignore(); |
@@ -548,3 +567,3 @@ void MainWindow::closeEvent( QCloseEvent* ce ) | |||
548 | saveOnClose(); | 567 | saveOnClose(); |
549 | if ( mCalendarModifiedFlag ) { | 568 | if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) { |
550 | ce->ignore(); | 569 | ce->ignore(); |
@@ -1167,2 +1186,6 @@ void MainWindow::initActions() | |||
1167 | //importMenu->insertSeparator(); | 1186 | //importMenu->insertSeparator(); |
1187 | action = new QAction( "export ical", i18n("Export All Data"), 0, | ||
1188 | this ); | ||
1189 | action->addTo( exportMenu_X ); | ||
1190 | connect( action, SIGNAL( activated() ), SLOT( exportICalendar() ) ); | ||
1168 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 1191 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
@@ -1969,3 +1992,3 @@ void MainWindow::slotModifiedChanged( bool ) | |||
1969 | mSaveTimer.start( msec, true ); // 1 minute | 1992 | mSaveTimer.start( msec, true ); // 1 minute |
1970 | mSaveTime.restart(); | 1993 | mSaveTimerStart = QDateTime::currentDateTime(); |
1971 | mSaveDelay = msec/1000; | 1994 | mSaveDelay = msec/1000; |
@@ -2019,8 +2042,10 @@ void MainWindow::save() | |||
2019 | if ( mSaveDelay ) { | 2042 | if ( mSaveDelay ) { |
2020 | if ( mSaveDelay + 60 < mSaveTime.elapsed()/1000 ) { | 2043 | int elapsed = mSaveTimerStart.secsTo( QDateTime::currentDateTime() ); |
2021 | qDebug("KO: Save delay %d. Elapsed save time %d ", mSaveDelay, mSaveTime.elapsed()/1000 ); | 2044 | if ( mSaveDelay < elapsed ) { |
2022 | qDebug("KO: Restarting save timer"); | 2045 | qDebug("KO: Pending save after wakeup from suspend detected."); |
2023 | int msec = 10000; | 2046 | qDebug("KO: Save delay %d sec. Elapsed save time %d sec.", mSaveDelay, elapsed ); |
2024 | mSaveTimer.start( msec, true ); // 1 minute | 2047 | qDebug("KO: Restarting save timer to save in 15 sec."); |
2025 | mSaveTime.restart(); | 2048 | int msec = 15000; |
2049 | mSaveTimer.start( msec, true ); | ||
2050 | mSaveTimerStart = QDateTime::currentDateTime(); | ||
2026 | mSaveDelay = msec/1000; | 2051 | mSaveDelay = msec/1000; |
@@ -2577,7 +2602,11 @@ void MainWindow::importIcal() | |||
2577 | } | 2602 | } |
2578 | 2603 | void MainWindow::exportCalendar( bool iCalFormat ) | |
2579 | void MainWindow::exportVCalendar() | ||
2580 | { | 2604 | { |
2581 | QString fn = KOPrefs::instance()->mLastVcalFile; | 2605 | QString fn = KOPrefs::instance()->mLastVcalFile; |
2582 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); | 2606 | if ( iCalFormat ) { |
2607 | fn = QDir::homeDirPath()+"/kopiexport.ics"; | ||
2608 | fn = KFileDialog::getSaveFileName( fn, i18n("Export iCal filename(*.ics)"), this ); | ||
2609 | } | ||
2610 | else | ||
2611 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); | ||
2583 | if ( fn == "" ) | 2612 | if ( fn == "" ) |
@@ -2598,4 +2627,8 @@ void MainWindow::exportVCalendar() | |||
2598 | if ( createbup ) { | 2627 | if ( createbup ) { |
2599 | if ( mView->exportVCalendar( fn ) ) { | 2628 | bool success = false; |
2600 | KOPrefs::instance()->mLastVcalFile = fn; | 2629 | if ( iCalFormat ) |
2630 | success = mView->exportICalendar( fn ); | ||
2631 | else | ||
2632 | success = mView->exportVCalendar( fn ); | ||
2633 | if ( success ) { | ||
2601 | if ( fn.length() > 20 ) | 2634 | if ( fn.length() > 20 ) |
@@ -2609,2 +2642,10 @@ void MainWindow::exportVCalendar() | |||
2609 | } | 2642 | } |
2643 | void MainWindow::exportICalendar() | ||
2644 | { | ||
2645 | exportCalendar( true ); | ||
2646 | } | ||
2647 | void MainWindow::exportVCalendar() | ||
2648 | { | ||
2649 | exportCalendar( false ); | ||
2650 | } | ||
2610 | QString MainWindow::sentSyncFile() | 2651 | QString MainWindow::sentSyncFile() |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 657c0a8..71c069b 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -95,2 +95,4 @@ class MainWindow : public QMainWindow | |||
95 | void exportVCalendar(); | 95 | void exportVCalendar(); |
96 | void exportICalendar(); | ||
97 | void exportCalendar( bool ); | ||
96 | void fillFilterMenu(); | 98 | void fillFilterMenu(); |
@@ -118,2 +120,3 @@ class MainWindow : public QMainWindow | |||
118 | void enableIncidenceActions( bool ); | 120 | void enableIncidenceActions( bool ); |
121 | bool askForQuitOnSaveError(); | ||
119 | 122 | ||
@@ -176,3 +179,3 @@ class MainWindow : public QMainWindow | |||
176 | QTimer mSaveTimer; | 179 | QTimer mSaveTimer; |
177 | QTime mSaveTime; | 180 | QDateTime mSaveTimerStart; |
178 | int mSaveDelay; | 181 | int mSaveDelay; |