summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventpopupmenu.cpp
Unidiff
Diffstat (limited to 'korganizer/koeventpopupmenu.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koeventpopupmenu.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp
index 90caaf4..41d331a 100644
--- a/korganizer/koeventpopupmenu.cpp
+++ b/korganizer/koeventpopupmenu.cpp
@@ -59,3 +59,8 @@ KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu()
59 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int ))); 59 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int )));
60 mCalPopup = new QPopupMenu ( this );
61 mCalPopup->setCheckable (true);
62 connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup()));
63 connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int )));
60 mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup )); 64 mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup ));
65 mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup ));
61 QValueList<int>::Iterator it; 66 QValueList<int>::Iterator it;
@@ -76,2 +81,21 @@ void KOEventPopupMenu::enableDefault( bool enable )
76 81
82void KOEventPopupMenu::fillCalPopup() // CAL
83{
84 mCalPopup->clear();
85 if (!mCurrentIncidence) return;
86 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
87 while ( kkf ) {
88 int index = mCalPopup->insertItem( kkf->mName, kkf->mCalNumber);
89 if ( kkf->mErrorOnLoad || kkf->isReadOnly )
90 mCalPopup->setItemEnabled( index, false );
91 mCalPopup->setItemChecked (index, kkf->mCalNumber == mCurrentIncidence->calID());
92 kkf = KOPrefs::instance()->mCalendars.next();
93 }
94}
95void KOEventPopupMenu::computeCalPopup( int index ) // CAL
96{
97 if (!mCurrentIncidence) return;
98 mCurrentIncidence->setCalID( index );
99 emit categoryChanged( mCurrentIncidence );
100}
77void KOEventPopupMenu::fillCatPopup() 101void KOEventPopupMenu::fillCatPopup()
@@ -79,2 +103,3 @@ void KOEventPopupMenu::fillCatPopup()
79 mCatPopup->clear(); 103 mCatPopup->clear();
104 if (!mCurrentIncidence) return;
80 QStringList checkedCategories = mCurrentIncidence->categories(); 105 QStringList checkedCategories = mCurrentIncidence->categories();
@@ -93,2 +118,3 @@ void KOEventPopupMenu::computeCatPopup( int index )
93{ 118{
119 if (!mCurrentIncidence) return;
94 QStringList categories = mCurrentIncidence->categories(); 120 QStringList categories = mCurrentIncidence->categories();
@@ -111,2 +137,3 @@ void KOEventPopupMenu::showIncidencePopup(Incidence *incidence)
111{ 137{
138 if ( !incidence) return;
112 mCurrentIncidence = incidence; 139 mCurrentIncidence = incidence;