Diffstat (limited to 'korganizer/koeventpopupmenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeventpopupmenu.cpp | 27 |
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 | |||
@@ -33,13 +33,14 @@ | |||
33 | 33 | ||
34 | KOEventPopupMenu::KOEventPopupMenu() | 34 | KOEventPopupMenu::KOEventPopupMenu() |
35 | { | 35 | { |
36 | mCurrentIncidence = 0; | 36 | mCurrentIncidence = 0; |
37 | mHasAdditionalItems = false; | 37 | mHasAdditionalItems = false; |
38 | 38 | ||
39 | insertItem (i18n("&Show"),this,SLOT(popupShow())); | 39 | |
40 | mSingleOnlyItems.append( insertItem (i18n("&Show"),this,SLOT(popupShow()))); | ||
40 | mEditOnlyItems.append(insertItem (i18n("&Edit..."),this,SLOT(popupEdit()))); | 41 | mEditOnlyItems.append(insertItem (i18n("&Edit..."),this,SLOT(popupEdit()))); |
41 | mEditOnlyItems.append(insertItem (i18n("&Delete"), | 42 | mEditOnlyItems.append(insertItem (i18n("&Delete"), |
42 | this,SLOT(popupDelete()))); | 43 | this,SLOT(popupDelete()))); |
43 | mEditOnlyItems.append(insertItem (i18n("&Clone..."), | 44 | mEditOnlyItems.append(insertItem (i18n("&Clone..."), |
44 | this,SLOT(popupClone()))); | 45 | this,SLOT(popupClone()))); |
45 | mEditOnlyItems.append(insertItem (i18n("&Move..."), | 46 | mEditOnlyItems.append(insertItem (i18n("&Move..."), |
@@ -47,24 +48,40 @@ KOEventPopupMenu::KOEventPopupMenu() | |||
47 | #ifndef DESKTOP_VERSION | 48 | #ifndef DESKTOP_VERSION |
48 | mEditOnlyItems.append(insertItem (i18n("&Beam..."), | 49 | mEditOnlyItems.append(insertItem (i18n("&Beam..."), |
49 | this,SLOT(popupBeam()))); | 50 | this,SLOT(popupBeam()))); |
50 | #endif | 51 | #endif |
51 | mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"), | 52 | mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"), |
52 | this,SLOT(popupCancel()))); | 53 | this,SLOT(popupCancel()))); |
54 | isDisabled = false; | ||
55 | QValueList<int>::Iterator it; | ||
56 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { | ||
57 | mSingleOnlyItems.append(*it); | ||
58 | } | ||
59 | } | ||
60 | void KOEventPopupMenu::enableDefault( bool enable ) | ||
61 | { | ||
62 | isDisabled = !enable; | ||
63 | QValueList<int>::Iterator it; | ||
64 | for( it = mSingleOnlyItems.begin(); it != mSingleOnlyItems.end(); ++it ) { | ||
65 | setItemEnabled(*it,enable); | ||
66 | } | ||
67 | |||
53 | } | 68 | } |
54 | 69 | ||
55 | void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) | 70 | void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) |
56 | { | 71 | { |
57 | mCurrentIncidence = incidence; | 72 | mCurrentIncidence = incidence; |
58 | 73 | ||
59 | if (mCurrentIncidence) { | 74 | if (mCurrentIncidence) { |
60 | // Enable/Disabled menu items only valid for editable events. | 75 | // Enable/Disabled menu items only valid for editable events. |
61 | QValueList<int>::Iterator it; | 76 | if ( !isDisabled ) { |
62 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { | 77 | QValueList<int>::Iterator it; |
63 | setItemEnabled(*it,!mCurrentIncidence->isReadOnly()); | 78 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { |
64 | } | 79 | setItemEnabled(*it,!mCurrentIncidence->isReadOnly()); |
80 | } | ||
81 | } | ||
65 | popup(QCursor::pos()); | 82 | popup(QCursor::pos()); |
66 | } else { | 83 | } else { |
67 | kdDebug() << "KOEventPopupMenu::showEventPopup(): No event selected" << endl; | 84 | kdDebug() << "KOEventPopupMenu::showEventPopup(): No event selected" << endl; |
68 | } | 85 | } |
69 | } | 86 | } |
70 | 87 | ||