-rw-r--r-- | korganizer/kotodoview.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 5d7b066..97b4a03 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -1033,97 +1033,101 @@ void KOTodoView::toggleCompleted() | |||
1033 | { | 1033 | { |
1034 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; | 1034 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; |
1035 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); | 1035 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); |
1036 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); | 1036 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); |
1037 | updateView(); | 1037 | updateView(); |
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | void KOTodoView::addQuickTodo() | 1040 | void KOTodoView::addQuickTodo() |
1041 | { | 1041 | { |
1042 | Todo *todo = new Todo(); | 1042 | Todo *todo = new Todo(); |
1043 | todo->setSummary(mQuickAdd->text()); | 1043 | todo->setSummary(mQuickAdd->text()); |
1044 | todo->setOrganizer(KOPrefs::instance()->email()); | 1044 | todo->setOrganizer(KOPrefs::instance()->email()); |
1045 | CalFilter * cf = mCalendar->filter(); | 1045 | CalFilter * cf = mCalendar->filter(); |
1046 | if ( cf ) { | 1046 | if ( cf ) { |
1047 | if ( cf->isEnabled()&& cf->showCategories()) { | 1047 | if ( cf->isEnabled()&& cf->showCategories()) { |
1048 | todo->setCategories(cf->categoryList()); | 1048 | todo->setCategories(cf->categoryList()); |
1049 | } | 1049 | } |
1050 | if ( cf->isEnabled() ) | 1050 | if ( cf->isEnabled() ) |
1051 | todo->setSecrecy( cf->getSecrecy()); | 1051 | todo->setSecrecy( cf->getSecrecy()); |
1052 | } | 1052 | } |
1053 | mCalendar->addTodo(todo); | 1053 | mCalendar->addTodo(todo); |
1054 | mQuickAdd->setText(""); | 1054 | mQuickAdd->setText(""); |
1055 | todoModified (todo, KOGlobals::EVENTADDED ); | 1055 | todoModified (todo, KOGlobals::EVENTADDED ); |
1056 | updateView(); | 1056 | updateView(); |
1057 | } | 1057 | } |
1058 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) | 1058 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) |
1059 | { | 1059 | { |
1060 | // e->ignore(); | 1060 | // e->ignore(); |
1061 | //return; | 1061 | //return; |
1062 | //qDebug("KOTodoView::keyPressEvent "); | 1062 | //qDebug("KOTodoView::keyPressEvent "); |
1063 | switch ( e->key() ) { | 1063 | switch ( e->key() ) { |
1064 | case Qt::Key_Down: | 1064 | case Qt::Key_Down: |
1065 | case Qt::Key_Up: | 1065 | case Qt::Key_Up: |
1066 | QWidget::keyPressEvent ( e ); | 1066 | QWidget::keyPressEvent ( e ); |
1067 | break; | 1067 | break; |
1068 | 1068 | ||
1069 | case Qt::Key_Q: | 1069 | case Qt::Key_Q: |
1070 | toggleQuickTodo(); | 1070 | toggleQuickTodo(); |
1071 | break; | 1071 | break; |
1072 | case Qt::Key_U: | 1072 | case Qt::Key_U: |
1073 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1073 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { |
1074 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1074 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1075 | unparentTodo(); | 1075 | unparentTodo(); |
1076 | e->accept(); | 1076 | e->accept(); |
1077 | } else | 1077 | } else |
1078 | e->ignore(); | 1078 | e->ignore(); |
1079 | break; | 1079 | break; |
1080 | case Qt::Key_S: | 1080 | case Qt::Key_S: |
1081 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1081 | if ( e->state() == Qt::ControlButton ) { |
1082 | e->ignore(); | ||
1083 | break; | ||
1084 | } | ||
1085 | if ( e->state() == Qt::ShiftButton ) { | ||
1082 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1086 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1083 | reparentTodo(); | 1087 | reparentTodo(); |
1084 | e->accept(); | 1088 | e->accept(); |
1085 | } else | 1089 | } else |
1086 | e->ignore(); | 1090 | e->ignore(); |
1087 | break; | 1091 | break; |
1088 | case Qt::Key_P: | 1092 | case Qt::Key_P: |
1089 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1093 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { |
1090 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1094 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1091 | if ( pendingSubtodo ) | 1095 | if ( pendingSubtodo ) |
1092 | itemClicked(mActiveItem); | 1096 | itemClicked(mActiveItem); |
1093 | e->accept(); | 1097 | e->accept(); |
1094 | } else | 1098 | } else |
1095 | e->ignore(); | 1099 | e->ignore(); |
1096 | break; | 1100 | break; |
1097 | case Qt::Key_Escape: | 1101 | case Qt::Key_Escape: |
1098 | if ( pendingSubtodo ) { | 1102 | if ( pendingSubtodo ) { |
1099 | itemClicked(0); | 1103 | itemClicked(0); |
1100 | e->accept(); | 1104 | e->accept(); |
1101 | } else | 1105 | } else |
1102 | e->ignore(); | 1106 | e->ignore(); |
1103 | break; | 1107 | break; |
1104 | default: | 1108 | default: |
1105 | e->ignore(); | 1109 | e->ignore(); |
1106 | } | 1110 | } |
1107 | 1111 | ||
1108 | if ( true ) { | 1112 | if ( true ) { |
1109 | if ( e->key() == Qt::Key_I ) { | 1113 | if ( e->key() == Qt::Key_I ) { |
1110 | KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); | 1114 | KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); |
1111 | if ( cn ) { | 1115 | if ( cn ) { |
1112 | mActiveItem = cn; | 1116 | mActiveItem = cn; |
1113 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); | 1117 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); |
1114 | if ( ci ){ | 1118 | if ( ci ){ |
1115 | showTodo(); | 1119 | showTodo(); |
1116 | cn = (KOTodoViewItem*)cn->itemBelow(); | 1120 | cn = (KOTodoViewItem*)cn->itemBelow(); |
1117 | if ( cn ) { | 1121 | if ( cn ) { |
1118 | mTodoListView->setCurrentItem ( cn ); | 1122 | mTodoListView->setCurrentItem ( cn ); |
1119 | mTodoListView->ensureItemVisible ( cn ); | 1123 | mTodoListView->ensureItemVisible ( cn ); |
1120 | } | 1124 | } |
1121 | 1125 | ||
1122 | } | 1126 | } |
1123 | } | 1127 | } |
1124 | e->accept(); | 1128 | e->accept(); |
1125 | 1129 | ||
1126 | } | 1130 | } |
1127 | 1131 | ||
1128 | } | 1132 | } |
1129 | 1133 | ||