summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventpopupmenu.cpp
authorzautrix <zautrix>2005-07-03 08:42:34 (UTC)
committer zautrix <zautrix>2005-07-03 08:42:34 (UTC)
commit971bfd3cf502fbbafc96bef70e21beb545e450b5 (patch) (unidiff)
tree2d4b2d0d291c5a23bb39e3f448403acbe86cc071 /korganizer/koeventpopupmenu.cpp
parent914c795a77d8bb28fc8c2155cfc9524f3effdde1 (diff)
downloadkdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.zip
kdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.tar.gz
kdepimpi-971bfd3cf502fbbafc96bef70e21beb545e450b5.tar.bz2
fixes
Diffstat (limited to 'korganizer/koeventpopupmenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventpopupmenu.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp
index 0b0fe8e..77322e7 100644
--- a/korganizer/koeventpopupmenu.cpp
+++ b/korganizer/koeventpopupmenu.cpp
@@ -61,8 +61,10 @@ KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu()
61 mCalPopup->setCheckable (true); 61 mCalPopup->setCheckable (true);
62 connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup())); 62 connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup()));
63 connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int ))); 63 connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int )));
64 mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup )); 64 //mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup ));
65 mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup )); 65 //mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup ));
66 insertItem (i18n("Categories"),mCatPopup );
67 insertItem (i18n("Calendar"),mCalPopup );
66 QValueList<int>::Iterator it; 68 QValueList<int>::Iterator it;
67 for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { 69 for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) {
68 mSingleOnlyItems.append(*it); 70 mSingleOnlyItems.append(*it);
@@ -83,10 +85,11 @@ void KOEventPopupMenu::fillCalPopup() // CAL
83{ 85{
84 mCalPopup->clear(); 86 mCalPopup->clear();
85 if (!mCurrentIncidence) return; 87 if (!mCurrentIncidence) return;
88 bool readO = mCurrentIncidence->isReadOnly()|| isDisabled;
86 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 89 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
87 while ( kkf ) { 90 while ( kkf ) {
88 int index = mCalPopup->insertItem( kkf->mName, kkf->mCalNumber); 91 int index = mCalPopup->insertItem( kkf->mName, kkf->mCalNumber);
89 if ( kkf->mErrorOnLoad || kkf->isReadOnly ) 92 if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO )
90 mCalPopup->setItemEnabled( index, false ); 93 mCalPopup->setItemEnabled( index, false );
91 mCalPopup->setItemChecked (index, kkf->mCalNumber == mCurrentIncidence->calID()); 94 mCalPopup->setItemChecked (index, kkf->mCalNumber == mCurrentIncidence->calID());
92 kkf = KOPrefs::instance()->mCalendars.next(); 95 kkf = KOPrefs::instance()->mCalendars.next();
@@ -102,6 +105,7 @@ void KOEventPopupMenu::fillCatPopup()
102{ 105{
103 mCatPopup->clear(); 106 mCatPopup->clear();
104 if (!mCurrentIncidence) return; 107 if (!mCurrentIncidence) return;
108 bool readO = mCurrentIncidence->isReadOnly() || isDisabled;
105 QStringList checkedCategories = mCurrentIncidence->categories(); 109 QStringList checkedCategories = mCurrentIncidence->categories();
106 int index = 0; 110 int index = 0;
107 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); 111 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
@@ -111,6 +115,8 @@ void KOEventPopupMenu::fillCatPopup()
111 if (checkedCategories.find (*it) != checkedCategories.end ()) { 115 if (checkedCategories.find (*it) != checkedCategories.end ()) {
112 mCatPopup->setItemChecked (index, true); 116 mCatPopup->setItemChecked (index, true);
113 } 117 }
118 if ( readO )
119 mCatPopup->setItemEnabled( index, false );
114 ++index; 120 ++index;
115 } 121 }
116} 122}