author | zautrix <zautrix> | 2005-01-29 17:41:47 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-29 17:41:47 (UTC) |
commit | 078f8bb7d4eca69b799d79ac39d098e1752778a8 (patch) (side-by-side diff) | |
tree | 1cc29a057b3954149a5c007c2de4ba1eedde9ecc /korganizer/kotodoview.cpp | |
parent | 41baa2e15a1ec5e14750297e0a21020c9e53d953 (diff) | |
download | kdepimpi-078f8bb7d4eca69b799d79ac39d098e1752778a8.zip kdepimpi-078f8bb7d4eca69b799d79ac39d098e1752778a8.tar.gz kdepimpi-078f8bb7d4eca69b799d79ac39d098e1752778a8.tar.bz2 |
fixes
-rw-r--r-- | korganizer/kotodoview.cpp | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 30adb06..22486ba 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -430,4 +430,5 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : SLOT (reparentTodo()),0,22); mItemPopupMenu->insertSeparator(); +#if 0 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"), this, SLOT( purgeCompleted() ) ); @@ -439,4 +440,5 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : this, SLOT( toggleRunning() ),0, 35 ); +#endif mPopupMenu = new QPopupMenu(this); mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, @@ -450,6 +452,13 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), this, SLOT( toggleRunning() ),0,5 ); + mPopupMenu->insertItem(i18n(" set all open","Display all opened"), + this, SLOT( setAllOpen() ),0,6 ); + mPopupMenu->insertItem(i18n(" set all close","Display all closed"), + this, SLOT( setAllClose() ),0,7 ); + mPopupMenu->insertItem(i18n(" set all flat","Display all flat"), + this, SLOT( setAllFlat() ),0,8 ); mDocPrefs = new DocPrefs( name ); - + + mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu ); mPopupMenu->setCheckable( true ); mItemPopupMenu->setCheckable( true ); @@ -523,4 +532,8 @@ void KOTodoView::updateView() return; } + if ( isFlatDisplay ) { + setAllFlat(); + return; + } //qDebug("update "); // kdDebug() << "KOTodoView::updateView()" << endl; @@ -998,4 +1011,51 @@ void KOTodoView::clearSelection() mTodoListView->selectAll( false ); } +void KOTodoView::setAllOpen() +{ + if ( isFlatDisplay ) { + isFlatDisplay = false; + mPopupMenu->setItemChecked( 8,false ); + updateView(); + } + setOpen(mTodoListView->firstChild(), true); +} +void KOTodoView::setAllClose() +{ + if ( isFlatDisplay ) { + isFlatDisplay = false; + mPopupMenu->setItemChecked( 8,false ); + updateView(); + } + setOpen(mTodoListView->firstChild(), false); +} +void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) +{ + + while ( item ) { + setOpen( item->firstChild(), setOpenI ); + item->setOpen( setOpenI ); + item = item->nextSibling(); + } +} + +void KOTodoView::setAllFlat() +{ + pendingSubtodo = 0; + if ( mBlockUpdate ) { + return; + } + mPopupMenu->setItemChecked( 8,true ); + isFlatDisplay = true; + QPtrList<Todo> todoList = calendar()->todos(); + mTodoMap.clear(); + mTodoListView->clear(); + Todo *todo; + for(todo = todoList.first(); todo; todo = todoList.next()) { + KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); + mTodoMap.insert(todo,todoItem); + } + mTodoListView->setFocus(); + processSelectionChange(); +} void KOTodoView::purgeCompleted() |