summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventpopupmenu.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koeventpopupmenu.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koeventpopupmenu.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp
index b274810..17ef81e 100644
--- a/korganizer/koeventpopupmenu.cpp
+++ b/korganizer/koeventpopupmenu.cpp
@@ -37,5 +37,6 @@ KOEventPopupMenu::KOEventPopupMenu()
mHasAdditionalItems = false;
- insertItem (i18n("&Show"),this,SLOT(popupShow()));
+
+ mSingleOnlyItems.append( insertItem (i18n("&Show"),this,SLOT(popupShow())));
mEditOnlyItems.append(insertItem (i18n("&Edit..."),this,SLOT(popupEdit())));
mEditOnlyItems.append(insertItem (i18n("&Delete"),
@@ -51,4 +52,18 @@ KOEventPopupMenu::KOEventPopupMenu()
mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"),
this,SLOT(popupCancel())));
+ isDisabled = false;
+ QValueList<int>::Iterator it;
+ for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) {
+ mSingleOnlyItems.append(*it);
+ }
+}
+void KOEventPopupMenu::enableDefault( bool enable )
+{
+ isDisabled = !enable;
+ QValueList<int>::Iterator it;
+ for( it = mSingleOnlyItems.begin(); it != mSingleOnlyItems.end(); ++it ) {
+ setItemEnabled(*it,enable);
+ }
+
}
@@ -59,8 +74,10 @@ void KOEventPopupMenu::showIncidencePopup(Incidence *incidence)
if (mCurrentIncidence) {
// Enable/Disabled menu items only valid for editable events.
+ if ( !isDisabled ) {
QValueList<int>::Iterator it;
for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) {
setItemEnabled(*it,!mCurrentIncidence->isReadOnly());
}
+ }
popup(QCursor::pos());
} else {