Diffstat (limited to 'korganizer/koeventpopupmenu.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/koeventpopupmenu.cpp | 19 |
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 @@ -38,3 +38,4 @@ KOEventPopupMenu::KOEventPopupMenu() - insertItem (i18n("&Show"),this,SLOT(popupShow())); + + mSingleOnlyItems.append( insertItem (i18n("&Show"),this,SLOT(popupShow()))); mEditOnlyItems.append(insertItem (i18n("&Edit..."),this,SLOT(popupEdit()))); @@ -52,2 +53,16 @@ KOEventPopupMenu::KOEventPopupMenu() 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); + } + } @@ -60,2 +75,3 @@ void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) // Enable/Disabled menu items only valid for editable events. + if ( !isDisabled ) { QValueList<int>::Iterator it; @@ -64,2 +80,3 @@ void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) } + } popup(QCursor::pos()); |