-rw-r--r-- | korganizer/kotodoview.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 86e1bd9..a87e6fc 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -1133,72 +1133,75 @@ void KOTodoView::beamTodo() | |||
1133 | 1133 | ||
1134 | 1134 | ||
1135 | void KOTodoView::showTodo() | 1135 | void KOTodoView::showTodo() |
1136 | { | 1136 | { |
1137 | if (mActiveItem) { | 1137 | if (mActiveItem) { |
1138 | emit showTodoSignal(mActiveItem->todo()); | 1138 | emit showTodoSignal(mActiveItem->todo()); |
1139 | } | 1139 | } |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | void KOTodoView::deleteTodo() | 1142 | void KOTodoView::deleteTodo() |
1143 | { | 1143 | { |
1144 | if (mActiveItem) { | 1144 | if (mActiveItem) { |
1145 | emit deleteTodoSignal(mActiveItem->todo()); | 1145 | emit deleteTodoSignal(mActiveItem->todo()); |
1146 | } | 1146 | } |
1147 | } | 1147 | } |
1148 | 1148 | ||
1149 | void KOTodoView::setNewPriority(int index) | 1149 | void KOTodoView::setNewPriority(int index) |
1150 | { | 1150 | { |
1151 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { | 1151 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { |
1152 | mActiveItem->todo()->setPriority(mPriority[index]); | 1152 | mActiveItem->todo()->setPriority(mPriority[index]); |
1153 | mActiveItem->construct(); | 1153 | mActiveItem->construct(); |
1154 | todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); | 1154 | todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); |
1155 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); | 1155 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); |
1156 | } | 1156 | } |
1157 | processSelectionChange(); | ||
1157 | } | 1158 | } |
1158 | 1159 | ||
1159 | void KOTodoView::setNewPercentage(int index) | 1160 | void KOTodoView::setNewPercentage(int index) |
1160 | { | 1161 | { |
1161 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { | 1162 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { |
1162 | 1163 | ||
1163 | if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) { | 1164 | if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) { |
1164 | mActiveItem->setOn( true ); | 1165 | mActiveItem->setOn( true ); |
1166 | processSelectionChange(); | ||
1165 | return; | 1167 | return; |
1166 | } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) { | 1168 | } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) { |
1167 | KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent())); | 1169 | KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent())); |
1168 | if ( par && par->isOn() ) | 1170 | if ( par && par->isOn() ) |
1169 | par->setOn( false ); | 1171 | par->setOn( false ); |
1170 | } | 1172 | } |
1171 | if (mPercentage[index] == 100) { | 1173 | if (mPercentage[index] == 100) { |
1172 | mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); | 1174 | mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); |
1173 | } else { | 1175 | } else { |
1174 | mActiveItem->todo()->setCompleted(false); | 1176 | mActiveItem->todo()->setCompleted(false); |
1175 | } | 1177 | } |
1176 | mActiveItem->todo()->setPercentComplete(mPercentage[index]); | 1178 | mActiveItem->todo()->setPercentComplete(mPercentage[index]); |
1177 | mActiveItem->construct(); | 1179 | mActiveItem->construct(); |
1178 | todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED); | 1180 | todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED); |
1179 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); | 1181 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); |
1180 | } | 1182 | } |
1183 | processSelectionChange(); | ||
1181 | } | 1184 | } |
1182 | 1185 | ||
1183 | void KOTodoView::fillCategories () | 1186 | void KOTodoView::fillCategories () |
1184 | { | 1187 | { |
1185 | mCategoryPopupMenu->clear(); | 1188 | mCategoryPopupMenu->clear(); |
1186 | if ( ! mActiveItem ) return; | 1189 | if ( ! mActiveItem ) return; |
1187 | QStringList checkedCategories = mActiveItem->todo()->categories (); | 1190 | QStringList checkedCategories = mActiveItem->todo()->categories (); |
1188 | for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); | 1191 | for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); |
1189 | it != KOPrefs::instance()->mCustomCategories.end (); | 1192 | it != KOPrefs::instance()->mCustomCategories.end (); |
1190 | ++it) { | 1193 | ++it) { |
1191 | int index = mCategoryPopupMenu->insertItem (*it); | 1194 | int index = mCategoryPopupMenu->insertItem (*it); |
1192 | mCategory[index] = *it; | 1195 | mCategory[index] = *it; |
1193 | if (checkedCategories.find (*it) != checkedCategories.end ()) mCategoryPopupMenu->setItemChecked (index, true); | 1196 | if (checkedCategories.find (*it) != checkedCategories.end ()) mCategoryPopupMenu->setItemChecked (index, true); |
1194 | } | 1197 | } |
1195 | } | 1198 | } |
1196 | void KOTodoView::fillCal () | 1199 | void KOTodoView::fillCal () |
1197 | { | 1200 | { |
1198 | mCalPopupMenu->clear(); | 1201 | mCalPopupMenu->clear(); |
1199 | if (!mActiveItem) return; | 1202 | if (!mActiveItem) return; |
1200 | bool readO = mActiveItem->todo()->isReadOnly(); | 1203 | bool readO = mActiveItem->todo()->isReadOnly(); |
1201 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 1204 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
1202 | while ( kkf ) { | 1205 | while ( kkf ) { |
1203 | int index = mCalPopupMenu->insertItem( kkf->mName, kkf->mCalNumber); | 1206 | int index = mCalPopupMenu->insertItem( kkf->mName, kkf->mCalNumber); |
1204 | if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO ) | 1207 | if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO ) |