summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-09-18 13:50:46 (UTC)
committer zautrix <zautrix>2005-09-18 13:50:46 (UTC)
commitc6e493d4e5b9eafcc3402c39e30c4283ce8cc8e5 (patch) (side-by-side diff)
tree94e7bdc361b68a3a569eebe14f66458b3795dd6a
parente7cd095ea9e80e26c90cbc2d3bf36921b7541c19 (diff)
downloadkdepimpi-c6e493d4e5b9eafcc3402c39e30c4283ce8cc8e5.zip
kdepimpi-c6e493d4e5b9eafcc3402c39e30c4283ce8cc8e5.tar.gz
kdepimpi-c6e493d4e5b9eafcc3402c39e30c4283ce8cc8e5.tar.bz2
delay
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt9
-rw-r--r--kalarmd/simplealarmdaemonimpl.cpp8
-rw-r--r--korganizer/calendarview.cpp13
-rw-r--r--korganizer/calendarview.h3
-rw-r--r--korganizer/mainwindow.cpp67
-rw-r--r--korganizer/mainwindow.h5
6 files changed, 73 insertions, 32 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 @@
{ "Dinner","Abendessen" },
-{ "Do you really want\nto close KO/Pi?","Möchten Sie wirklich\nKO/PI verlassen?" },
+{ "Do you really want\nto close KO/Pi?","Möchten Sie wirklich\nKO/PI beenden?" },
{ "Due Date","Fällig am" },
@@ -771,2 +771,3 @@
{ "Export vcal filename(*.vcs)","Export vcal Dateiname(*.vcs)" },
+{ "Export iCal filename(*.ics)","Export iCal Dateiname(*.ics)" },
{ "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 @@
{ "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>." },
-{ "","" },
-{ "","" },
-{ "","" },
+{ " Yes, close "," Ja, beenden " },
+{ "Export All Data","Exportiere alle Daten" },
+{ "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" },
{ "","" },
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 )
mTimerPopUp = new QPopupMenu( this );
- QFont fon = mTimerPopUp->font();
- int points = 16;
- if ( QApplication::desktop()->width() < 480 )
- points = 12;
- fon.setPointSize( points );
- //qDebug("point s %d ", fon.pointSize());
- mTimerPopUp->setFont( fon );
- mPopUp->setFont( fon );
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()
restoreCalendarSettings();
+ //saveError = "test error";
if ( !saveError.isEmpty() ) {
@@ -4465,7 +4466,4 @@ void CalendarView::printPreview()
}
-
-void CalendarView::exportICalendar()
+bool CalendarView::exportICalendar( QString filename )
{
- QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this);
-
// Force correct extension
@@ -4474,3 +4472,8 @@ void CalendarView::exportICalendar()
FileStorage storage( mCalendar, filename, new ICalFormat() );
- storage.save();
+ return storage.save();
+}
+
+bool CalendarView::exportICalendar()
+{
+ return exportICalendar( KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this) );
}
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
/** Export as iCalendar file */
- void exportICalendar();
+ bool exportICalendar();
+ bool exportICalendar( QString fn );
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 ()
}
+
+bool MainWindow::askForQuitOnSaveError()
+{
+ bool retval = false;
+ switch( QMessageBox::information( this, "KO/Pi",
+ i18n("Error saving data") + "!\n" +
+ i18n("You can save all data\nto another file via\nFile->Export->Export All Data") + "!\n" +
+ i18n("Do you really want\nto close KO/Pi?"),
+ i18n(" Yes, close "), i18n("No"),
+ 0, 1 ) ) {
+ case 0:
+ retval = true;
+ break;
+ default:
+ break;
+ }
+ return retval;
+}
+
void MainWindow::closeEvent( QCloseEvent* ce )
@@ -532,3 +551,3 @@ void MainWindow::closeEvent( QCloseEvent* ce )
saveOnClose();
- if ( mCalendarModifiedFlag ) {
+ if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) {
ce->ignore();
@@ -548,3 +567,3 @@ void MainWindow::closeEvent( QCloseEvent* ce )
saveOnClose();
- if ( mCalendarModifiedFlag ) {
+ if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) {
ce->ignore();
@@ -1167,2 +1186,6 @@ void MainWindow::initActions()
//importMenu->insertSeparator();
+ action = new QAction( "export ical", i18n("Export All Data"), 0,
+ this );
+ action->addTo( exportMenu_X );
+ connect( action, SIGNAL( activated() ), SLOT( exportICalendar() ) );
action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
@@ -1969,3 +1992,3 @@ void MainWindow::slotModifiedChanged( bool )
mSaveTimer.start( msec, true ); // 1 minute
- mSaveTime.restart();
+ mSaveTimerStart = QDateTime::currentDateTime();
mSaveDelay = msec/1000;
@@ -2019,8 +2042,10 @@ void MainWindow::save()
if ( mSaveDelay ) {
- if ( mSaveDelay + 60 < mSaveTime.elapsed()/1000 ) {
- qDebug("KO: Save delay %d. Elapsed save time %d ", mSaveDelay, mSaveTime.elapsed()/1000 );
- qDebug("KO: Restarting save timer");
- int msec = 10000;
- mSaveTimer.start( msec, true ); // 1 minute
- mSaveTime.restart();
+ int elapsed = mSaveTimerStart.secsTo( QDateTime::currentDateTime() );
+ if ( mSaveDelay < elapsed ) {
+ qDebug("KO: Pending save after wakeup from suspend detected.");
+ qDebug("KO: Save delay %d sec. Elapsed save time %d sec.", mSaveDelay, elapsed );
+ qDebug("KO: Restarting save timer to save in 15 sec.");
+ int msec = 15000;
+ mSaveTimer.start( msec, true );
+ mSaveTimerStart = QDateTime::currentDateTime();
mSaveDelay = msec/1000;
@@ -2577,6 +2602,10 @@ void MainWindow::importIcal()
}
-
-void MainWindow::exportVCalendar()
+void MainWindow::exportCalendar( bool iCalFormat )
{
QString fn = KOPrefs::instance()->mLastVcalFile;
+ if ( iCalFormat ) {
+ fn = QDir::homeDirPath()+"/kopiexport.ics";
+ fn = KFileDialog::getSaveFileName( fn, i18n("Export iCal filename(*.ics)"), this );
+ }
+ else
fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this );
@@ -2598,4 +2627,8 @@ void MainWindow::exportVCalendar()
if ( createbup ) {
- if ( mView->exportVCalendar( fn ) ) {
- KOPrefs::instance()->mLastVcalFile = fn;
+ bool success = false;
+ if ( iCalFormat )
+ success = mView->exportICalendar( fn );
+ else
+ success = mView->exportVCalendar( fn );
+ if ( success ) {
if ( fn.length() > 20 )
@@ -2609,2 +2642,10 @@ void MainWindow::exportVCalendar()
}
+void MainWindow::exportICalendar()
+{
+ exportCalendar( true );
+}
+void MainWindow::exportVCalendar()
+{
+ exportCalendar( false );
+}
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
void exportVCalendar();
+ void exportICalendar();
+ void exportCalendar( bool );
void fillFilterMenu();
@@ -118,2 +120,3 @@ class MainWindow : public QMainWindow
void enableIncidenceActions( bool );
+ bool askForQuitOnSaveError();
@@ -176,3 +179,3 @@ class MainWindow : public QMainWindow
QTimer mSaveTimer;
- QTime mSaveTime;
+ QDateTime mSaveTimerStart;
int mSaveDelay;