author | zautrix <zautrix> | 2005-07-02 18:24:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-02 18:24:42 (UTC) |
commit | 80fe6533cb7d751aa72ae5ad0871a9fb76fb3d0b (patch) (unidiff) | |
tree | 51da32a82f3a9b6feb7e8a4f89df96b1be6e8d08 /korganizer | |
parent | 8eea5713638412f5613be51b339f0452f629705c (diff) | |
download | kdepimpi-80fe6533cb7d751aa72ae5ad0871a9fb76fb3d0b.zip kdepimpi-80fe6533cb7d751aa72ae5ad0871a9fb76fb3d0b.tar.gz kdepimpi-80fe6533cb7d751aa72ae5ad0871a9fb76fb3d0b.tar.bz2 |
fax
-rw-r--r-- | korganizer/koeventpopupmenu.cpp | 173 | ||||
-rw-r--r-- | korganizer/koeventpopupmenu.h | 3 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 20 | ||||
-rw-r--r-- | korganizer/searchdialog.cpp | 4 |
4 files changed, 121 insertions, 79 deletions
diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp index 90caaf4..41d331a 100644 --- a/korganizer/koeventpopupmenu.cpp +++ b/korganizer/koeventpopupmenu.cpp | |||
@@ -1,22 +1,22 @@ | |||
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 | */ |
@@ -36,30 +36,35 @@ KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() | |||
36 | { | 36 | { |
37 | mCurrentIncidence = 0; | 37 | mCurrentIncidence = 0; |
38 | mHasAdditionalItems = false; | 38 | mHasAdditionalItems = false; |
39 | 39 | ||
40 | 40 | ||
41 | mSingleOnlyItems.append( insertItem (i18n("&Show"),this,SLOT(popupShow()))); | 41 | mSingleOnlyItems.append( insertItem (i18n("&Show"),this,SLOT(popupShow()))); |
42 | mEditOnlyItems.append(insertItem (i18n("&Edit..."),this,SLOT(popupEdit()))); | 42 | mEditOnlyItems.append(insertItem (i18n("&Edit..."),this,SLOT(popupEdit()))); |
43 | mEditOnlyItems.append(insertItem (i18n("&Delete"), | 43 | mEditOnlyItems.append(insertItem (i18n("&Delete"), |
44 | this,SLOT(popupDelete()))); | 44 | this,SLOT(popupDelete()))); |
45 | mEditOnlyItems.append(insertItem (i18n("&Clone..."), | 45 | mEditOnlyItems.append(insertItem (i18n("&Clone..."), |
46 | this,SLOT(popupClone()))); | 46 | this,SLOT(popupClone()))); |
47 | mEditOnlyItems.append(insertItem (i18n("&Move..."), | 47 | mEditOnlyItems.append(insertItem (i18n("&Move..."), |
48 | this,SLOT(popupMove()))); | 48 | this,SLOT(popupMove()))); |
49 | #ifndef DESKTOP_VERSION | 49 | #ifndef DESKTOP_VERSION |
50 | mEditOnlyItems.append(insertItem (i18n("&Beam..."), | 50 | mEditOnlyItems.append(insertItem (i18n("&Beam..."), |
51 | this,SLOT(popupBeam()))); | 51 | this,SLOT(popupBeam()))); |
52 | #endif | 52 | #endif |
53 | mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"), | 53 | mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"), |
54 | this,SLOT(popupCancel()))); | 54 | this,SLOT(popupCancel()))); |
55 | isDisabled = false; | 55 | isDisabled = false; |
56 | mCatPopup = new QPopupMenu ( this ); | 56 | mCatPopup = new QPopupMenu ( this ); |
57 | mCatPopup->setCheckable (true); | 57 | mCatPopup->setCheckable (true); |
58 | connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup())); | 58 | connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup())); |
59 | connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int ))); | 59 | connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int ))); |
60 | mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup )); | 60 | mCalPopup = new QPopupMenu ( this ); |
61 | QValueList<int>::Iterator it; | 61 | mCalPopup->setCheckable (true); |
62 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { | 62 | connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup())); |
63 | mSingleOnlyItems.append(*it); | 63 | connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int ))); |
64 | } | 64 | mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup )); |
65 | mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup )); | ||
66 | QValueList<int>::Iterator it; | ||
67 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { | ||
68 | mSingleOnlyItems.append(*it); | ||
69 | } | ||
65 | 70 | ||
@@ -76,2 +81,21 @@ void KOEventPopupMenu::enableDefault( bool enable ) | |||
76 | 81 | ||
82 | void KOEventPopupMenu::fillCalPopup() // CAL | ||
83 | { | ||
84 | mCalPopup->clear(); | ||
85 | if (!mCurrentIncidence) return; | ||
86 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | ||
87 | while ( kkf ) { | ||
88 | int index = mCalPopup->insertItem( kkf->mName, kkf->mCalNumber); | ||
89 | if ( kkf->mErrorOnLoad || kkf->isReadOnly ) | ||
90 | mCalPopup->setItemEnabled( index, false ); | ||
91 | mCalPopup->setItemChecked (index, kkf->mCalNumber == mCurrentIncidence->calID()); | ||
92 | kkf = KOPrefs::instance()->mCalendars.next(); | ||
93 | } | ||
94 | } | ||
95 | void KOEventPopupMenu::computeCalPopup( int index ) // CAL | ||
96 | { | ||
97 | if (!mCurrentIncidence) return; | ||
98 | mCurrentIncidence->setCalID( index ); | ||
99 | emit categoryChanged( mCurrentIncidence ); | ||
100 | } | ||
77 | void KOEventPopupMenu::fillCatPopup() | 101 | void KOEventPopupMenu::fillCatPopup() |
@@ -79,2 +103,3 @@ void KOEventPopupMenu::fillCatPopup() | |||
79 | mCatPopup->clear(); | 103 | mCatPopup->clear(); |
104 | if (!mCurrentIncidence) return; | ||
80 | QStringList checkedCategories = mCurrentIncidence->categories(); | 105 | QStringList checkedCategories = mCurrentIncidence->categories(); |
@@ -92,3 +117,4 @@ void KOEventPopupMenu::fillCatPopup() | |||
92 | void KOEventPopupMenu::computeCatPopup( int index ) | 117 | void KOEventPopupMenu::computeCatPopup( int index ) |
93 | { | 118 | { |
119 | if (!mCurrentIncidence) return; | ||
94 | QStringList categories = mCurrentIncidence->categories(); | 120 | QStringList categories = mCurrentIncidence->categories(); |
@@ -96,3 +122,3 @@ void KOEventPopupMenu::computeCatPopup( int index ) | |||
96 | if (categories.find (KOPrefs::instance()->mCustomCategories[index]) != categories.end ()) | 122 | if (categories.find (KOPrefs::instance()->mCustomCategories[index]) != categories.end ()) |
97 | categories.remove (KOPrefs::instance()->mCustomCategories[index]); | 123 | categories.remove (KOPrefs::instance()->mCustomCategories[index]); |
98 | else | 124 | else |
@@ -106,3 +132,3 @@ void KOEventPopupMenu::computeCatPopup( int index ) | |||
106 | } | 132 | } |
107 | mCurrentIncidence->setCategories( categories ); | 133 | mCurrentIncidence->setCategories( categories ); |
108 | emit categoryChanged( mCurrentIncidence ); | 134 | emit categoryChanged( mCurrentIncidence ); |
@@ -111,14 +137,15 @@ void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) | |||
111 | { | 137 | { |
112 | mCurrentIncidence = incidence; | 138 | if ( !incidence) return; |
139 | mCurrentIncidence = incidence; | ||
113 | 140 | ||
114 | if (mCurrentIncidence) { | 141 | if (mCurrentIncidence) { |
115 | // Enable/Disabled menu items only valid for editable events. | 142 | // Enable/Disabled menu items only valid for editable events. |
116 | if ( !isDisabled ) { | 143 | if ( !isDisabled ) { |
117 | QValueList<int>::Iterator it; | 144 | QValueList<int>::Iterator it; |
118 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { | 145 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { |
119 | setItemEnabled(*it,!mCurrentIncidence->isReadOnly()); | 146 | setItemEnabled(*it,!mCurrentIncidence->isReadOnly()); |
120 | } | 147 | } |
121 | } | 148 | } |
122 | popup(QCursor::pos()); | 149 | popup(QCursor::pos()); |
123 | } | 150 | } |
124 | } | 151 | } |
@@ -126,11 +153,11 @@ void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) | |||
126 | void KOEventPopupMenu::addAdditionalItem(const QIconSet &icon,const QString &text, | 153 | void KOEventPopupMenu::addAdditionalItem(const QIconSet &icon,const QString &text, |
127 | const QObject *receiver, const char *member, | 154 | const QObject *receiver, const char *member, |
128 | bool editOnly) | 155 | bool editOnly) |
129 | { | 156 | { |
130 | if (!mHasAdditionalItems) { | 157 | if (!mHasAdditionalItems) { |
131 | mHasAdditionalItems = true; | 158 | mHasAdditionalItems = true; |
132 | insertSeparator(); | 159 | insertSeparator(); |
133 | } | 160 | } |
134 | int id = insertItem(icon,text,receiver,member); | 161 | int id = insertItem(icon,text,receiver,member); |
135 | if (editOnly) mEditOnlyItems.append(id); | 162 | if (editOnly) mEditOnlyItems.append(id); |
136 | } | 163 | } |
@@ -139,3 +166,3 @@ void KOEventPopupMenu::popupShow() | |||
139 | { | 166 | { |
140 | if (mCurrentIncidence) emit showIncidenceSignal(mCurrentIncidence); | 167 | if (mCurrentIncidence) emit showIncidenceSignal(mCurrentIncidence); |
141 | } | 168 | } |
@@ -144,3 +171,3 @@ void KOEventPopupMenu::popupEdit() | |||
144 | { | 171 | { |
145 | if (mCurrentIncidence) emit editIncidenceSignal(mCurrentIncidence); | 172 | if (mCurrentIncidence) emit editIncidenceSignal(mCurrentIncidence); |
146 | } | 173 | } |
@@ -149,3 +176,3 @@ void KOEventPopupMenu::popupDelete() | |||
149 | { | 176 | { |
150 | if (mCurrentIncidence) emit deleteIncidenceSignal(mCurrentIncidence); | 177 | if (mCurrentIncidence) emit deleteIncidenceSignal(mCurrentIncidence); |
151 | } | 178 | } |
@@ -153,3 +180,3 @@ void KOEventPopupMenu::popupClone() | |||
153 | { | 180 | { |
154 | if (mCurrentIncidence) emit cloneIncidenceSignal(mCurrentIncidence); | 181 | if (mCurrentIncidence) emit cloneIncidenceSignal(mCurrentIncidence); |
155 | } | 182 | } |
@@ -157,3 +184,3 @@ void KOEventPopupMenu::popupCancel() | |||
157 | { | 184 | { |
158 | if (mCurrentIncidence) emit cancelIncidenceSignal(mCurrentIncidence); | 185 | if (mCurrentIncidence) emit cancelIncidenceSignal(mCurrentIncidence); |
159 | } | 186 | } |
@@ -161,3 +188,3 @@ void KOEventPopupMenu::popupMove() | |||
161 | { | 188 | { |
162 | if (mCurrentIncidence) emit moveIncidenceSignal(mCurrentIncidence); | 189 | if (mCurrentIncidence) emit moveIncidenceSignal(mCurrentIncidence); |
163 | } | 190 | } |
@@ -166,3 +193,3 @@ void KOEventPopupMenu::popupBeam() | |||
166 | { | 193 | { |
167 | if (mCurrentIncidence) emit beamIncidenceSignal(mCurrentIncidence); | 194 | if (mCurrentIncidence) emit beamIncidenceSignal(mCurrentIncidence); |
168 | } | 195 | } |
diff --git a/korganizer/koeventpopupmenu.h b/korganizer/koeventpopupmenu.h index 3d8b595..e28745b 100644 --- a/korganizer/koeventpopupmenu.h +++ b/korganizer/koeventpopupmenu.h | |||
@@ -58,2 +58,4 @@ class KOEventPopupMenu : public QPopupMenu { | |||
58 | void computeCatPopup( int ); | 58 | void computeCatPopup( int ); |
59 | void fillCalPopup(); | ||
60 | void computeCalPopup( int ); | ||
59 | 61 | ||
@@ -77,2 +79,3 @@ class KOEventPopupMenu : public QPopupMenu { | |||
77 | QPopupMenu *mCatPopup; | 79 | QPopupMenu *mCatPopup; |
80 | QPopupMenu *mCalPopup; | ||
78 | }; | 81 | }; |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index db3f802..cdcbbf0 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -306,4 +306,5 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
306 | 306 | ||
307 | mPopupMenu->insertSeparator(); | 307 | selPopup->insertSeparator(); |
308 | #ifdef DESKTOP_VERSION | 308 | #ifdef DESKTOP_VERSION |
309 | mPopupMenu->insertSeparator(); | ||
309 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 310 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
@@ -311,7 +312,11 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
311 | SLOT(printList()),true); | 312 | SLOT(printList()),true); |
312 | mPopupMenu->insertSeparator(); | ||
313 | #endif | 313 | #endif |
314 | mCalPopup = new QPopupMenu ( this ); | 314 | mCalPopup = new QPopupMenu ( this ); |
315 | mPopupMenu->insertItem( i18n("Set Calendar"), mCalPopup ); | 315 | selPopup->insertItem( i18n("Set Calendar"), mCalPopup ); |
316 | 316 | ||
317 | selPopup->insertItem(i18n("Set categories")+"...",this, | ||
318 | SLOT(setCat()) ); | ||
319 | selPopup->insertItem( i18n("Set alarm..."),this, | ||
320 | SLOT(setAlarm())); | ||
321 | #if 0 | ||
317 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 322 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
@@ -322,2 +327,3 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
322 | SLOT(setAlarm()),true); | 327 | SLOT(setAlarm()),true); |
328 | #endif | ||
323 | QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this, | 329 | QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this, |
@@ -329,3 +335,3 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
329 | QPopupMenu * exportPO = new QPopupMenu ( this ); | 335 | QPopupMenu * exportPO = new QPopupMenu ( this ); |
330 | mPopupMenu->insertItem( i18n("Export"), exportPO ); | 336 | selPopup->insertItem( i18n("Export"), exportPO ); |
331 | exportPO->insertItem( i18n("As iCal (ics) file..."),this, | 337 | exportPO->insertItem( i18n("As iCal (ics) file..."),this, |
@@ -342,3 +348,6 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
342 | #ifndef DESKTOP_VERSION | 348 | #ifndef DESKTOP_VERSION |
343 | mPopupMenu->insertSeparator(); | 349 | selPopup->insertSeparator(); |
350 | selPopup->insertItem( i18n("Beam via IR"),this, | ||
351 | SLOT(beamSelected())); | ||
352 | #if 0 | ||
344 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 353 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
@@ -347,2 +356,3 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
347 | #endif | 356 | #endif |
357 | #endif | ||
348 | /* | 358 | /* |
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index d0865c3..efe8774 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -126,3 +126,5 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) | |||
126 | QWidget *rangeWidget = new QWidget(topFrame); | 126 | QWidget *rangeWidget = new QWidget(topFrame); |
127 | QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint()-3); | 127 | int space = KDialog::spacingHint(); |
128 | if ( QApplication::desktop()->width() <= 240 ) space = 1; | ||
129 | QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,space); | ||
128 | rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); | 130 | rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); |