-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 9 | ||||
-rw-r--r-- | korganizer/kotodoeditor.cpp | 1 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 108 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 3 |
4 files changed, 94 insertions, 27 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index a5e2597..cb92677 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -1493,4 +1493,6 @@ { "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, { "You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>.","Sie können <b>mehr als eine</b> Kalenderdatei in KO/Pi darstellen und benutzen. Eine Kalenderdatei wird <b>Resource</b> genannt. Um einen Kalender hinzuzufügen oder die Kalendereinstellungen zu ändern benutzen Sie bitte das Menu: <b>Ansicht -> Resourcenansicht umschalten</b>." }, +{ "Hide Completed","Verstecke erledigte Todos" }, +{ "Show not Running","Zeige nicht Laufende" }, { "","" }, { "","" }, @@ -1500,6 +1502,5 @@ { "","" }, { "","" }, -{ "","" }, -{ "","" }, -{ "","" }, -{ "","" }, + + + diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp index 555c1b1..100a81b 100644 --- a/korganizer/kotodoeditor.cpp +++ b/korganizer/kotodoeditor.cpp @@ -299,4 +299,5 @@ void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay) showPage( 0 ); if ( mRelatedTodo ) { + mGeneral->fillCalCombo(mRelatedTodo->calID() ); mGeneral->setCategories (mRelatedTodo->categoriesStr ()); mGeneral->setSecrecy (mRelatedTodo->secrecy ()); diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index a87e6fc..c23a8ee 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -505,8 +505,42 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mName = QString ( name ); mBlockUpdate = false; - mQuickAdd = new KOQuickTodo(this); - topLayout->addWidget(mQuickAdd); - - if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); + mQuickBar = new QWidget( this ); + topLayout->addWidget(mQuickBar); + + mQuickAdd = new KOQuickTodo(mQuickBar); + QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); + quickLayout->addWidget( mQuickAdd ); + QPushButton * flat = new QPushButton( "F",mQuickBar ); + int fixwid = flat->sizeHint().height(); + if ( QApplication::desktop()->width() > 320 ) + fixwid *= 2; + flat->setFixedWidth( fixwid ); + connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); + QPushButton * allopen = new QPushButton( "O",mQuickBar ); + allopen->setFixedWidth( fixwid ); + connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); + QPushButton * allclose = new QPushButton( "C",mQuickBar ); + allclose->setFixedWidth( fixwid ); + connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); + QPushButton * s_done = new QPushButton( "D",mQuickBar ); + s_done->setFixedWidth( fixwid ); + connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); + QPushButton * s_run = new QPushButton( "R",mQuickBar ); + s_run->setFixedWidth( fixwid ); + connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); + + mNewSubBut = new QPushButton( "sub",mQuickBar ); + mNewSubBut->setFixedWidth( fixwid*3/2 ); + connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); + mNewSubBut->setEnabled( false ); + quickLayout->addWidget( mNewSubBut ); + quickLayout->addWidget( s_done ); + quickLayout->addWidget( s_run ); + + quickLayout->addWidget( allopen ); + quickLayout->addWidget( allclose ); + quickLayout->addWidget( flat ); + + if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide(); mTodoListView = new KOTodoListView(calendar,this, name ); @@ -1083,6 +1117,10 @@ void KOTodoView::newTodo() void KOTodoView::newSubTodo() { + mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); if (mActiveItem) { - emit newSubTodoSignal(mActiveItem->todo()); + if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add a new Todo") ) { + addQuickTodoPar( mActiveItem->todo()); + } else + emit newSubTodoSignal(mActiveItem->todo()); } } @@ -1392,6 +1430,8 @@ void KOTodoView::processSelectionChange() if ( !item ) { emit incidenceSelected( 0 ); + mNewSubBut->setEnabled( false ); } else { emit incidenceSelected( item->todo() ); + mNewSubBut->setEnabled( true ); } } @@ -1481,10 +1521,10 @@ void KOTodoView::purgeCompleted() void KOTodoView::toggleQuickTodo() { - if ( mQuickAdd->isVisible() ) { - mQuickAdd->hide(); + if ( mQuickBar->isVisible() ) { + mQuickBar->hide(); KOPrefs::instance()->mEnableQuickTodo = false; } else { - mQuickAdd->show(); + mQuickBar->show(); KOPrefs::instance()->mEnableQuickTodo = true; } @@ -1499,4 +1539,8 @@ void KOTodoView::toggleRunning() mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); updateView(); + if ( KOPrefs::instance()->mHideNonStartedTodos ) + topLevelWidget()->setCaption(i18n("Hide not Running")); + else + topLevelWidget()->setCaption(i18n("Show not Running")); } @@ -1507,25 +1551,43 @@ void KOTodoView::toggleCompleted() mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); updateView(); + if ( KOPrefs::instance()->mShowCompletedTodo ) + topLevelWidget()->setCaption(i18n("Show Completed")); + else + topLevelWidget()->setCaption(i18n("Hide Completed")); } void KOTodoView::addQuickTodo() { - Todo *todo = new Todo(); - todo->setSummary(mQuickAdd->text()); - todo->setOrganizer(KOPrefs::instance()->email()); - CalFilter * cf = mCalendar->filter(); - if ( cf ) { - if ( cf->isEnabled()&& cf->showCategories()) { - todo->setCategories(cf->categoryList()); - } - if ( cf->isEnabled() ) - todo->setSecrecy( cf->getSecrecy()); - } - mCalendar->addTodo(todo); - mQuickAdd->setText(""); - todoModified (todo, KOGlobals::EVENTADDED ); - updateView(); + addQuickTodoPar( 0 ); } +void KOTodoView::addQuickTodoPar( Todo * parentTodo) +{ + Todo *todo = new Todo(); + todo->setSummary(mQuickAdd->text()); + todo->setOrganizer(KOPrefs::instance()->email()); + if ( parentTodo ) { + todo->setRelatedTo(parentTodo); + + todo->setCategories (parentTodo->categoriesStr ()); + todo->setSecrecy (parentTodo->secrecy ()); + if ( parentTodo->priority() < 3 ) + todo->setPriority( parentTodo->priority() ); + todo->setCalID( parentTodo->calID() ); + } else { + CalFilter * cf = mCalendar->filter(); + if ( cf ) { + if ( cf->isEnabled()&& cf->showCategories()) { + todo->setCategories(cf->categoryList()); + } + if ( cf->isEnabled() ) + todo->setSecrecy( cf->getSecrecy()); + } + } + mCalendar->addTodo(todo); + mQuickAdd->setText(""); + todoModified (todo, KOGlobals::EVENTADDED ); + updateView(); +} void KOTodoView::keyPressEvent ( QKeyEvent * e ) { diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 79cc756..a8e90e2 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -255,4 +255,5 @@ class KOTodoView : public KOrg::BaseView private: + void addQuickTodoPar( Todo * parentTodo); /* * the TodoEditor approach is rather unscaling in the long @@ -290,4 +291,5 @@ class KOTodoView : public KOrg::BaseView QMap<Todo *,KOTodoViewItem *> mTodoMap; QString mName; + QWidget* mQuickBar; DocPrefs *mDocPrefs; @@ -301,4 +303,5 @@ class KOTodoView : public KOrg::BaseView void resetCurrentItem(); Incidence * mCurItem, *mCurItemRootParent, *mCurItemParent,*mCurItemAbove; + QPushButton * mNewSubBut; }; |