summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventpopupmenu.cpp
Side-by-side diff
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
@@ -58,14 +58,16 @@ KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu()
connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup()));
connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int )));
mCalPopup = new QPopupMenu ( this );
mCalPopup->setCheckable (true);
connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup()));
connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int )));
- mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup ));
- mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup ));
+ //mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup ));
+ //mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup ));
+ insertItem (i18n("Categories"),mCatPopup );
+ insertItem (i18n("Calendar"),mCalPopup );
QValueList<int>::Iterator it;
for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) {
mSingleOnlyItems.append(*it);
}
}
@@ -80,16 +82,17 @@ void KOEventPopupMenu::enableDefault( bool enable )
}
void KOEventPopupMenu::fillCalPopup() // CAL
{
mCalPopup->clear();
if (!mCurrentIncidence) return;
+ bool readO = mCurrentIncidence->isReadOnly()|| isDisabled;
KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
while ( kkf ) {
int index = mCalPopup->insertItem( kkf->mName, kkf->mCalNumber);
- if ( kkf->mErrorOnLoad || kkf->isReadOnly )
+ if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO )
mCalPopup->setItemEnabled( index, false );
mCalPopup->setItemChecked (index, kkf->mCalNumber == mCurrentIncidence->calID());
kkf = KOPrefs::instance()->mCalendars.next();
}
}
void KOEventPopupMenu::computeCalPopup( int index ) // CAL
@@ -99,21 +102,24 @@ void KOEventPopupMenu::computeCalPopup( int index ) // CAL
emit categoryChanged( mCurrentIncidence );
}
void KOEventPopupMenu::fillCatPopup()
{
mCatPopup->clear();
if (!mCurrentIncidence) return;
+ bool readO = mCurrentIncidence->isReadOnly() || isDisabled;
QStringList checkedCategories = mCurrentIncidence->categories();
int index = 0;
for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
it != KOPrefs::instance()->mCustomCategories.end ();
++it) {
mCatPopup->insertItem (*it, index );
if (checkedCategories.find (*it) != checkedCategories.end ()) {
mCatPopup->setItemChecked (index, true);
}
+ if ( readO )
+ mCatPopup->setItemEnabled( index, false );
++index;
}
}
void KOEventPopupMenu::computeCatPopup( int index )
{
if (!mCurrentIncidence) return;