summaryrefslogtreecommitdiffabout
Side-by-side diff
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
@@ -1543,31 +1543,39 @@
{ "In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.","In dieser Spalte wird der <b>Name des Kalenders</b> angezeigt. Wenn Sie auf den Namen klicken wird Information über die Kalenderdatei angezeigt. Wenn die Datei beim Start nicht geladen wurde können Sie hier erneut versuchen sie zu laden." },
{ "In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as "do not use". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.","In dieser Spalte können die <b>Alarme eines Kalenders alle zusammen abgeschaltet werden</b>. Die Alarmdaten im Kalender selbst werden nicht verändert, es werde die Alarme intern als "nicht beachten" markiert. Nützlich wenn Sie den Kalender einer anderen Person laden aber nicht über dessen Alarme unterrichtet werden wollen." },
{ "In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.","In dieser Spalte können Sie einen <b>Kalender und alle Einträge auf schreibgeschützt setzen</b>. Einträge eines schreibgeschützten Kalenders können nicht verändert werden und es können keine Einträge zum Kalender hinzugefügt werden. Wenn Sie die Einstellung eines Kalenders in dieser Spalte auf schreibgeschützt setzen werden alle Daten automatisch abgespeichert, da die Daten eines schreibgeschützten Kalenders später nicht mehr gespeichert werden." },
{ "Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.","Klicken Sie diesen Knopf <b>um einen Kalender hinzuzufügen</b>. Sie können eine existierende Kalenderdatei hinzufügen oder einen neuen Kalender und KO/Pi legt dann eine neue leere Kalenderdatei für Sie an." },
{ "<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)","<b>iCal (*.ics) Datei:</b><br>(Datei wird angelegt, wenn sie nicht existiert)" },
{ "Error saving data","Fehler beim Abspeichern" },
{ "Calendar(s) not saved:","Nicht gespeicherte Kalender:" },
{ "Enable conflict detection","Schalte Konflikterkennung an" },
{ "Filter for the edited event","Filter für den bearbeiteten Termin" },
{ "Filter for other events","Filter für die anderen Termine" },
{ "Check Allday with Allday","Prüfe GanzTag mit GanzTag" },
{ "Check Allday with NonAllday","Prüfe GanzTag mit NichtGanzTag" },
{ "Check NonAllday with Allday","Prüfe NichtGanzTag mit GanzTag" },
{ "Check NonAllday with NonAllday","Prüfe NichtGanzTag mit NichtGanzTag" },
{ "Conflict detection","Konflikterkennung" },
{ "Loading calendar files ... please wait","Lade Kalenderdateien ... bitte warten" },
{ "Show multiday allday ev. in date nav.","Zeige Multi-Ganzt.Term.in Datums Nav." },
{ "Include events which "show as free"","Inklusive Termine mit "Zeige Zeit als frei"" },
{ "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" },
{ "<p><b>Duration:</b> %1 days</p>","<p><b>Dauer:</b> %1 Tage</p>" },
{ " (Duration: %1 days)"," (Dauer: %1 Tage)" },
+{ "Autosave enabled!","Auto-Speichern angeschaltet!" },
+{ "Autosave disabled! Save timer stopped!","Auto-Speichern ausgeschaltet! Speicher Timer gestoppt!" },
+{ "Autosave disabled!","Auto-Speichern ist ausgeschaltet!" },
+{ "Yes, Save!","Ja, Speichern!" },
+{ "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?" },
+{ "<p><b>C+ctrl</b>: Dis/enable automatic saving</p>\n","<p><b>C+ctrl</b>: Auto-Speichern ab/anschalten</p>\n" },
+{ "","" },
+{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index c597138..66bb19b 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -149,48 +149,49 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
QPainter p ( sgListViewCompletedPix[5] );
p.drawRect( 0,0,11,11);
p.drawLine ( 2, 5, 4 , 7 ) ;
p.drawLine ( 4 , 7 , 8, 3) ;
int iii = 0;
for ( iii = 0; iii < 5; ++iii ) {
sgListViewCompletedPix[iii]->resize( 11, 11 );
sgListViewCompletedPix[iii]->fill( Qt::white );
QPainter p ( sgListViewCompletedPix[iii] );
p.drawRect( 0,0,11,11);
if ( iii )
p.fillRect( 1,1,iii*2,9,Qt::gray );
}
sgListViewJournalPix = &journalPix;
sgListViewJournalPix->resize( 11, 11 );
sgListViewJournalPix->fill( Qt::white );
{
QPainter p ( sgListViewJournalPix );
p.drawRect( 0,0,11,11);
p.drawLine( 2,3,5,3);
p.drawLine( 2,5,8,5);
p.drawLine( 2,7,6,7);
}
}
+ mAutoSaveDisabled = false;
mClosed = false;
//QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
QString confFile = locateLocal("config","korganizerrc");
QFileInfo finf ( confFile );
bool showWarning = !finf.exists();
setIcon(SmallIcon( "ko24" ) );
mBlockAtStartup = true;
mFlagKeyPressed = false;
setCaption("KO/Pi");
KOPrefs *p = KOPrefs::instance();
//KPimGlobalPrefs::instance()->setGlobalConfig();
p->mCurrentDisplayedView = 0;
if ( p->mHourSize > 22 )
p->mHourSize = 22;
QMainWindow::ToolBarDock tbd;
if ( p->mToolBarHor ) {
if ( p->mToolBarUp )
tbd = Bottom;
else
tbd = Top;
}
else {
if ( p->mToolBarUp )
tbd = Right;
@@ -516,75 +517,93 @@ void MainWindow::showMaximized ()
if ( mClosed )
mView->goToday();
#endif
QWidget::showMaximized () ;
mClosed = false;
}
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;
}
-
+bool MainWindow::checkAutosave()
+{
+ bool savedata = true;
+ if ( mAutoSaveDisabled && mCalendarModifiedFlag ) {
+ switch( QMessageBox::information( this, "KO/Pi",
+ i18n("Calendar is modified\nbut Autosave is disabled!\nDo you want\nto save the data?"),
+ i18n("Yes, Save!"), i18n("No"),
+ 0, 0 ) ) {
+ case 1:
+ case 2:
+ savedata = false;
+ break;
+ default:
+ break;
+ }
+ }
+ return savedata;
+}
void MainWindow::closeEvent( QCloseEvent* ce )
{
-
-
-
if ( ! KOPrefs::instance()->mAskForQuit ) {
- saveOnClose();
- if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) {
- ce->ignore();
- return;
+ if ( checkAutosave() ) {
+ saveOnClose();
+ if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) {
+ ce->ignore();
+ return;
+ }
}
mClosed = true;
ce->accept();
return;
}
switch( QMessageBox::information( this, "KO/Pi",
i18n("Do you really want\nto close KO/Pi?"),
i18n("Close"), i18n("No"),
0, 0 ) ) {
- case 0:
- saveOnClose();
- if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) {
- ce->ignore();
- return;
+ case 0:
+ if ( checkAutosave() ) {
+ saveOnClose();
+ if ( mCalendarModifiedFlag && !askForQuitOnSaveError() ) {
+ ce->ignore();
+ return;
+ }
}
mClosed = true;
ce->accept();
break;
case 1:
ce->ignore();
break;
case 2:
default:
break;
}
}
void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data )
{
qDebug("KO: QCOP start message received: %s ", cmsg.data() );
mCStringMess = cmsg;
mByteData = data;
}
void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
{
QDataStream stream( data, IO_ReadOnly );
@@ -1636,48 +1655,49 @@ void MainWindow::licence()
}
void MainWindow::about()
{
QString version;
#include <../version>
QMessageBox::about( this, i18n("About KOrganizer/Pi"),
i18n("KOrganizer/Platform-independent\n") +
"(KO/Pi) " + version + " - " +
#ifdef DESKTOP_VERSION
i18n("Desktop Edition\n") +
#else
i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") +
#endif
i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") );
}
void MainWindow::keyBindings()
{
QString cap = i18n("KO/Pi Keys + Colors");
QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") +
i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") +
+ i18n("<p><b>C+ctrl</b>: Dis/enable automatic saving</p>\n") +
i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+
i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+
i18n("<p><b>Q</b>: Show next date with conflicting events\n ")+
i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+
i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+
i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
i18n("<p><h3>In agenda view:</h3></p>\n") +
i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
i18n("<p><h3>In todo view:</h3></p>\n") +
@@ -1951,67 +1971,79 @@ void MainWindow::saveOnClose()
else
p->mToolBarUpV = viewToolBar->x() > width()/2 ;
if ( p->mToolBarHorN )
p->mToolBarUpN = navigatorToolBar->y() > height()/2;
else
p->mToolBarUpN = navigatorToolBar->x() > width()/2 ;
if ( filterToolBar ) {
if ( p->mToolBarHorF )
p->mToolBarUpF = filterToolBar->y() > height()/2;
else
p->mToolBarUpF = filterToolBar->x() > width()/2 ;
}
#endif
save();
mView->writeSettings();
mView->checkSuspendAlarm();
}
void MainWindow::slotModifiedChanged( bool )
{
if ( mBlockAtStartup )
return;
int msec;
+ if ( mAutoSaveDisabled ) {
+ QTimer::singleShot( 0, this , SLOT ( autoSaveWarning() ) );
+ qDebug("KO: Autosave disabled (data change deteced)!");
+ }
if ( mCalendarModifiedFlag ) {
//qDebug(" MainWindow timer is running ");
return;
}
+ mCalendarModifiedFlag = true;
+ if ( mAutoSaveDisabled ) {
+ return;
+ }
// we store the changes after 1 minute,
// and for safety reasons after 10 minutes again
if ( !mSyncManager->blockSave() )
msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000;
else
msec = 1000 * 600;
mSaveTimer.start( msec, true ); // 1 minute
mSaveTimerStart = QDateTime::currentDateTime();
mSaveDelay = msec/1000;
qDebug("KO: Saving File in %d secs!", msec/1000);
- mCalendarModifiedFlag = true;
+}
+void MainWindow::autoSaveWarning()
+{
+ setCaption(i18n("Autosave disabled!" ));
}
void MainWindow::saveStopTimer()
{
mSaveTimer.stop();
+ mSaveDelay = 0;
}
void MainWindow::backupAllFiles()
{
QDate reference ( 2000,1,1);
int daysTo = reference.daysTo ( QDate::currentDate() );
setCaption(i18n("Creating backup ... please wait ..." ));
qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate);
// we need the file path, the backup dir and the number of bups as param
QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
bupDir = KGlobalSettings::backupDataDir();
int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
if ( retval == 0 ) {
setCaption(i18n("Backup cancelled" ));
qDebug("KO: Backup cancelled. Will try again tomorrow ");
// retval == 0 : backup skipped for today, try again tomorrow
KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1;
} else if ( retval == 1 ){
qDebug("KO: Backup created.");
// backup ok
QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
KopiCalendarFile * cal = calendars.first();
cal = calendars.next();
while ( cal ) {
@@ -2186,50 +2218,61 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
case Qt::Key_Y :
case Qt::Key_Z :
mView->viewManager()->showWorkWeekView();
showSelectedDates = true;
break;
case Qt::Key_U :
mView->viewManager()->showWeekView();
showSelectedDates = true;
break;
case Qt::Key_H :
keyBindings();
break;
case Qt::Key_W:
mView->viewManager()->showWhatsNextView();
break;
case Qt::Key_L:
mView->viewManager()->showListView();
break;
case Qt::Key_N:
mView->viewManager()->showNextView();
break;
case Qt::Key_V:
mView->viewManager()->showTodoView();
break;
- case Qt::Key_C:
- mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
+ case Qt::Key_C:
+ if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) {
+ if ( mAutoSaveDisabled ) {
+ mAutoSaveDisabled = false;
+ setCaption(i18n("Autosave enabled!" ));
+ return;
+ } else {
+ mAutoSaveDisabled = true;
+ saveStopTimer();
+ setCaption(i18n("Autosave disabled! Save timer stopped!" ));
+ }
+ } else
+ mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
break;
case Qt::Key_P:
mView->showDatePicker( );
break;
case Qt::Key_F:
mView->editFilters();
break;
case Qt::Key_R:
mView->toggleFilter();
break;
case Qt::Key_X:
if ( e->state() == Qt::ControlButton )
mView->toggleDateNavigatorWidget();
else {
mView->viewManager()->showNextXView();
showSelectedDates = true;
}
break;
case Qt::Key_Space:
mView->toggleExpand();
break;
case Qt::Key_A:
if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton )
mView->showNextAlarms();
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 71c069b..d8018b6 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -31,48 +31,49 @@ class CalendarLocal;
using namespace KCal;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow( QWidget *parent = 0, const char *name = 0 );
~MainWindow();
bool beamReceiveEnabled();
static QString defaultFileName();
static QString syncFileName();
static QString resourcePath();
public slots:
void setUsesBigPixmaps ( bool );
void setCaption ( const QString & );
void updateWeekNum(const KCal::DateList &);
void updateWeek(QDate);
void updateFilterToolbar();
virtual void showMaximized ();
void configureAgenda( int );
void recieve( const QCString& msg, const QByteArray& data );
void receiveStart( const QCString& msg, const QByteArray& data );
protected slots:
+ void autoSaveWarning();
void loadDataAfterStart();
void calHint();
void startMultiSync();
void setCaptionToDates();
void weekAction();
void about();
void licence();
void faq();
void usertrans();
void features();
void synchowto();
void storagehowto();
void timetrackinghowto();
void kdesynchowto();
void multisynchowto();
void whatsNew();
void keyBindings();
void aboutAutoSaving();;
void aboutKnownBugs();
void processIncidenceSelection( Incidence * );
void importQtopia();
void importBday();
@@ -100,49 +101,50 @@ class MainWindow : public QMainWindow
void selectFilter( int );
void fillFilterMenuPopup();
void selectFilterPopup( int );
void exportToPhone( int );
void toggleBeamReceive();
void disableBR(bool);
signals:
void selectWeek ( int );
private slots:
void slotResetFocus();
void slotResetFocusLoop();
void showConfigureAgenda();
void getFile( bool );
void syncFileRequest();
protected:
int mFocusLoop;
void hideEvent ( QHideEvent * );
QString sentSyncFile();
void displayText( QString, QString);
void enableIncidenceActions( bool );
bool askForQuitOnSaveError();
private:
-
+ bool mAutoSaveDisabled;
+ bool checkAutosave();
QCString mCStringMess;
QByteArray mByteData;
//void setMenuBar( QMenuBar * );
bool mBRdisabled;
#ifndef DESKTOP_VERSION
QCopChannel* infrared;
#endif
QAction* brAction;
KSyncManager* mSyncManager;
bool mClosed;
void saveOnClose();
bool mFlagKeyPressed;
bool mBlockAtStartup;
KMenuBar *menuBar1;
QPEToolBar *iconToolBar;
QPEToolBar *viewToolBar;
QPEToolBar *navigatorToolBar;
QPEToolBar *filterToolBar;
KMenuBar *filterMenubar;
QPopupMenu * filterPopupMenu;
QPopupMenu * mCurrentItemMenu;
void initActions();
void setDefaultPreferences();