-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 6 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 16 | ||||
-rw-r--r-- | libkcal/todo.cpp | 13 | ||||
-rw-r--r-- | libkcal/todo.h | 3 | ||||
-rw-r--r-- | qtcompat/qinputdialog.cpp | 2 |
5 files changed, 33 insertions, 7 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index bba9f87..2cb0132 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1331,17 +1331,17 @@ | |||
1331 | { "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, | 1331 | { "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, |
1332 | { "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, | 1332 | { "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, |
1333 | { " on "," am " }, | 1333 | { " on "," am " }, |
1334 | { "On: ","Am: " }, | 1334 | { "On: ","Am: " }, |
1335 | { "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, | 1335 | { "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, |
1336 | { "Start/Stop todo...","Starte/Stoppe Todo..." }, | 1336 | { "Start/Stop todo...","Starte/Stoppe Todo..." }, |
1337 | { "Color for running todos:","Farbe für laufende Todos:" }, | 1337 | { "Color for running todos:","Farbe für laufende Todos:" }, |
1338 | { "The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?","Das Todo\n%1\nist gestartet.\nWollen Sie es\nauf gestoppt setzen?" }, | 1338 | { "The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?","Das Todo\n%1\nist gestartet.\nWollen Sie es\nauf gestoppt setzen?" }, |
1339 | { "Todo is started","Todo is gestarted" }, | 1339 | { "Todo is started","Todo ist gestartet" }, |
1340 | { "Stop todo","Stoppe Todo" }, | 1340 | { "Stop todo","Stoppe Todo" }, |
1341 | { "Todo is stopped","Todo ist gestoppt" }, | 1341 | { "Todo is stopped","Todo ist gestoppt" }, |
1342 | { "Start todo","Starte Todo" }, | 1342 | { "Start todo","Starte Todo" }, |
1343 | { "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" }, | 1343 | { "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" }, |
1344 | { "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie alle\nUntertodos auch klonen?" }, | 1344 | { "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie alle\nUntertodos auch klonen?" }, |
1345 | { "Todo has subtodos","Todo hat Untertodos" }, | 1345 | { "Todo has subtodos","Todo hat Untertodos" }, |
1346 | { "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, | 1346 | { "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, |
1347 | { "Colors","Farben" }, | 1347 | { "Colors","Farben" }, |
@@ -1362,12 +1362,14 @@ | |||
1362 | { "Backup Failed!","Backup Problem!" }, | 1362 | { "Backup Failed!","Backup Problem!" }, |
1363 | { "Try again now","Versuche jetzt nochmal" }, | 1363 | { "Try again now","Versuche jetzt nochmal" }, |
1364 | { "Try again later","Versuche später nochmal" }, | 1364 | { "Try again later","Versuche später nochmal" }, |
1365 | { "Try again tomorrow","Versuche morgen nochmal" }, | 1365 | { "Try again tomorrow","Versuche morgen nochmal" }, |
1366 | { "Disable backup","Schalte Backup ab" }, | 1366 | { "Disable backup","Schalte Backup ab" }, |
1367 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, | 1367 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, |
1368 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, | 1368 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, |
1369 | { "Choose action","Wähle Aktion" }, | 1369 | { "Choose action","Wähle Aktion" }, |
1370 | { "Comment for todo:","Kommentar zum Todo:" }, | ||
1371 | { "Stop+note","Stop+Notiz" }, | ||
1370 | { "","" }, | 1372 | { "","" }, |
1371 | { "","" }, | 1373 | { "","" }, |
1372 | { "","" }, | 1374 | { "","" }, |
1373 | { "","" }, | 1375 | { "","" }, \ No newline at end of file |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index e95039d..8fe9999 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -21,16 +21,18 @@ | |||
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qheader.h> | 25 | #include <qheader.h> |
26 | #include <qcursor.h> | 26 | #include <qcursor.h> |
27 | #include <qwhatsthis.h> | 27 | #include <qwhatsthis.h> |
28 | 28 | ||
29 | #include <qinputdialog.h> | ||
30 | |||
29 | #include <qvbox.h> | 31 | #include <qvbox.h> |
30 | #include <kdebug.h> | 32 | #include <kdebug.h> |
31 | #include "koprefs.h" | 33 | #include "koprefs.h" |
32 | #include <klocale.h> | 34 | #include <klocale.h> |
33 | #include <kglobal.h> | 35 | #include <kglobal.h> |
34 | #include <kiconloader.h> | 36 | #include <kiconloader.h> |
35 | #include <kmessagebox.h> | 37 | #include <kmessagebox.h> |
36 | 38 | ||
@@ -1121,20 +1123,30 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item) | |||
1121 | } | 1123 | } |
1122 | void KOTodoView::toggleRunningItem() | 1124 | void KOTodoView::toggleRunningItem() |
1123 | { | 1125 | { |
1124 | // qDebug("KOTodoView::toggleRunning() "); | 1126 | // qDebug("KOTodoView::toggleRunning() "); |
1125 | if ( ! mActiveItem ) | 1127 | if ( ! mActiveItem ) |
1126 | return; | 1128 | return; |
1127 | Todo * t = mActiveItem->todo(); | 1129 | Todo * t = mActiveItem->todo(); |
1128 | if ( t->isRunning() ) { | 1130 | if ( t->isRunning() ) { |
1131 | #if 0 | ||
1129 | int result = KMessageBox::warningContinueCancel(this, | 1132 | int result = KMessageBox::warningContinueCancel(this, |
1130 | i18n("The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is started"),i18n("Stop todo"),i18n("Cancel"), true); | 1133 | i18n("The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is started"),i18n("Stop todo"),i18n("Cancel"), true); |
1131 | if (result != KMessageBox::Continue) return; | 1134 | #endif |
1132 | t->setRunning( false ); | 1135 | |
1136 | int result = KMessageBox::warningYesNoCancel(this, | ||
1137 | i18n("The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is started"),i18n("Stop"),i18n("Stop+note")); | ||
1138 | if (result == KMessageBox::Cancel) return; | ||
1139 | if ( result == KMessageBox::No ) { | ||
1140 | QString comment = QInputDialog::getText(mActiveItem->text(0).left( 25 ),i18n("Comment for todo:") ); | ||
1141 | t->setRunningFalse( comment ); | ||
1142 | } else { | ||
1143 | t->setRunning( false ); | ||
1144 | } | ||
1133 | mActiveItem->construct(); | 1145 | mActiveItem->construct(); |
1134 | } else { | 1146 | } else { |
1135 | int result = KMessageBox::warningContinueCancel(this, | 1147 | int result = KMessageBox::warningContinueCancel(this, |
1136 | i18n("The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is stopped"),i18n("Start todo"),i18n("Cancel"), true); | 1148 | i18n("The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is stopped"),i18n("Start todo"),i18n("Cancel"), true); |
1137 | if (result != KMessageBox::Continue) return; | 1149 | if (result != KMessageBox::Continue) return; |
1138 | t->setRunning( true ); | 1150 | t->setRunning( true ); |
1139 | mActiveItem->construct(); | 1151 | mActiveItem->construct(); |
1140 | } | 1152 | } |
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 002d3f2..f7e38a7 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -56,16 +56,24 @@ Todo::Todo(const Todo &t) : QObject(),Incidence(t) | |||
56 | } | 56 | } |
57 | 57 | ||
58 | Todo::~Todo() | 58 | Todo::~Todo() |
59 | { | 59 | { |
60 | setRunning( false ); | 60 | setRunning( false ); |
61 | //qDebug("Todo::~Todo() "); | 61 | //qDebug("Todo::~Todo() "); |
62 | } | 62 | } |
63 | 63 | ||
64 | void Todo::setRunningFalse( QString s ) | ||
65 | { | ||
66 | if ( ! mRunning ) | ||
67 | return; | ||
68 | mRunning = false; | ||
69 | mRunSaveTimer->stop(); | ||
70 | saveRunningInfoToFile( s ); | ||
71 | } | ||
64 | void Todo::setRunning( bool run ) | 72 | void Todo::setRunning( bool run ) |
65 | { | 73 | { |
66 | if ( run == mRunning ) | 74 | if ( run == mRunning ) |
67 | return; | 75 | return; |
68 | //qDebug("Todo::setRunning %d ", run); | 76 | //qDebug("Todo::setRunning %d ", run); |
69 | if ( !mRunSaveTimer ) { | 77 | if ( !mRunSaveTimer ) { |
70 | mRunSaveTimer = new QTimer ( this ); | 78 | mRunSaveTimer = new QTimer ( this ); |
71 | connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) ); | 79 | connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) ); |
@@ -75,17 +83,17 @@ void Todo::setRunning( bool run ) | |||
75 | mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min | 83 | mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min |
76 | mRunStart = QDateTime::currentDateTime(); | 84 | mRunStart = QDateTime::currentDateTime(); |
77 | } else { | 85 | } else { |
78 | mRunSaveTimer->stop(); | 86 | mRunSaveTimer->stop(); |
79 | saveRunningInfoToFile(); | 87 | saveRunningInfoToFile(); |
80 | } | 88 | } |
81 | } | 89 | } |
82 | 90 | ||
83 | void Todo::saveRunningInfoToFile() | 91 | void Todo::saveRunningInfoToFile( QString comment ) |
84 | { | 92 | { |
85 | //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); | 93 | //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); |
86 | if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 30 ) { | 94 | if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 30 ) { |
87 | qDebug("Running time < 30 seconds. Skipped. "); | 95 | qDebug("Running time < 30 seconds. Skipped. "); |
88 | return; | 96 | return; |
89 | } | 97 | } |
90 | QString dir = KGlobalSettings::timeTrackerDir(); | 98 | QString dir = KGlobalSettings::timeTrackerDir(); |
91 | //qDebug("%s ", dir.latin1()); | 99 | //qDebug("%s ", dir.latin1()); |
@@ -98,16 +106,19 @@ void Todo::saveRunningInfoToFile() | |||
98 | cal.setLocalTime(); | 106 | cal.setLocalTime(); |
99 | Todo * to = (Todo*) clone(); | 107 | Todo * to = (Todo*) clone(); |
100 | to->setFloats( false ); | 108 | to->setFloats( false ); |
101 | to->setDtStart( mRunStart ); | 109 | to->setDtStart( mRunStart ); |
102 | to->setHasStartDate( true ); | 110 | to->setHasStartDate( true ); |
103 | to->setDtDue( QDateTime::currentDateTime() ); | 111 | to->setDtDue( QDateTime::currentDateTime() ); |
104 | to->setHasDueDate( true ); | 112 | to->setHasDueDate( true ); |
105 | to->setUid( file ); | 113 | to->setUid( file ); |
114 | if ( !comment.isEmpty() ) { | ||
115 | to->setDescription( comment ); | ||
116 | } | ||
106 | cal.addIncidence( to ); | 117 | cal.addIncidence( to ); |
107 | ICalFormat format; | 118 | ICalFormat format; |
108 | file = dir +"/" +file +".ics"; | 119 | file = dir +"/" +file +".ics"; |
109 | format.save( &cal, file ); | 120 | format.save( &cal, file ); |
110 | saveParents(); | 121 | saveParents(); |
111 | 122 | ||
112 | } | 123 | } |
113 | void Todo::saveParents() | 124 | void Todo::saveParents() |
diff --git a/libkcal/todo.h b/libkcal/todo.h index ec1ffda..a5354ce 100644 --- a/libkcal/todo.h +++ b/libkcal/todo.h | |||
@@ -115,20 +115,21 @@ namespace KCal { | |||
115 | /** Return true, if todo has a date associated with completion */ | 115 | /** Return true, if todo has a date associated with completion */ |
116 | bool hasCompletedDate() const; | 116 | bool hasCompletedDate() const; |
117 | bool contains ( Todo*); | 117 | bool contains ( Todo*); |
118 | void checkSetCompletedFalse(); | 118 | void checkSetCompletedFalse(); |
119 | bool setRecurDates(); | 119 | bool setRecurDates(); |
120 | bool isRunning() {return mRunning;} | 120 | bool isRunning() {return mRunning;} |
121 | bool hasRunningSub(); | 121 | bool hasRunningSub(); |
122 | void setRunning( bool ); | 122 | void setRunning( bool ); |
123 | void setRunningFalse( QString ); | ||
123 | int runTime(); | 124 | int runTime(); |
124 | QDateTime runStart () const { return mRunStart;} | 125 | QDateTime runStart () const { return mRunStart;} |
125 | public slots: | 126 | public slots: |
126 | void saveRunningInfoToFile(); | 127 | void saveRunningInfoToFile( QString st = QString::null ); |
127 | void saveParents(); | 128 | void saveParents(); |
128 | private: | 129 | private: |
129 | bool mRunning; | 130 | bool mRunning; |
130 | QTimer * mRunSaveTimer; | 131 | QTimer * mRunSaveTimer; |
131 | QDateTime mRunStart; | 132 | QDateTime mRunStart; |
132 | bool accept(Visitor &v) { return v.visit(this); } | 133 | bool accept(Visitor &v) { return v.visit(this); } |
133 | 134 | ||
134 | QDateTime mDtDue; // due date of todo | 135 | QDateTime mDtDue; // due date of todo |
diff --git a/qtcompat/qinputdialog.cpp b/qtcompat/qinputdialog.cpp index 64c581e..ce46118 100644 --- a/qtcompat/qinputdialog.cpp +++ b/qtcompat/qinputdialog.cpp | |||
@@ -303,17 +303,17 @@ QString QInputDialog::getText( const QString &caption, const QString &label, QLi | |||
303 | const QString &text, bool *ok, QWidget *parent, const char *name ) | 303 | const QString &text, bool *ok, QWidget *parent, const char *name ) |
304 | { | 304 | { |
305 | QInputDialog *dlg = new QInputDialog( label, parent, name, TRUE, LineEdit ); | 305 | QInputDialog *dlg = new QInputDialog( label, parent, name, TRUE, LineEdit ); |
306 | dlg->setCaption( caption ); | 306 | dlg->setCaption( caption ); |
307 | dlg->lineEdit()->setText( text ); | 307 | dlg->lineEdit()->setText( text ); |
308 | dlg->lineEdit()->setEchoMode( mode ); | 308 | dlg->lineEdit()->setEchoMode( mode ); |
309 | if ( !text.isEmpty() ) | 309 | if ( !text.isEmpty() ) |
310 | dlg->lineEdit()->selectAll(); | 310 | dlg->lineEdit()->selectAll(); |
311 | 311 | dlg->setMinimumWidth ( 230 ); | |
312 | bool ok_ = FALSE; | 312 | bool ok_ = FALSE; |
313 | QString result; | 313 | QString result; |
314 | ok_ = dlg->exec() == QDialog::Accepted; | 314 | ok_ = dlg->exec() == QDialog::Accepted; |
315 | if ( ok ) | 315 | if ( ok ) |
316 | *ok = ok_; | 316 | *ok = ok_; |
317 | if ( ok_ ) | 317 | if ( ok_ ) |
318 | result = dlg->lineEdit()->text(); | 318 | result = dlg->lineEdit()->text(); |
319 | 319 | ||