author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /korganizer/koeventpopupmenu.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'korganizer/koeventpopupmenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeventpopupmenu.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp index fc4d9a4..81047c1 100644 --- a/korganizer/koeventpopupmenu.cpp +++ b/korganizer/koeventpopupmenu.cpp | |||
@@ -21,8 +21,11 @@ | |||
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 | //Added by qt3to4: | ||
26 | #include <Q3ValueList> | ||
27 | #include <Q3PopupMenu> | ||
25 | 28 | ||
26 | #include <klocale.h> | 29 | #include <klocale.h> |
27 | #include <kdebug.h> | 30 | #include <kdebug.h> |
28 | #include <kiconloader.h> | 31 | #include <kiconloader.h> |
@@ -31,9 +34,9 @@ | |||
31 | 34 | ||
32 | #include "koeventpopupmenu.h" | 35 | #include "koeventpopupmenu.h" |
33 | #include "koprefs.h" | 36 | #include "koprefs.h" |
34 | 37 | ||
35 | KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() | 38 | KOEventPopupMenu::KOEventPopupMenu(): Q3PopupMenu() |
36 | { | 39 | { |
37 | mCurrentIncidence = 0; | 40 | mCurrentIncidence = 0; |
38 | mHasAdditionalItems = false; | 41 | mHasAdditionalItems = false; |
39 | 42 | ||
@@ -52,30 +55,30 @@ KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() | |||
52 | #endif | 55 | #endif |
53 | mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"), | 56 | mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"), |
54 | this,SLOT(popupCancel()))); | 57 | this,SLOT(popupCancel()))); |
55 | isDisabled = false; | 58 | isDisabled = false; |
56 | mCatPopup = new QPopupMenu ( this ); | 59 | mCatPopup = new Q3PopupMenu ( this ); |
57 | mCatPopup->setCheckable (true); | 60 | mCatPopup->setCheckable (true); |
58 | connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup())); | 61 | connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup())); |
59 | connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int ))); | 62 | connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int ))); |
60 | mCalPopup = new QPopupMenu ( this ); | 63 | mCalPopup = new Q3PopupMenu ( this ); |
61 | mCalPopup->setCheckable (true); | 64 | mCalPopup->setCheckable (true); |
62 | connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup())); | 65 | connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup())); |
63 | connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int ))); | 66 | connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int ))); |
64 | //mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup )); | 67 | //mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup )); |
65 | //mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup )); | 68 | //mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup )); |
66 | insertItem (i18n("Categories"),mCatPopup ); | 69 | insertItem (i18n("Categories"),mCatPopup ); |
67 | insertItem (i18n("Calendar"),mCalPopup ); | 70 | insertItem (i18n("Calendar"),mCalPopup ); |
68 | QValueList<int>::Iterator it; | 71 | Q3ValueList<int>::Iterator it; |
69 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { | 72 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { |
70 | mSingleOnlyItems.append(*it); | 73 | mSingleOnlyItems.append(*it); |
71 | } | 74 | } |
72 | 75 | ||
73 | } | 76 | } |
74 | void KOEventPopupMenu::enableDefault( bool enable ) | 77 | void KOEventPopupMenu::enableDefault( bool enable ) |
75 | { | 78 | { |
76 | isDisabled = !enable; | 79 | isDisabled = !enable; |
77 | QValueList<int>::Iterator it; | 80 | Q3ValueList<int>::Iterator it; |
78 | for( it = mSingleOnlyItems.begin(); it != mSingleOnlyItems.end(); ++it ) { | 81 | for( it = mSingleOnlyItems.begin(); it != mSingleOnlyItems.end(); ++it ) { |
79 | setItemEnabled(*it,enable); | 82 | setItemEnabled(*it,enable); |
80 | } | 83 | } |
81 | } | 84 | } |
@@ -145,18 +148,18 @@ void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) | |||
145 | 148 | ||
146 | if (mCurrentIncidence) { | 149 | if (mCurrentIncidence) { |
147 | // Enable/Disabled menu items only valid for editable events. | 150 | // Enable/Disabled menu items only valid for editable events. |
148 | if ( !isDisabled ) { | 151 | if ( !isDisabled ) { |
149 | QValueList<int>::Iterator it; | 152 | Q3ValueList<int>::Iterator it; |
150 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { | 153 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { |
151 | setItemEnabled(*it,!mCurrentIncidence->isReadOnly()); | 154 | setItemEnabled(*it,!mCurrentIncidence->isReadOnly()); |
152 | } | 155 | } |
153 | } | 156 | } |
154 | popup(QCursor::pos()); | 157 | popup(QCursor::pos()); |
155 | } | 158 | } |
156 | } | 159 | } |
157 | 160 | ||
158 | void KOEventPopupMenu::addAdditionalItem(const QIconSet &icon,const QString &text, | 161 | void KOEventPopupMenu::addAdditionalItem(const QIcon &icon,const QString &text, |
159 | const QObject *receiver, const char *member, | 162 | const QObject *receiver, const char *member, |
160 | bool editOnly) | 163 | bool editOnly) |
161 | { | 164 | { |
162 | if (!mHasAdditionalItems) { | 165 | if (!mHasAdditionalItems) { |