summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt6
-rw-r--r--korganizer/kotodoview.cpp16
-rw-r--r--libkcal/todo.cpp13
-rw-r--r--libkcal/todo.h3
-rw-r--r--qtcompat/qinputdialog.cpp2
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
@@ -1323,51 +1323,53 @@
{ "%1d","%1t" },
{ "%1h","%1std" },
{ "%1min","%1min" },
{ "( %1 before )","( %1 vorher )" },
{ "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" },
{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" },
{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" },
{ "times","Zeiten" },
{ "The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?","Das Todo\n%1\nhat Untertodos!\nMöchten Sie die Kategorien\nauch für alle Untertodos setzen?" },
{ "Backup enabled","Backup angeschaltet" },
{ "Use standard backup dir","Standard Backupverzeichnis" },
{ "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
@@ -13,32 +13,34 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
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>
#include <libkcal/calendarresources.h>
#include <libkcal/resourcecalendar.h>
#include <kresources/resourceselectdialog.h>
#include <libkcal/kincidenceformatter.h>
@@ -1113,36 +1115,46 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item)
toggleRunningItem();
return;
}
}
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)
{
//qDebug("KOTodoView::itemClicked %d", item);
if (!item) {
if ( pendingSubtodo != 0 ) {
topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 002d3f2..f7e38a7 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -48,74 +48,85 @@ Todo::Todo(const Todo &t) : QObject(),Incidence(t)
{
mDtDue = t.mDtDue;
mHasDueDate = t.mHasDueDate;
mCompleted = t.mCompleted;
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();
if ( inc->type() != "Todo" )
return;
Todo* to = (Todo*)inc;
bool saveTodo = false;
diff --git a/libkcal/todo.h b/libkcal/todo.h
index ec1ffda..a5354ce 100644
--- a/libkcal/todo.h
+++ b/libkcal/todo.h
@@ -107,36 +107,37 @@ namespace KCal {
void setPercentComplete(int);
/** return date and time when todo was completed */
QDateTime completed() const;
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
QDateTime mCompleted;
bool mHasCompletedDate;
diff --git a/qtcompat/qinputdialog.cpp b/qtcompat/qinputdialog.cpp
index 64c581e..ce46118 100644
--- a/qtcompat/qinputdialog.cpp
+++ b/qtcompat/qinputdialog.cpp
@@ -295,33 +295,33 @@ QString QInputDialog::getText( const QString &caption, const QString &label, con
/*!
Like above, but accepts an a \a mode which the line edit will use to display text.
\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;
}
/*!
Static convenience function to get an integral input from the user. \a caption is the text
which is displayed in the title bar of the dialog. \a label is the text which
is shown to the user (it should mention to the user what he/she should input), \a num