summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
authorzautrix <zautrix>2005-07-03 15:58:48 (UTC)
committer zautrix <zautrix>2005-07-03 15:58:48 (UTC)
commit9be5bd1c7e9ee829dd73f5b4a36a2f4331edf68e (patch) (unidiff)
tree4e5e6a4e6eac36df79891d61ed1d1cd76ed6105d /korganizer/kotodoview.cpp
parent0c632bafd2d058504118dc8957fc4808a784f548 (diff)
downloadkdepimpi-9be5bd1c7e9ee829dd73f5b4a36a2f4331edf68e.zip
kdepimpi-9be5bd1c7e9ee829dd73f5b4a36a2f4331edf68e.tar.gz
kdepimpi-9be5bd1c7e9ee829dd73f5b4a36a2f4331edf68e.tar.bz2
fixes
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp53
1 files changed, 41 insertions, 12 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index e2966f8..4f42c83 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -569,5 +569,17 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
569 569
570 mCategoryPopupMenu = new QPopupMenu (this);
571 mCategoryPopupMenu->setCheckable (true);
572 connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int)));
573 connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ()));
574
575 mCalPopupMenu = new QPopupMenu (this);
576 mCalPopupMenu->setCheckable (true);
577 connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int)));
578 connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ()));
579
580
581
570 582
571 mItemPopupMenu = new QPopupMenu(this); 583 mItemPopupMenu = new QPopupMenu(this);
572 mItemPopupMenu->insertItem(i18n("Show..."), this, 584 mItemPopupMenu->insertItem(i18n("Show"), this,
573 SLOT (showTodo())); 585 SLOT (showTodo()));
@@ -587,2 +599,4 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
587 SLOT (cancelTodo())); 599 SLOT (cancelTodo()));
600 mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu);
601 mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu);
588 mItemPopupMenu->insertSeparator(); 602 mItemPopupMenu->insertSeparator();
@@ -1055,3 +1069,5 @@ void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column)
1055 case 8: 1069 case 8:
1056 getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break; 1070 mCategoryPopupMenu->popup(QCursor::pos ()); break;
1071 case 9:
1072 mCalPopupMenu->popup(QCursor::pos ()); break;
1057 default: 1073 default:
@@ -1166,13 +1182,7 @@ void KOTodoView::setNewPercentage(int index)
1166 1182
1167 1183void KOTodoView::fillCategories ()
1168QPopupMenu * KOTodoView::getCategoryPopupMenu (KOTodoViewItem *todoItem)
1169{ 1184{
1170 if ( !mCategoryPopupMenu ) {
1171 mCategoryPopupMenu = new QPopupMenu (this);
1172 mCategoryPopupMenu->setCheckable (true);
1173 connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int)));
1174 }
1175 mCategoryPopupMenu->clear(); 1185 mCategoryPopupMenu->clear();
1176 QStringList checkedCategories = todoItem->todo()->categories (); 1186 if ( ! mActiveItem ) return;
1177 1187 QStringList checkedCategories = mActiveItem->todo()->categories ();
1178 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); 1188 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
@@ -1184,3 +1194,22 @@ QPopupMenu * KOTodoView::getCategoryPopupMenu (KOTodoViewItem *todoItem)
1184 } 1194 }
1185 return mCategoryPopupMenu; 1195}
1196void KOTodoView::fillCal ()
1197{
1198 mCalPopupMenu->clear();
1199 if (!mActiveItem) return;
1200 bool readO = mActiveItem->todo()->isReadOnly();
1201 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
1202 while ( kkf ) {
1203 int index = mCalPopupMenu->insertItem( kkf->mName, kkf->mCalNumber);
1204 if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO )
1205 mCalPopupMenu->setItemEnabled( index, false );
1206 mCalPopupMenu->setItemChecked (index, kkf->mCalNumber == mActiveItem->todo()->calID());
1207 kkf = KOPrefs::instance()->mCalendars.next();
1208 }
1209}
1210void KOTodoView::changedCal (int index )
1211{
1212 if (!mActiveItem) return;
1213 mActiveItem->todo()->setCalID( index );
1214 mActiveItem->construct();
1186} 1215}