-rw-r--r-- | korganizer/kotodoview.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 22486ba..1fb480d 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -979,128 +979,134 @@ void KOTodoView::saveLayout(KConfig *config, const QString &group) const | |||
979 | mTodoListView->saveLayout(config,group); | 979 | mTodoListView->saveLayout(config,group); |
980 | } | 980 | } |
981 | 981 | ||
982 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) | 982 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) |
983 | { | 983 | { |
984 | mTodoListView->restoreLayout(config,group); | 984 | mTodoListView->restoreLayout(config,group); |
985 | } | 985 | } |
986 | 986 | ||
987 | void KOTodoView::processSelectionChange() | 987 | void KOTodoView::processSelectionChange() |
988 | { | 988 | { |
989 | // kdDebug() << "KOTodoView::processSelectionChange()" << endl; | 989 | // kdDebug() << "KOTodoView::processSelectionChange()" << endl; |
990 | 990 | ||
991 | KOTodoViewItem *item = | 991 | KOTodoViewItem *item = |
992 | static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); | 992 | static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); |
993 | 993 | ||
994 | if ( !item ) { | 994 | if ( !item ) { |
995 | emit incidenceSelected( 0 ); | 995 | emit incidenceSelected( 0 ); |
996 | } else { | 996 | } else { |
997 | emit incidenceSelected( item->todo() ); | 997 | emit incidenceSelected( item->todo() ); |
998 | } | 998 | } |
999 | } | 999 | } |
1000 | 1000 | ||
1001 | void KOTodoView::modified(bool b) | 1001 | void KOTodoView::modified(bool b) |
1002 | { | 1002 | { |
1003 | emit isModified(b); | 1003 | emit isModified(b); |
1004 | } | 1004 | } |
1005 | void KOTodoView::setTodoModified( Todo* todo ) | 1005 | void KOTodoView::setTodoModified( Todo* todo ) |
1006 | { | 1006 | { |
1007 | todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); | 1007 | todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); |
1008 | } | 1008 | } |
1009 | void KOTodoView::clearSelection() | 1009 | void KOTodoView::clearSelection() |
1010 | { | 1010 | { |
1011 | mTodoListView->selectAll( false ); | 1011 | mTodoListView->selectAll( false ); |
1012 | } | 1012 | } |
1013 | void KOTodoView::setAllOpen() | 1013 | void KOTodoView::setAllOpen() |
1014 | { | 1014 | { |
1015 | if ( isFlatDisplay ) { | 1015 | if ( isFlatDisplay ) { |
1016 | isFlatDisplay = false; | 1016 | isFlatDisplay = false; |
1017 | mPopupMenu->setItemChecked( 8,false ); | 1017 | mPopupMenu->setItemChecked( 8,false ); |
1018 | updateView(); | 1018 | updateView(); |
1019 | } | 1019 | } |
1020 | setOpen(mTodoListView->firstChild(), true); | 1020 | setOpen(mTodoListView->firstChild(), true); |
1021 | } | 1021 | } |
1022 | void KOTodoView::setAllClose() | 1022 | void KOTodoView::setAllClose() |
1023 | { | 1023 | { |
1024 | if ( isFlatDisplay ) { | 1024 | if ( isFlatDisplay ) { |
1025 | isFlatDisplay = false; | 1025 | isFlatDisplay = false; |
1026 | mPopupMenu->setItemChecked( 8,false ); | 1026 | mPopupMenu->setItemChecked( 8,false ); |
1027 | updateView(); | 1027 | updateView(); |
1028 | } | 1028 | } |
1029 | setOpen(mTodoListView->firstChild(), false); | 1029 | setOpen(mTodoListView->firstChild(), false); |
1030 | } | 1030 | } |
1031 | void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) | 1031 | void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) |
1032 | { | 1032 | { |
1033 | 1033 | ||
1034 | while ( item ) { | 1034 | while ( item ) { |
1035 | setOpen( item->firstChild(), setOpenI ); | 1035 | setOpen( item->firstChild(), setOpenI ); |
1036 | item->setOpen( setOpenI ); | 1036 | item->setOpen( setOpenI ); |
1037 | item = item->nextSibling(); | 1037 | item = item->nextSibling(); |
1038 | } | 1038 | } |
1039 | } | 1039 | } |
1040 | 1040 | ||
1041 | void KOTodoView::setAllFlat() | 1041 | void KOTodoView::setAllFlat() |
1042 | { | 1042 | { |
1043 | if ( isFlatDisplay ) { | ||
1044 | isFlatDisplay = false; | ||
1045 | mPopupMenu->setItemChecked( 8,false ); | ||
1046 | updateView(); | ||
1047 | return; | ||
1048 | } | ||
1043 | pendingSubtodo = 0; | 1049 | pendingSubtodo = 0; |
1044 | if ( mBlockUpdate ) { | 1050 | if ( mBlockUpdate ) { |
1045 | return; | 1051 | return; |
1046 | } | 1052 | } |
1047 | mPopupMenu->setItemChecked( 8,true ); | 1053 | mPopupMenu->setItemChecked( 8,true ); |
1048 | isFlatDisplay = true; | 1054 | isFlatDisplay = true; |
1049 | QPtrList<Todo> todoList = calendar()->todos(); | 1055 | QPtrList<Todo> todoList = calendar()->todos(); |
1050 | mTodoMap.clear(); | 1056 | mTodoMap.clear(); |
1051 | mTodoListView->clear(); | 1057 | mTodoListView->clear(); |
1052 | Todo *todo; | 1058 | Todo *todo; |
1053 | for(todo = todoList.first(); todo; todo = todoList.next()) { | 1059 | for(todo = todoList.first(); todo; todo = todoList.next()) { |
1054 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); | 1060 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); |
1055 | mTodoMap.insert(todo,todoItem); | 1061 | mTodoMap.insert(todo,todoItem); |
1056 | } | 1062 | } |
1057 | mTodoListView->setFocus(); | 1063 | mTodoListView->setFocus(); |
1058 | processSelectionChange(); | 1064 | processSelectionChange(); |
1059 | } | 1065 | } |
1060 | 1066 | ||
1061 | void KOTodoView::purgeCompleted() | 1067 | void KOTodoView::purgeCompleted() |
1062 | { | 1068 | { |
1063 | emit purgeCompletedSignal(); | 1069 | emit purgeCompletedSignal(); |
1064 | } | 1070 | } |
1065 | void KOTodoView::toggleQuickTodo() | 1071 | void KOTodoView::toggleQuickTodo() |
1066 | { | 1072 | { |
1067 | if ( mQuickAdd->isVisible() ) { | 1073 | if ( mQuickAdd->isVisible() ) { |
1068 | mQuickAdd->hide(); | 1074 | mQuickAdd->hide(); |
1069 | KOPrefs::instance()->mEnableQuickTodo = false; | 1075 | KOPrefs::instance()->mEnableQuickTodo = false; |
1070 | } | 1076 | } |
1071 | else { | 1077 | else { |
1072 | mQuickAdd->show(); | 1078 | mQuickAdd->show(); |
1073 | KOPrefs::instance()->mEnableQuickTodo = true; | 1079 | KOPrefs::instance()->mEnableQuickTodo = true; |
1074 | } | 1080 | } |
1075 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); | 1081 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); |
1076 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); | 1082 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); |
1077 | } | 1083 | } |
1078 | 1084 | ||
1079 | void KOTodoView::toggleRunning() | 1085 | void KOTodoView::toggleRunning() |
1080 | { | 1086 | { |
1081 | KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; | 1087 | KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; |
1082 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); | 1088 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); |
1083 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); | 1089 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); |
1084 | updateView(); | 1090 | updateView(); |
1085 | } | 1091 | } |
1086 | 1092 | ||
1087 | void KOTodoView::toggleCompleted() | 1093 | void KOTodoView::toggleCompleted() |
1088 | { | 1094 | { |
1089 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; | 1095 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; |
1090 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); | 1096 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); |
1091 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); | 1097 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); |
1092 | updateView(); | 1098 | updateView(); |
1093 | } | 1099 | } |
1094 | 1100 | ||
1095 | void KOTodoView::addQuickTodo() | 1101 | void KOTodoView::addQuickTodo() |
1096 | { | 1102 | { |
1097 | Todo *todo = new Todo(); | 1103 | Todo *todo = new Todo(); |
1098 | todo->setSummary(mQuickAdd->text()); | 1104 | todo->setSummary(mQuickAdd->text()); |
1099 | todo->setOrganizer(KOPrefs::instance()->email()); | 1105 | todo->setOrganizer(KOPrefs::instance()->email()); |
1100 | CalFilter * cf = mCalendar->filter(); | 1106 | CalFilter * cf = mCalendar->filter(); |
1101 | if ( cf ) { | 1107 | if ( cf ) { |
1102 | if ( cf->isEnabled()&& cf->showCategories()) { | 1108 | if ( cf->isEnabled()&& cf->showCategories()) { |
1103 | todo->setCategories(cf->categoryList()); | 1109 | todo->setCategories(cf->categoryList()); |
1104 | } | 1110 | } |
1105 | if ( cf->isEnabled() ) | 1111 | if ( cf->isEnabled() ) |
1106 | todo->setSecrecy( cf->getSecrecy()); | 1112 | todo->setSecrecy( cf->getSecrecy()); |