-rw-r--r-- | korganizer/kolistview.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index a1bf9ff..bbf83d9 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -1,313 +1,319 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 1999 Preston Brown | 3 | Copyright (c) 1999 Preston Brown |
4 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qlistview.h> | 25 | #include <qlistview.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qpopupmenu.h> | 28 | #include <qpopupmenu.h> |
29 | #include <qprogressbar.h> | 29 | #include <qprogressbar.h> |
30 | #include <qfileinfo.h> | 30 | #include <qfileinfo.h> |
31 | #include <qmessagebox.h> | 31 | #include <qmessagebox.h> |
32 | #include <qdialog.h> | 32 | #include <qdialog.h> |
33 | #include <qtextstream.h> | 33 | #include <qtextstream.h> |
34 | #include <qdir.h> | 34 | #include <qdir.h> |
35 | #include <qwhatsthis.h> | 35 | #include <qwhatsthis.h> |
36 | #include <qregexp.h> | 36 | #include <qregexp.h> |
37 | 37 | ||
38 | #include <klocale.h> | 38 | #include <klocale.h> |
39 | #include <kdebug.h> | 39 | #include <kdebug.h> |
40 | #include <kiconloader.h> | 40 | #include <kiconloader.h> |
41 | #include <kglobal.h> | 41 | #include <kglobal.h> |
42 | 42 | ||
43 | #include <libkdepim/kpimglobalprefs.h> | 43 | #include <libkdepim/kpimglobalprefs.h> |
44 | #include <libkcal/calendar.h> | 44 | #include <libkcal/calendar.h> |
45 | #include <libkcal/calendarlocal.h> | 45 | #include <libkcal/calendarlocal.h> |
46 | #include <libkcal/icalformat.h> | 46 | #include <libkcal/icalformat.h> |
47 | #include <libkcal/vcalformat.h> | 47 | #include <libkcal/vcalformat.h> |
48 | #include <libkcal/recurrence.h> | 48 | #include <libkcal/recurrence.h> |
49 | #include <libkcal/filestorage.h> | 49 | #include <libkcal/filestorage.h> |
50 | #include <libkdepim/categoryselectdialog.h> | 50 | #include <libkdepim/categoryselectdialog.h> |
51 | #include <libkcal/kincidenceformatter.h> | 51 | #include <libkcal/kincidenceformatter.h> |
52 | #ifndef DESKTOP_VERSION | 52 | #ifndef DESKTOP_VERSION |
53 | #include <qpe/qpeapplication.h> | 53 | #include <qpe/qpeapplication.h> |
54 | #else | 54 | #else |
55 | #include <qapplication.h> | 55 | #include <qapplication.h> |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | #ifndef KORG_NOPRINTER | 58 | #ifndef KORG_NOPRINTER |
59 | #include "calprinter.h" | 59 | #include "calprinter.h" |
60 | #endif | 60 | #endif |
61 | #include "koglobals.h" | 61 | #include "koglobals.h" |
62 | #include "koprefs.h" | 62 | #include "koprefs.h" |
63 | #include "kfiledialog.h" | 63 | #include "kfiledialog.h" |
64 | 64 | ||
65 | #include "kolistview.h" | 65 | #include "kolistview.h" |
66 | 66 | ||
67 | 67 | ||
68 | 68 | ||
69 | 69 | ||
70 | class KOListViewWhatsThis :public QWhatsThis | 70 | class KOListViewWhatsThis :public QWhatsThis |
71 | { | 71 | { |
72 | public: | 72 | public: |
73 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; | 73 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; |
74 | 74 | ||
75 | protected: | 75 | protected: |
76 | virtual QString text( const QPoint& p) | 76 | virtual QString text( const QPoint& p) |
77 | { | 77 | { |
78 | return _view->getWhatsThisText(p) ; | 78 | return _view->getWhatsThisText(p) ; |
79 | } | 79 | } |
80 | private: | 80 | private: |
81 | QWidget* _wid; | 81 | QWidget* _wid; |
82 | KOListView * _view; | 82 | KOListView * _view; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | 85 | ||
86 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) | 86 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) |
87 | { | 87 | { |
88 | mItem = item; | 88 | mItem = item; |
89 | mDate = date; | 89 | mDate = date; |
90 | } | 90 | } |
91 | 91 | ||
92 | ListItemVisitor::~ListItemVisitor() | 92 | ListItemVisitor::~ListItemVisitor() |
93 | { | 93 | { |
94 | } | 94 | } |
95 | 95 | ||
96 | bool ListItemVisitor::visit(Event *e) | 96 | bool ListItemVisitor::visit(Event *e) |
97 | { | 97 | { |
98 | bool ok = false; | 98 | bool ok = false; |
99 | QString start, end; | 99 | QString start, end; |
100 | QDate ds, de; | 100 | QDate ds, de; |
101 | if ( e->doesRecur() ) { | 101 | if ( e->doesRecur() ) { |
102 | ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); | 102 | ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); |
103 | if ( ok ) { | 103 | if ( ok ) { |
104 | int days = e->dtStart().date().daysTo(e->dtEnd().date() ); | 104 | int days = e->dtStart().date().daysTo(e->dtEnd().date() ); |
105 | start = KGlobal::locale()->formatDate(ds,true); | 105 | start = KGlobal::locale()->formatDate(ds,true); |
106 | de = ds.addDays( days); | 106 | de = ds.addDays( days); |
107 | end = KGlobal::locale()->formatDate(de,true); | 107 | end = KGlobal::locale()->formatDate(de,true); |
108 | } | 108 | } |
109 | 109 | ||
110 | } | 110 | } |
111 | if ( ! ok ) { | 111 | if ( ! ok ) { |
112 | start =e->dtStartDateStr(); | 112 | start =e->dtStartDateStr(); |
113 | end = e->dtEndDateStr(); | 113 | end = e->dtEndDateStr(); |
114 | ds = e->dtStart().date(); | 114 | ds = e->dtStart().date(); |
115 | de = e->dtEnd().date(); | 115 | de = e->dtEnd().date(); |
116 | } | 116 | } |
117 | mItem->setText(0,e->summary()); | 117 | mItem->setText(0,e->summary()); |
118 | mItem->setText(1,start); | 118 | mItem->setText(1,start); |
119 | mItem->setText(2,e->dtStartTimeStr()); | 119 | if ( e->doesFloat() ) |
120 | mItem->setText(2,"---"); | ||
121 | else | ||
122 | mItem->setText(2,e->dtStartTimeStr()); | ||
120 | mItem->setText(3,end); | 123 | mItem->setText(3,end); |
121 | mItem->setText(4,e->dtEndTimeStr()); | 124 | if ( e->doesFloat() ) |
125 | mItem->setText(4,"---"); | ||
126 | else | ||
127 | mItem->setText(4,e->dtEndTimeStr()); | ||
122 | if ( e->isAlarmEnabled() ) { | 128 | if ( e->isAlarmEnabled() ) { |
123 | mItem->setText(5,e->alarms().first()->offsetText() ); | 129 | mItem->setText(5,e->alarms().first()->offsetText() ); |
124 | } else { | 130 | } else { |
125 | mItem->setText(5, i18n("No")); | 131 | mItem->setText(5, i18n("No")); |
126 | } | 132 | } |
127 | mItem->setText(6, e->recurrence()->recurrenceText()); | 133 | mItem->setText(6, e->recurrence()->recurrenceText()); |
128 | if( ! e->doesRecur() ) | 134 | if( ! e->doesRecur() ) |
129 | mItem->setSortKey( 6, "-" ); | 135 | mItem->setSortKey( 6, "-" ); |
130 | mItem->setText(7,"---"); | 136 | mItem->setText(7,"---"); |
131 | mItem->setText(8,"---"); | 137 | mItem->setText(8,"---"); |
132 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); | 138 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); |
133 | mItem->setText(10,e->categoriesStr()); | 139 | mItem->setText(10,e->categoriesStr()); |
134 | 140 | ||
135 | QString key; | 141 | QString key; |
136 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); | 142 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); |
137 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); | 143 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); |
138 | mItem->setSortKey(1,key); | 144 | mItem->setSortKey(1,key); |
139 | 145 | ||
140 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); | 146 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); |
141 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); | 147 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); |
142 | mItem->setSortKey(3,key); | 148 | mItem->setSortKey(3,key); |
143 | return true; | 149 | return true; |
144 | } | 150 | } |
145 | 151 | ||
146 | bool ListItemVisitor::visit(Todo *t) | 152 | bool ListItemVisitor::visit(Todo *t) |
147 | { | 153 | { |
148 | mItem->setText(0,i18n("Todo: %1").arg(t->summary())); | 154 | mItem->setText(0,i18n("Todo: %1").arg(t->summary())); |
149 | if (t->hasStartDate()) { | 155 | if (t->hasStartDate()) { |
150 | mItem->setText(1,t->dtStartDateStr()); | 156 | mItem->setText(1,t->dtStartDateStr()); |
151 | if (t->doesFloat()) { | 157 | if (t->doesFloat()) { |
152 | mItem->setText(2,"---"); | 158 | mItem->setText(2,"---"); |
153 | } else { | 159 | } else { |
154 | mItem->setText(2,t->dtStartTimeStr()); | 160 | mItem->setText(2,t->dtStartTimeStr()); |
155 | } | 161 | } |
156 | } else { | 162 | } else { |
157 | mItem->setText(1,"---"); | 163 | mItem->setText(1,"---"); |
158 | mItem->setText(2,"---"); | 164 | mItem->setText(2,"---"); |
159 | } | 165 | } |
160 | mItem->setText(3,"---"); | 166 | mItem->setText(3,"---"); |
161 | mItem->setText(4,"---"); | 167 | mItem->setText(4,"---"); |
162 | if ( t->isAlarmEnabled() ) { | 168 | if ( t->isAlarmEnabled() ) { |
163 | mItem->setText(5,t->alarms().first()->offsetText() ); | 169 | mItem->setText(5,t->alarms().first()->offsetText() ); |
164 | } else { | 170 | } else { |
165 | mItem->setText(5, i18n("No")); | 171 | mItem->setText(5, i18n("No")); |
166 | } | 172 | } |
167 | mItem->setText(6, t->recurrence()->recurrenceText()); | 173 | mItem->setText(6, t->recurrence()->recurrenceText()); |
168 | if( ! t->doesRecur() ) | 174 | if( ! t->doesRecur() ) |
169 | mItem->setSortKey( 6, "-" ); | 175 | mItem->setSortKey( 6, "-" ); |
170 | if (t->hasDueDate()) { | 176 | if (t->hasDueDate()) { |
171 | mItem->setText(7,t->dtDueDateStr()); | 177 | mItem->setText(7,t->dtDueDateStr()); |
172 | if (t->doesFloat()) { | 178 | if (t->doesFloat()) { |
173 | mItem->setText(8,"---"); | 179 | mItem->setText(8,"---"); |
174 | } else { | 180 | } else { |
175 | mItem->setText(8,t->dtDueTimeStr()); | 181 | mItem->setText(8,t->dtDueTimeStr()); |
176 | } | 182 | } |
177 | } else { | 183 | } else { |
178 | mItem->setText(7,"---"); | 184 | mItem->setText(7,"---"); |
179 | mItem->setText(8,"---"); | 185 | mItem->setText(8,"---"); |
180 | } | 186 | } |
181 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); | 187 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); |
182 | mItem->setText(10,t->categoriesStr()); | 188 | mItem->setText(10,t->categoriesStr()); |
183 | 189 | ||
184 | QString key; | 190 | QString key; |
185 | QDate d; | 191 | QDate d; |
186 | if (t->hasDueDate()) { | 192 | if (t->hasDueDate()) { |
187 | d = t->dtDue().date(); | 193 | d = t->dtDue().date(); |
188 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); | 194 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); |
189 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 195 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
190 | mItem->setSortKey(7,key); | 196 | mItem->setSortKey(7,key); |
191 | } | 197 | } |
192 | if ( t->hasStartDate() ) { | 198 | if ( t->hasStartDate() ) { |
193 | d = t->dtStart().date(); | 199 | d = t->dtStart().date(); |
194 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); | 200 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); |
195 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 201 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
196 | mItem->setSortKey(1,key); | 202 | mItem->setSortKey(1,key); |
197 | } | 203 | } |
198 | return true; | 204 | return true; |
199 | } | 205 | } |
200 | 206 | ||
201 | bool ListItemVisitor::visit(Journal * j) | 207 | bool ListItemVisitor::visit(Journal * j) |
202 | { | 208 | { |
203 | QString des = j->description().left(30); | 209 | QString des = j->description().left(30); |
204 | des = des.simplifyWhiteSpace (); | 210 | des = des.simplifyWhiteSpace (); |
205 | des.replace (QRegExp ("\\n"),"" ); | 211 | des.replace (QRegExp ("\\n"),"" ); |
206 | des.replace (QRegExp ("\\r"),"" ); | 212 | des.replace (QRegExp ("\\r"),"" ); |
207 | mItem->setText(0,i18n("Journal: ")+des.left(25)); | 213 | mItem->setText(0,i18n("Journal: ")+des.left(25)); |
208 | mItem->setText(1,j->dtStartDateStr()); | 214 | mItem->setText(1,j->dtStartDateStr()); |
209 | mItem->setText(2,"---"); | 215 | mItem->setText(2,"---"); |
210 | mItem->setText(3,"---"); | 216 | mItem->setText(3,"---"); |
211 | mItem->setText(4,"---"); | 217 | mItem->setText(4,"---"); |
212 | mItem->setText(5,"---"); | 218 | mItem->setText(5,"---"); |
213 | mItem->setText(6,"---"); | 219 | mItem->setText(6,"---"); |
214 | mItem->setText(7,j->dtStartDateStr()); | 220 | mItem->setText(7,j->dtStartDateStr()); |
215 | mItem->setText(8,"---"); | 221 | mItem->setText(8,"---"); |
216 | mItem->setText(9,"---"); | 222 | mItem->setText(9,"---"); |
217 | mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); | 223 | mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); |
218 | 224 | ||
219 | QString key; | 225 | QString key; |
220 | QDate d = j->dtStart().date(); | 226 | QDate d = j->dtStart().date(); |
221 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 227 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
222 | mItem->setSortKey(1,key); | 228 | mItem->setSortKey(1,key); |
223 | mItem->setSortKey(7,key); | 229 | mItem->setSortKey(7,key); |
224 | 230 | ||
225 | return true; | 231 | return true; |
226 | } | 232 | } |
227 | 233 | ||
228 | KOListView::KOListView(Calendar *calendar, QWidget *parent, | 234 | KOListView::KOListView(Calendar *calendar, QWidget *parent, |
229 | const char *name) | 235 | const char *name) |
230 | : KOEventView(calendar, parent, name) | 236 | : KOEventView(calendar, parent, name) |
231 | { | 237 | { |
232 | mActiveItem = 0; | 238 | mActiveItem = 0; |
233 | mListView = new KOListViewListView(this); | 239 | mListView = new KOListViewListView(this); |
234 | mListView->addColumn(i18n("Summary")); | 240 | mListView->addColumn(i18n("Summary")); |
235 | mListView->addColumn(i18n("Start Date")); | 241 | mListView->addColumn(i18n("Start Date")); |
236 | mListView->addColumn(i18n("Start Time")); | 242 | mListView->addColumn(i18n("Start Time")); |
237 | mListView->addColumn(i18n("End Date")); | 243 | mListView->addColumn(i18n("End Date")); |
238 | mListView->addColumn(i18n("End Time")); | 244 | mListView->addColumn(i18n("End Time")); |
239 | mListView->addColumn(i18n("Alarm")); // alarm set? | 245 | mListView->addColumn(i18n("Alarm")); // alarm set? |
240 | mListView->addColumn(i18n("Recurs")); // recurs? | 246 | mListView->addColumn(i18n("Recurs")); // recurs? |
241 | mListView->addColumn(i18n("Due Date")); | 247 | mListView->addColumn(i18n("Due Date")); |
242 | mListView->addColumn(i18n("Due Time")); | 248 | mListView->addColumn(i18n("Due Time")); |
243 | mListView->addColumn(i18n("Cancelled")); | 249 | mListView->addColumn(i18n("Cancelled")); |
244 | mListView->addColumn(i18n("Categories")); | 250 | mListView->addColumn(i18n("Categories")); |
245 | 251 | ||
246 | mListView->setColumnAlignment(0,AlignLeft); | 252 | mListView->setColumnAlignment(0,AlignLeft); |
247 | mListView->setColumnAlignment(1,AlignLeft); | 253 | mListView->setColumnAlignment(1,AlignLeft); |
248 | mListView->setColumnAlignment(2,AlignHCenter); | 254 | mListView->setColumnAlignment(2,AlignHCenter); |
249 | mListView->setColumnAlignment(3,AlignLeft); | 255 | mListView->setColumnAlignment(3,AlignLeft); |
250 | mListView->setColumnAlignment(4,AlignHCenter); | 256 | mListView->setColumnAlignment(4,AlignHCenter); |
251 | mListView->setColumnAlignment(5,AlignLeft); | 257 | mListView->setColumnAlignment(5,AlignLeft); |
252 | mListView->setColumnAlignment(6,AlignLeft); | 258 | mListView->setColumnAlignment(6,AlignLeft); |
253 | mListView->setColumnAlignment(7,AlignLeft); | 259 | mListView->setColumnAlignment(7,AlignLeft); |
254 | mListView->setColumnAlignment(8,AlignLeft); | 260 | mListView->setColumnAlignment(8,AlignLeft); |
255 | mListView->setColumnAlignment(9,AlignLeft); | 261 | mListView->setColumnAlignment(9,AlignLeft); |
256 | mListView->setColumnAlignment(10,AlignLeft); | 262 | mListView->setColumnAlignment(10,AlignLeft); |
257 | mListView->setColumnWidthMode(10, QListView::Manual); | 263 | mListView->setColumnWidthMode(10, QListView::Manual); |
258 | new KOListViewWhatsThis(mListView->viewport(),this); | 264 | new KOListViewWhatsThis(mListView->viewport(),this); |
259 | 265 | ||
260 | int iii = 0; | 266 | int iii = 0; |
261 | for ( iii = 0; iii< 10 ; ++iii ) | 267 | for ( iii = 0; iii< 10 ; ++iii ) |
262 | mListView->setColumnWidthMode( iii, QListView::Manual ); | 268 | mListView->setColumnWidthMode( iii, QListView::Manual ); |
263 | 269 | ||
264 | QBoxLayout *layoutTop = new QVBoxLayout(this); | 270 | QBoxLayout *layoutTop = new QVBoxLayout(this); |
265 | layoutTop->addWidget(mListView); | 271 | layoutTop->addWidget(mListView); |
266 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 272 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
267 | mPopupMenu = eventPopup(); | 273 | mPopupMenu = eventPopup(); |
268 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 274 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
269 | i18n("Select all"),this, | 275 | i18n("Select all"),this, |
270 | SLOT(allSelection()),true); | 276 | SLOT(allSelection()),true); |
271 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 277 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
272 | i18n("Deselect all"),this, | 278 | i18n("Deselect all"),this, |
273 | SLOT(clearSelection()),true); | 279 | SLOT(clearSelection()),true); |
274 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 280 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
275 | i18n("Delete all selected"),this, | 281 | i18n("Delete all selected"),this, |
276 | SLOT(deleteAll()),true); | 282 | SLOT(deleteAll()),true); |
277 | mPopupMenu->insertSeparator(); | 283 | mPopupMenu->insertSeparator(); |
278 | QPopupMenu * exportPO = new QPopupMenu ( this ); | 284 | QPopupMenu * exportPO = new QPopupMenu ( this ); |
279 | mPopupMenu->insertItem( i18n("Export selected"), exportPO ); | 285 | mPopupMenu->insertItem( i18n("Export selected"), exportPO ); |
280 | exportPO->insertItem( i18n("As iCal (ics) file..."),this, | 286 | exportPO->insertItem( i18n("As iCal (ics) file..."),this, |
281 | SLOT(saveToFile())); | 287 | SLOT(saveToFile())); |
282 | exportPO->insertItem( i18n("As vCal (vcs) file..."),this, | 288 | exportPO->insertItem( i18n("As vCal (vcs) file..."),this, |
283 | SLOT(saveToFileVCS())); | 289 | SLOT(saveToFileVCS())); |
284 | exportPO->insertItem( i18n("Journal/Details..."),this, | 290 | exportPO->insertItem( i18n("Journal/Details..."),this, |
285 | SLOT(saveDescriptionToFile())); | 291 | SLOT(saveDescriptionToFile())); |
286 | // mPopupMenu->insertSeparator(); | 292 | // mPopupMenu->insertSeparator(); |
287 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 293 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
288 | i18n("Add Categ. to selected..."),this, | 294 | i18n("Add Categ. to selected..."),this, |
289 | SLOT(addCat()),true); | 295 | SLOT(addCat()),true); |
290 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 296 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
291 | i18n("Set Categ. for selected..."),this, | 297 | i18n("Set Categ. for selected..."),this, |
292 | SLOT(setCat()),true); | 298 | SLOT(setCat()),true); |
293 | //mPopupMenu->insertSeparator(); | 299 | //mPopupMenu->insertSeparator(); |
294 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 300 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
295 | i18n("Set alarm for selected..."),this, | 301 | i18n("Set alarm for selected..."),this, |
296 | SLOT(setAlarm()),true); | 302 | SLOT(setAlarm()),true); |
297 | 303 | ||
298 | 304 | ||
299 | #ifndef DESKTOP_VERSION | 305 | #ifndef DESKTOP_VERSION |
300 | mPopupMenu->insertSeparator(); | 306 | mPopupMenu->insertSeparator(); |
301 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 307 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
302 | i18n("Beam selected via IR"),this, | 308 | i18n("Beam selected via IR"),this, |
303 | SLOT(beamSelected()),true); | 309 | SLOT(beamSelected()),true); |
304 | #endif | 310 | #endif |
305 | /* | 311 | /* |
306 | mPopupMenu = new QPopupMenu; | 312 | mPopupMenu = new QPopupMenu; |
307 | mPopupMenu->insertItem(i18n("Edit Event"), this, | 313 | mPopupMenu->insertItem(i18n("Edit Event"), this, |
308 | SLOT (editEvent())); | 314 | SLOT (editEvent())); |
309 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, | 315 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, |
310 | SLOT (deleteEvent())); | 316 | SLOT (deleteEvent())); |
311 | mPopupMenu->insertSeparator(); | 317 | mPopupMenu->insertSeparator(); |
312 | mPopupMenu->insertItem(i18n("Show Dates"), this, | 318 | mPopupMenu->insertItem(i18n("Show Dates"), this, |
313 | SLOT(showDates())); | 319 | SLOT(showDates())); |