summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventpopupmenu.cpp
authorzautrix <zautrix>2005-06-03 09:53:26 (UTC)
committer zautrix <zautrix>2005-06-03 09:53:26 (UTC)
commitab0f6af57ebf5b5a6fa2f7e6209fe04aafbfb14f (patch) (side-by-side diff)
treefd37448d3cf5d7e5a193a8d4cc8e5421d5e7297a /korganizer/koeventpopupmenu.cpp
parentce9b826d7c0d9249751f8fb7b791c3757aff3c39 (diff)
downloadkdepimpi-ab0f6af57ebf5b5a6fa2f7e6209fe04aafbfb14f.zip
kdepimpi-ab0f6af57ebf5b5a6fa2f7e6209fe04aafbfb14f.tar.gz
kdepimpi-ab0f6af57ebf5b5a6fa2f7e6209fe04aafbfb14f.tar.bz2
popup selection fix
Diffstat (limited to 'korganizer/koeventpopupmenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventpopupmenu.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp
index b274810..17ef81e 100644
--- a/korganizer/koeventpopupmenu.cpp
+++ b/korganizer/koeventpopupmenu.cpp
@@ -36,7 +36,8 @@ KOEventPopupMenu::KOEventPopupMenu()
mCurrentIncidence = 0;
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"),
this,SLOT(popupDelete())));
@@ -50,6 +51,20 @@ KOEventPopupMenu::KOEventPopupMenu()
#endif
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);
+ }
+
}
void KOEventPopupMenu::showIncidencePopup(Incidence *incidence)
@@ -58,10 +73,12 @@ void KOEventPopupMenu::showIncidencePopup(Incidence *incidence)
if (mCurrentIncidence) {
// Enable/Disabled menu items only valid for editable events.
- QValueList<int>::Iterator it;
- for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) {
- setItemEnabled(*it,!mCurrentIncidence->isReadOnly());
- }
+ if ( !isDisabled ) {
+ QValueList<int>::Iterator it;
+ for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) {
+ setItemEnabled(*it,!mCurrentIncidence->isReadOnly());
+ }
+ }
popup(QCursor::pos());
} else {
kdDebug() << "KOEventPopupMenu::showEventPopup(): No event selected" << endl;