-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 2 | ||||
-rw-r--r-- | korganizer/koeditorgeneraltodo.cpp | 20 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 41 | ||||
-rw-r--r-- | korganizer/kotodoeditor.cpp | 17 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 11 | ||||
-rw-r--r-- | libkcal/incidence.cpp | 28 | ||||
-rw-r--r-- | libkcal/incidence.h | 3 |
7 files changed, 79 insertions, 43 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 2981762..7fa92bf 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1354,3 +1354,3 @@ | |||
1354 | { "times","Zeiten" }, | 1354 | { "times","Zeiten" }, |
1355 | { "","" }, | 1355 | { "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?" }, |
1356 | { "","" }, | 1356 | { "","" }, |
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index 4a1576a..e86b4d0 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp | |||
@@ -41,2 +41,3 @@ | |||
41 | #include <kfiledialog.h> | 41 | #include <kfiledialog.h> |
42 | #include <kdialog.h> | ||
42 | 43 | ||
@@ -90,4 +91,4 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) | |||
90 | timeLayout->addWidget(timeGroupBox); | 91 | timeLayout->addWidget(timeGroupBox); |
91 | timeGroupBox->layout()->setSpacing( 0 ); | 92 | timeGroupBox->layout()->setSpacing( KDialog::spacingHintSmall() ); |
92 | timeGroupBox->layout()->setMargin( 5 ); | 93 | timeGroupBox->layout()->setMargin( KDialog::marginHint() ); |
93 | QFrame *timeBoxFrame = new QFrame(timeGroupBox); | 94 | QFrame *timeBoxFrame = new QFrame(timeGroupBox); |
@@ -95,3 +96,3 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) | |||
95 | QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3); | 96 | QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3); |
96 | layoutTimeBox->setSpacing(topLayout->spacing()); | 97 | layoutTimeBox->setSpacing(KDialog::spacingHintSmall()); |
97 | layoutTimeBox->setColStretch( 1, 1 ); | 98 | layoutTimeBox->setColStretch( 1, 1 ); |
@@ -99,3 +100,3 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) | |||
99 | mDueCheck = new QCheckBox(i18n("Due:"),timeBoxFrame); | 100 | mDueCheck = new QCheckBox(i18n("Due:"),timeBoxFrame); |
100 | layoutTimeBox->addWidget(mDueCheck,0,0); | 101 | layoutTimeBox->addWidget(mDueCheck,1,0); |
101 | connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(enableDueEdit(bool))); | 102 | connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(enableDueEdit(bool))); |
@@ -105,6 +106,6 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) | |||
105 | mDueDateEdit = new KDateEdit(timeBoxFrame); | 106 | mDueDateEdit = new KDateEdit(timeBoxFrame); |
106 | layoutTimeBox->addWidget(mDueDateEdit,0,1); | 107 | layoutTimeBox->addWidget(mDueDateEdit,1,1); |
107 | 108 | ||
108 | mDueTimeEdit = new KOTimeEdit(timeBoxFrame); | 109 | mDueTimeEdit = new KOTimeEdit(timeBoxFrame); |
109 | layoutTimeBox->addWidget(mDueTimeEdit,0,2); | 110 | layoutTimeBox->addWidget(mDueTimeEdit,1,2); |
110 | 111 | ||
@@ -112,3 +113,3 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) | |||
112 | mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); | 113 | mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); |
113 | layoutTimeBox->addWidget(mStartCheck,1,0); | 114 | layoutTimeBox->addWidget(mStartCheck,0,0); |
114 | connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); | 115 | connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); |
@@ -116,6 +117,6 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) | |||
116 | mStartDateEdit = new KDateEdit(timeBoxFrame); | 117 | mStartDateEdit = new KDateEdit(timeBoxFrame); |
117 | layoutTimeBox->addWidget(mStartDateEdit,1,1); | 118 | layoutTimeBox->addWidget(mStartDateEdit,0,1); |
118 | 119 | ||
119 | mStartTimeEdit = new KOTimeEdit(timeBoxFrame); | 120 | mStartTimeEdit = new KOTimeEdit(timeBoxFrame); |
120 | layoutTimeBox->addWidget(mStartTimeEdit,1,2); | 121 | layoutTimeBox->addWidget(mStartTimeEdit,0,2); |
121 | 122 | ||
@@ -343,3 +344,2 @@ void KOEditorGeneralTodo::writeTodo(Todo *todo) | |||
343 | if ( comp.isValid () ) { | 344 | if ( comp.isValid () ) { |
344 | todo->setPercentComplete(0); | ||
345 | todo->setPercentComplete(100); | 345 | todo->setPercentComplete(100); |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index bbf83d9..fd86095 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -373,4 +373,2 @@ void KOListView::setAlarm() | |||
373 | return; | 373 | return; |
374 | |||
375 | |||
376 | QStringList itemList; | 374 | QStringList itemList; |
@@ -430,7 +428,5 @@ void KOListView::setAlarm() | |||
430 | } | 428 | } |
431 | temp = item; | 429 | ListItemVisitor v(item, mStartDate ); |
430 | inc->accept(v); | ||
432 | item = sel.next(); | 431 | item = sel.next(); |
433 | mUidDict.remove( inc->uid() ); | ||
434 | delete temp;; | ||
435 | addIncidence( inc ); | ||
436 | } | 432 | } |
@@ -445,2 +441,3 @@ void KOListView::setCategories( bool removeOld ) | |||
445 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); | 441 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); |
442 | csd->setColorEnabled(); | ||
446 | if (! csd->exec()) { | 443 | if (! csd->exec()) { |
@@ -453,3 +450,3 @@ void KOListView::setCategories( bool removeOld ) | |||
453 | // return; | 450 | // return; |
454 | catList.sort(); | 451 | //catList.sort(); |
455 | QString categoriesStr = catList.join(","); | 452 | QString categoriesStr = catList.join(","); |
@@ -467,3 +464,14 @@ void KOListView::setCategories( bool removeOld ) | |||
467 | item = sel.first(); | 464 | item = sel.first(); |
468 | Incidence* inc; | 465 | if( item ) { |
466 | Incidence* inc = item->data() ; | ||
467 | bool setSub = false; | ||
468 | if( inc->type() == "Todo" && sel.count() == 1 && inc->relations().count() > 0 ) { | ||
469 | int result = KMessageBox::warningYesNoCancel(this, | ||
470 | i18n("The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?").arg( inc->summary().left ( 25 ) ), | ||
471 | i18n("Todo has subtodos"), | ||
472 | i18n("Yes"), | ||
473 | i18n("No")); | ||
474 | if (result == KMessageBox::Cancel) item = 0; | ||
475 | if (result == KMessageBox::Yes) setSub = true; | ||
476 | } | ||
469 | while ( item ) { | 477 | while ( item ) { |
@@ -471,17 +479,10 @@ void KOListView::setCategories( bool removeOld ) | |||
471 | if ( removeOld ) { | 479 | if ( removeOld ) { |
472 | inc->setCategories( categoriesStr ); | 480 | inc->setCategories( catList, setSub ); |
473 | } else { | 481 | } else { |
474 | itemList = QStringList::split (",", inc->categoriesStr() ); | 482 | inc->addCategories( catList, setSub ); |
475 | for( i = 0; i< catList.count(); ++i ) { | ||
476 | if ( !itemList.contains (catList[i])) | ||
477 | itemList.append( catList[i] ); | ||
478 | } | ||
479 | itemList.sort(); | ||
480 | inc->setCategories( itemList.join(",") ); | ||
481 | } | 483 | } |
482 | temp = item; | 484 | ListItemVisitor v(item, mStartDate ); |
485 | inc->accept(v); | ||
483 | item = sel.next(); | 486 | item = sel.next(); |
484 | mUidDict.remove( inc->uid() ); | 487 | } |
485 | delete temp;; | ||
486 | addIncidence( inc ); | ||
487 | } | 488 | } |
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp index 6a05cc8..5513e8b 100644 --- a/korganizer/kotodoeditor.cpp +++ b/korganizer/kotodoeditor.cpp | |||
@@ -112,7 +112,7 @@ void KOTodoEditor::setupGeneral() | |||
112 | if ( QApplication::desktop()->width() < 480 ) { | 112 | if ( QApplication::desktop()->width() < 480 ) { |
113 | topLayout->setMargin(1); | 113 | topLayout->setMargin(marginHintSmall()); |
114 | topLayout->setSpacing(1); | 114 | topLayout->setSpacing(spacingHintSmall()); |
115 | } else { | 115 | } else { |
116 | topLayout->setMargin(marginHint()-1); | 116 | topLayout->setMargin(marginHint()); |
117 | topLayout->setSpacing(spacingHint()-1); | 117 | topLayout->setSpacing(spacingHint()); |
118 | } | 118 | } |
@@ -346,2 +346,6 @@ void KOTodoEditor::writeTodo(Todo *event) | |||
346 | { | 346 | { |
347 | bool maybeComputeRecurrenceTime = false; | ||
348 | if( event->hasRecurrenceID() && event->percentComplete() < 100) | ||
349 | maybeComputeRecurrenceTime = true; | ||
350 | event->setHasRecurrenceID( false ); | ||
347 | mGeneral->writeTodo(event); | 351 | mGeneral->writeTodo(event); |
@@ -356,3 +360,6 @@ void KOTodoEditor::writeTodo(Todo *event) | |||
356 | if ( event->doesRecur() ) { | 360 | if ( event->doesRecur() ) { |
357 | event->setRecurrenceID( event->dtStart().addSecs(-1) ); | 361 | int addSec = -1 ; |
362 | if ( maybeComputeRecurrenceTime && event->percentComplete() == 100 ) | ||
363 | addSec = 1; | ||
364 | event->setRecurrenceID( event->dtStart().addSecs( addSec ) ); | ||
358 | event->setRecurDates(); | 365 | event->setRecurDates(); |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 25be63a..f26d16d 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -467,5 +467,2 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
467 | mItemPopupMenu = new QPopupMenu(this); | 467 | mItemPopupMenu = new QPopupMenu(this); |
468 | mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this, | ||
469 | SLOT (toggleRunningItem())); | ||
470 | mItemPopupMenu->insertSeparator(); | ||
471 | mItemPopupMenu->insertItem(i18n("Show..."), this, | 468 | mItemPopupMenu->insertItem(i18n("Show..."), this, |
@@ -485,2 +482,5 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
485 | mItemPopupMenu->insertSeparator(); | 482 | mItemPopupMenu->insertSeparator(); |
483 | mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this, | ||
484 | SLOT (toggleRunningItem())); | ||
485 | mItemPopupMenu->insertSeparator(); | ||
486 | /* | 486 | /* |
@@ -514,4 +514,2 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
514 | this, SLOT( toggleCompleted() ),0,3 ); | 514 | this, SLOT( toggleCompleted() ),0,3 ); |
515 | mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), | ||
516 | this, SLOT( toggleQuickTodo() ),0,4 ); | ||
517 | mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), | 515 | mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), |
@@ -524,2 +522,5 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
524 | this, SLOT( setAllFlat() ),0,8 ); | 522 | this, SLOT( setAllFlat() ),0,8 ); |
523 | mPopupMenu->insertSeparator(); | ||
524 | mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), | ||
525 | this, SLOT( toggleQuickTodo() ),0,4 ); | ||
525 | mDocPrefs = new DocPrefs( name ); | 526 | mDocPrefs = new DocPrefs( name ); |
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 9c35b1d..762103f 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -347,3 +347,22 @@ void Incidence::checkCategories() | |||
347 | 347 | ||
348 | void Incidence::setCategories(const QStringList &categories) | 348 | void Incidence::addCategories(const QStringList &categories, bool addToRelations ) //addToRelations = false |
349 | { | ||
350 | if (mReadOnly) return; | ||
351 | int i; | ||
352 | for( i = 0; i < categories.count(); ++i ) { | ||
353 | if ( !mCategories.contains (categories[i])) | ||
354 | mCategories.append( categories[i] ); | ||
355 | } | ||
356 | checkCategories(); | ||
357 | updated(); | ||
358 | if ( addToRelations ) { | ||
359 | Incidence * inc; | ||
360 | QPtrList<Incidence> Relations = relations(); | ||
361 | for (inc=Relations.first();inc;inc=Relations.next()) { | ||
362 | inc->addCategories( categories, true ); | ||
363 | } | ||
364 | } | ||
365 | } | ||
366 | |||
367 | void Incidence::setCategories(const QStringList &categories, bool setForRelations ) //setForRelations = false | ||
349 | { | 368 | { |
@@ -353,2 +372,9 @@ void Incidence::setCategories(const QStringList &categories) | |||
353 | updated(); | 372 | updated(); |
373 | if ( setForRelations ) { | ||
374 | Incidence * inc; | ||
375 | QPtrList<Incidence> Relations = relations(); | ||
376 | for (inc=Relations.first();inc;inc=Relations.next()) { | ||
377 | inc->setCategories( categories, true ); | ||
378 | } | ||
379 | } | ||
354 | } | 380 | } |
diff --git a/libkcal/incidence.h b/libkcal/incidence.h index 327e7dd..ebd50d0 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h | |||
@@ -153,3 +153,4 @@ class Incidence : public IncidenceBase | |||
153 | /** set event's applicable categories */ | 153 | /** set event's applicable categories */ |
154 | void setCategories(const QStringList &categories); | 154 | void setCategories(const QStringList &categories, bool setForRelations = false); |
155 | void addCategories(const QStringList &categories, bool addToRelations = false); | ||
155 | /** set event's categories based on a comma delimited string */ | 156 | /** set event's categories based on a comma delimited string */ |