-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 @@ -1327,25 +1327,25 @@ { "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, { "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, { "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, { "Show Sync Events","Zeige Sync-Ereignisse" }, { "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, { "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, { " on "," am " }, { "On: ","Am: " }, { "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, { "Start/Stop todo...","Starte/Stoppe Todo..." }, { "Color for running todos:","Farbe für laufende Todos:" }, { "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?" }, -{ "Todo is started","Todo is gestarted" }, +{ "Todo is started","Todo ist gestartet" }, { "Stop todo","Stoppe Todo" }, { "Todo is stopped","Todo ist gestoppt" }, { "Start todo","Starte Todo" }, { "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?" }, { "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?" }, { "Todo has subtodos","Todo hat Untertodos" }, { "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, { "Colors","Farben" }, { "Click on new parent item","Klicke auf neues Übertodo" }, { "Reparenting aborted!","Übertodo setzen abgebrochen" }, { "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, { "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, @@ -1358,16 +1358,18 @@ { "Number of Backups:","Anzahl der Backups" }, { "Make backup every ","Mache ein Backup alle " }, { " days"," Tage" }, { "Creating backup ... please wait ...","Erzeuge Backup ... bitte warten ..." }, { "Backup Failed!","Backup Problem!" }, { "Try again now","Versuche jetzt nochmal" }, { "Try again later","Versuche später nochmal" }, { "Try again tomorrow","Versuche morgen nochmal" }, { "Disable backup","Schalte Backup ab" }, { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, { "Choose action","Wähle Aktion" }, +{ "Comment for todo:","Kommentar zum Todo:" }, +{ "Stop+note","Stop+Notiz" }, { "","" }, { "","" }, { "","" }, -{ "","" }, +{ "","" },
\ 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 @@ -17,24 +17,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #include <qlayout.h> #include <qheader.h> #include <qcursor.h> #include <qwhatsthis.h> +#include <qinputdialog.h> + #include <qvbox.h> #include <kdebug.h> #include "koprefs.h" #include <klocale.h> #include <kglobal.h> #include <kiconloader.h> #include <kmessagebox.h> #include <libkcal/icaldrag.h> #include <libkcal/vcaldrag.h> #include <libkcal/calfilter.h> #include <libkcal/dndfactory.h> @@ -1117,28 +1119,38 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item) if ( KOPrefs::instance()->mEditOnDoubleClick ) editItem( item ); else showItem( item , QPoint(), 0 ); } void KOTodoView::toggleRunningItem() { // qDebug("KOTodoView::toggleRunning() "); if ( ! mActiveItem ) return; Todo * t = mActiveItem->todo(); if ( t->isRunning() ) { +#if 0 int result = KMessageBox::warningContinueCancel(this, 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); - if (result != KMessageBox::Continue) return; - t->setRunning( false ); +#endif + + int result = KMessageBox::warningYesNoCancel(this, + 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")); + if (result == KMessageBox::Cancel) return; + if ( result == KMessageBox::No ) { + QString comment = QInputDialog::getText(mActiveItem->text(0).left( 25 ),i18n("Comment for todo:") ); + t->setRunningFalse( comment ); + } else { + t->setRunning( false ); + } mActiveItem->construct(); } else { int result = KMessageBox::warningContinueCancel(this, 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); if (result != KMessageBox::Continue) return; t->setRunning( true ); mActiveItem->construct(); } } void KOTodoView::itemClicked(QListViewItem *item) { diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 002d3f2..f7e38a7 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -52,66 +52,77 @@ Todo::Todo(const Todo &t) : QObject(),Incidence(t) mHasCompletedDate = t.mHasCompletedDate; mPercentComplete = t.mPercentComplete; mRunning = false; mRunSaveTimer = 0; } Todo::~Todo() { setRunning( false ); //qDebug("Todo::~Todo() "); } +void Todo::setRunningFalse( QString s ) +{ + if ( ! mRunning ) + return; + mRunning = false; + mRunSaveTimer->stop(); + saveRunningInfoToFile( s ); +} void Todo::setRunning( bool run ) { if ( run == mRunning ) return; //qDebug("Todo::setRunning %d ", run); if ( !mRunSaveTimer ) { mRunSaveTimer = new QTimer ( this ); connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) ); } mRunning = run; if ( mRunning ) { mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min mRunStart = QDateTime::currentDateTime(); } else { mRunSaveTimer->stop(); saveRunningInfoToFile(); } } -void Todo::saveRunningInfoToFile() +void Todo::saveRunningInfoToFile( QString comment ) { //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 30 ) { qDebug("Running time < 30 seconds. Skipped. "); return; } QString dir = KGlobalSettings::timeTrackerDir(); //qDebug("%s ", dir.latin1()); QString file = "%1%2%3-%4%5%6-"; file = file.arg( mRunStart.date().year(), 4).arg( mRunStart.date().month(),2 ).arg( mRunStart.date().day(), 2 ).arg( mRunStart.time().hour(),2 ).arg( mRunStart.time().minute(),2 ).arg( mRunStart.time().second(),2 ); file.replace ( QRegExp (" "), "0" ); file += uid(); //qDebug("File %s ",file.latin1() ); CalendarLocal cal; cal.setLocalTime(); Todo * to = (Todo*) clone(); to->setFloats( false ); to->setDtStart( mRunStart ); to->setHasStartDate( true ); to->setDtDue( QDateTime::currentDateTime() ); to->setHasDueDate( true ); to->setUid( file ); + if ( !comment.isEmpty() ) { + to->setDescription( comment ); + } cal.addIncidence( to ); ICalFormat format; file = dir +"/" +file +".ics"; format.save( &cal, file ); saveParents(); } void Todo::saveParents() { if (!relatedTo() ) return; Incidence * inc = relatedTo(); diff --git a/libkcal/todo.h b/libkcal/todo.h index ec1ffda..a5354ce 100644 --- a/libkcal/todo.h +++ b/libkcal/todo.h @@ -111,28 +111,29 @@ namespace KCal { QString completedStr(bool shortF = true) const; /** set date and time of completion */ void setCompleted(const QDateTime &completed); /** Return true, if todo has a date associated with completion */ bool hasCompletedDate() const; bool contains ( Todo*); void checkSetCompletedFalse(); bool setRecurDates(); bool isRunning() {return mRunning;} bool hasRunningSub(); void setRunning( bool ); + void setRunningFalse( QString ); int runTime(); QDateTime runStart () const { return mRunStart;} public slots: - void saveRunningInfoToFile(); + void saveRunningInfoToFile( QString st = QString::null ); void saveParents(); private: bool mRunning; QTimer * mRunSaveTimer; QDateTime mRunStart; bool accept(Visitor &v) { return v.visit(this); } QDateTime mDtDue; // due date of todo bool mHasDueDate; // if todo has associated due date // int mStatus; // confirmed/delegated/tentative/etc diff --git a/qtcompat/qinputdialog.cpp b/qtcompat/qinputdialog.cpp index 64c581e..ce46118 100644 --- a/qtcompat/qinputdialog.cpp +++ b/qtcompat/qinputdialog.cpp @@ -299,25 +299,25 @@ QString QInputDialog::getText( const QString &caption, const QString &label, con \sa getText() */ QString QInputDialog::getText( const QString &caption, const QString &label, QLineEdit::EchoMode mode, const QString &text, bool *ok, QWidget *parent, const char *name ) { QInputDialog *dlg = new QInputDialog( label, parent, name, TRUE, LineEdit ); dlg->setCaption( caption ); dlg->lineEdit()->setText( text ); dlg->lineEdit()->setEchoMode( mode ); if ( !text.isEmpty() ) dlg->lineEdit()->selectAll(); - + dlg->setMinimumWidth ( 230 ); bool ok_ = FALSE; QString result; ok_ = dlg->exec() == QDialog::Accepted; if ( ok ) *ok = ok_; if ( ok_ ) result = dlg->lineEdit()->text(); delete dlg; return result; } |