Diffstat (limited to 'korganizer/koeventpopupmenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeventpopupmenu.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp index 410bceb..b274810 100644 --- a/korganizer/koeventpopupmenu.cpp +++ b/korganizer/koeventpopupmenu.cpp | |||
@@ -1,81 +1,80 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qcursor.h> | 24 | #include <qcursor.h> |
25 | 25 | ||
26 | #include <klocale.h> | 26 | #include <klocale.h> |
27 | #include <kdebug.h> | 27 | #include <kdebug.h> |
28 | #include <kiconloader.h> | 28 | #include <kiconloader.h> |
29 | 29 | ||
30 | #include <libkcal/event.h> | 30 | #include <libkcal/event.h> |
31 | 31 | ||
32 | #include "koeventpopupmenu.h" | 32 | #include "koeventpopupmenu.h" |
33 | #include "koeventpopupmenu.moc" | ||
34 | 33 | ||
35 | KOEventPopupMenu::KOEventPopupMenu() | 34 | KOEventPopupMenu::KOEventPopupMenu() |
36 | { | 35 | { |
37 | mCurrentIncidence = 0; | 36 | mCurrentIncidence = 0; |
38 | mHasAdditionalItems = false; | 37 | mHasAdditionalItems = false; |
39 | 38 | ||
40 | insertItem (i18n("&Show"),this,SLOT(popupShow())); | 39 | insertItem (i18n("&Show"),this,SLOT(popupShow())); |
41 | mEditOnlyItems.append(insertItem (i18n("&Edit..."),this,SLOT(popupEdit()))); | 40 | mEditOnlyItems.append(insertItem (i18n("&Edit..."),this,SLOT(popupEdit()))); |
42 | mEditOnlyItems.append(insertItem (i18n("&Delete"), | 41 | mEditOnlyItems.append(insertItem (i18n("&Delete"), |
43 | this,SLOT(popupDelete()))); | 42 | this,SLOT(popupDelete()))); |
44 | mEditOnlyItems.append(insertItem (i18n("&Clone..."), | 43 | mEditOnlyItems.append(insertItem (i18n("&Clone..."), |
45 | this,SLOT(popupClone()))); | 44 | this,SLOT(popupClone()))); |
46 | mEditOnlyItems.append(insertItem (i18n("&Move..."), | 45 | mEditOnlyItems.append(insertItem (i18n("&Move..."), |
47 | this,SLOT(popupMove()))); | 46 | this,SLOT(popupMove()))); |
48 | #ifndef DESKTOP_VERSION | 47 | #ifndef DESKTOP_VERSION |
49 | mEditOnlyItems.append(insertItem (i18n("&Beam..."), | 48 | mEditOnlyItems.append(insertItem (i18n("&Beam..."), |
50 | this,SLOT(popupBeam()))); | 49 | this,SLOT(popupBeam()))); |
51 | #endif | 50 | #endif |
52 | mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"), | 51 | mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"), |
53 | this,SLOT(popupCancel()))); | 52 | this,SLOT(popupCancel()))); |
54 | } | 53 | } |
55 | 54 | ||
56 | void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) | 55 | void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) |
57 | { | 56 | { |
58 | mCurrentIncidence = incidence; | 57 | mCurrentIncidence = incidence; |
59 | 58 | ||
60 | if (mCurrentIncidence) { | 59 | if (mCurrentIncidence) { |
61 | // Enable/Disabled menu items only valid for editable events. | 60 | // Enable/Disabled menu items only valid for editable events. |
62 | QValueList<int>::Iterator it; | 61 | QValueList<int>::Iterator it; |
63 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { | 62 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { |
64 | setItemEnabled(*it,!mCurrentIncidence->isReadOnly()); | 63 | setItemEnabled(*it,!mCurrentIncidence->isReadOnly()); |
65 | } | 64 | } |
66 | popup(QCursor::pos()); | 65 | popup(QCursor::pos()); |
67 | } else { | 66 | } else { |
68 | kdDebug() << "KOEventPopupMenu::showEventPopup(): No event selected" << endl; | 67 | kdDebug() << "KOEventPopupMenu::showEventPopup(): No event selected" << endl; |
69 | } | 68 | } |
70 | } | 69 | } |
71 | 70 | ||
72 | void KOEventPopupMenu::addAdditionalItem(const QIconSet &icon,const QString &text, | 71 | void KOEventPopupMenu::addAdditionalItem(const QIconSet &icon,const QString &text, |
73 | const QObject *receiver, const char *member, | 72 | const QObject *receiver, const char *member, |
74 | bool editOnly) | 73 | bool editOnly) |
75 | { | 74 | { |
76 | if (!mHasAdditionalItems) { | 75 | if (!mHasAdditionalItems) { |
77 | mHasAdditionalItems = true; | 76 | mHasAdditionalItems = true; |
78 | insertSeparator(); | 77 | insertSeparator(); |
79 | } | 78 | } |
80 | int id = insertItem(icon,text,receiver,member); | 79 | int id = insertItem(icon,text,receiver,member); |
81 | if (editOnly) mEditOnlyItems.append(id); | 80 | if (editOnly) mEditOnlyItems.append(id); |