-rw-r--r-- | korganizer/kolistview.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 3d4acb7..f8bfc8b 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -1,305 +1,307 @@ | |||
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 <qregexp.h> | 35 | #include <qregexp.h> |
36 | 36 | ||
37 | #include <klocale.h> | 37 | #include <klocale.h> |
38 | #include <kdebug.h> | 38 | #include <kdebug.h> |
39 | #include <kiconloader.h> | 39 | #include <kiconloader.h> |
40 | #include <kglobal.h> | 40 | #include <kglobal.h> |
41 | 41 | ||
42 | #include <libkdepim/kpimglobalprefs.h> | 42 | #include <libkdepim/kpimglobalprefs.h> |
43 | #include <libkcal/calendar.h> | 43 | #include <libkcal/calendar.h> |
44 | #include <libkcal/calendarlocal.h> | 44 | #include <libkcal/calendarlocal.h> |
45 | #include <libkcal/icalformat.h> | 45 | #include <libkcal/icalformat.h> |
46 | #include <libkcal/vcalformat.h> | 46 | #include <libkcal/vcalformat.h> |
47 | #include <libkcal/recurrence.h> | 47 | #include <libkcal/recurrence.h> |
48 | #include <libkcal/filestorage.h> | 48 | #include <libkcal/filestorage.h> |
49 | #include <libkdepim/categoryselectdialog.h> | 49 | #include <libkdepim/categoryselectdialog.h> |
50 | #ifndef DESKTOP_VERSION | 50 | #ifndef DESKTOP_VERSION |
51 | #include <qpe/qpeapplication.h> | 51 | #include <qpe/qpeapplication.h> |
52 | #else | 52 | #else |
53 | #include <qapplication.h> | 53 | #include <qapplication.h> |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | #ifndef KORG_NOPRINTER | 56 | #ifndef KORG_NOPRINTER |
57 | #include "calprinter.h" | 57 | #include "calprinter.h" |
58 | #endif | 58 | #endif |
59 | #include "koglobals.h" | 59 | #include "koglobals.h" |
60 | #include "koprefs.h" | 60 | #include "koprefs.h" |
61 | #include "kfiledialog.h" | 61 | #include "kfiledialog.h" |
62 | 62 | ||
63 | #include "kolistview.h" | 63 | #include "kolistview.h" |
64 | 64 | ||
65 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) | 65 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) |
66 | { | 66 | { |
67 | mItem = item; | 67 | mItem = item; |
68 | mDate = date; | 68 | mDate = date; |
69 | } | 69 | } |
70 | 70 | ||
71 | ListItemVisitor::~ListItemVisitor() | 71 | ListItemVisitor::~ListItemVisitor() |
72 | { | 72 | { |
73 | } | 73 | } |
74 | 74 | ||
75 | bool ListItemVisitor::visit(Event *e) | 75 | bool ListItemVisitor::visit(Event *e) |
76 | { | 76 | { |
77 | 77 | ||
78 | bool ok = false; | 78 | bool ok = false; |
79 | QString start, end; | 79 | QString start, end; |
80 | QDate ds, de; | ||
80 | if ( e->doesRecur() ) { | 81 | if ( e->doesRecur() ) { |
81 | QDate d = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); | 82 | ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); |
82 | if ( ok ) { | 83 | if ( ok ) { |
83 | int days = e->dtStart().date().daysTo(e->dtEnd().date() ); | 84 | int days = e->dtStart().date().daysTo(e->dtEnd().date() ); |
84 | start = KGlobal::locale()->formatDate(d,true); | 85 | start = KGlobal::locale()->formatDate(ds,true); |
85 | end = KGlobal::locale()->formatDate(d.addDays( days),true); | 86 | de = ds.addDays( days); |
87 | end = KGlobal::locale()->formatDate(de,true); | ||
86 | } | 88 | } |
87 | 89 | ||
88 | } | 90 | } |
89 | if ( ! ok ) { | 91 | if ( ! ok ) { |
90 | start =e->dtStartDateStr(); | 92 | start =e->dtStartDateStr(); |
91 | end = e->dtEndDateStr(); | 93 | end = e->dtEndDateStr(); |
94 | ds = e->dtStart().date(); | ||
95 | de = e->dtEnd().date(); | ||
92 | } | 96 | } |
93 | mItem->setText(0,e->summary()); | 97 | mItem->setText(0,e->summary()); |
94 | mItem->setText(1,start); | 98 | mItem->setText(1,start); |
95 | mItem->setText(2,e->dtStartTimeStr()); | 99 | mItem->setText(2,e->dtStartTimeStr()); |
96 | mItem->setText(3,end); | 100 | mItem->setText(3,end); |
97 | mItem->setText(4,e->dtEndTimeStr()); | 101 | mItem->setText(4,e->dtEndTimeStr()); |
98 | mItem->setText(5,e->isAlarmEnabled() ? i18n("Yes") : i18n("No")); | 102 | mItem->setText(5,e->isAlarmEnabled() ? i18n("Yes") : i18n("No")); |
99 | mItem->setText(6, e->recurrence()->recurrenceText()); | 103 | mItem->setText(6, e->recurrence()->recurrenceText()); |
100 | mItem->setText(7,"---"); | 104 | mItem->setText(7,"---"); |
101 | mItem->setText(8,"---"); | 105 | mItem->setText(8,"---"); |
102 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); | 106 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); |
103 | mItem->setText(10,e->categoriesStr()); | 107 | mItem->setText(10,e->categoriesStr()); |
104 | 108 | ||
105 | QString key; | 109 | QString key; |
106 | QDate d = e->dtStart().date(); | ||
107 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); | 110 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); |
108 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute()); | 111 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); |
109 | mItem->setSortKey(1,key); | 112 | mItem->setSortKey(1,key); |
110 | 113 | ||
111 | d = e->dtEnd().date(); | ||
112 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); | 114 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); |
113 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute()); | 115 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); |
114 | mItem->setSortKey(3,key); | 116 | mItem->setSortKey(3,key); |
115 | 117 | ||
116 | return true; | 118 | return true; |
117 | } | 119 | } |
118 | 120 | ||
119 | bool ListItemVisitor::visit(Todo *t) | 121 | bool ListItemVisitor::visit(Todo *t) |
120 | { | 122 | { |
121 | mItem->setText(0,i18n("To-Do: %1").arg(t->summary())); | 123 | mItem->setText(0,i18n("To-Do: %1").arg(t->summary())); |
122 | if (t->hasStartDate()) { | 124 | if (t->hasStartDate()) { |
123 | mItem->setText(1,t->dtStartDateStr()); | 125 | mItem->setText(1,t->dtStartDateStr()); |
124 | if (t->doesFloat()) { | 126 | if (t->doesFloat()) { |
125 | mItem->setText(2,"---"); | 127 | mItem->setText(2,"---"); |
126 | } else { | 128 | } else { |
127 | mItem->setText(2,t->dtStartTimeStr()); | 129 | mItem->setText(2,t->dtStartTimeStr()); |
128 | } | 130 | } |
129 | } else { | 131 | } else { |
130 | mItem->setText(1,"---"); | 132 | mItem->setText(1,"---"); |
131 | mItem->setText(2,"---"); | 133 | mItem->setText(2,"---"); |
132 | } | 134 | } |
133 | mItem->setText(3,"---"); | 135 | mItem->setText(3,"---"); |
134 | mItem->setText(4,"---"); | 136 | mItem->setText(4,"---"); |
135 | mItem->setText(5,"---"); | 137 | mItem->setText(5,"---"); |
136 | mItem->setText(6,"---"); | 138 | mItem->setText(6,"---"); |
137 | if (t->hasDueDate()) { | 139 | if (t->hasDueDate()) { |
138 | mItem->setText(7,t->dtDueDateStr()); | 140 | mItem->setText(7,t->dtDueDateStr()); |
139 | if (t->doesFloat()) { | 141 | if (t->doesFloat()) { |
140 | mItem->setText(8,"---"); | 142 | mItem->setText(8,"---"); |
141 | } else { | 143 | } else { |
142 | mItem->setText(8,t->dtDueTimeStr()); | 144 | mItem->setText(8,t->dtDueTimeStr()); |
143 | } | 145 | } |
144 | } else { | 146 | } else { |
145 | mItem->setText(7,"---"); | 147 | mItem->setText(7,"---"); |
146 | mItem->setText(8,"---"); | 148 | mItem->setText(8,"---"); |
147 | } | 149 | } |
148 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); | 150 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); |
149 | mItem->setText(10,t->categoriesStr()); | 151 | mItem->setText(10,t->categoriesStr()); |
150 | 152 | ||
151 | QString key; | 153 | QString key; |
152 | QDate d; | 154 | QDate d; |
153 | if (t->hasDueDate()) { | 155 | if (t->hasDueDate()) { |
154 | d = t->dtDue().date(); | 156 | d = t->dtDue().date(); |
155 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); | 157 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); |
156 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 158 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
157 | mItem->setSortKey(7,key); | 159 | mItem->setSortKey(7,key); |
158 | } | 160 | } |
159 | if ( t->hasStartDate() ) { | 161 | if ( t->hasStartDate() ) { |
160 | d = t->dtStart().date(); | 162 | d = t->dtStart().date(); |
161 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); | 163 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); |
162 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 164 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
163 | mItem->setSortKey(1,key); | 165 | mItem->setSortKey(1,key); |
164 | } | 166 | } |
165 | return true; | 167 | return true; |
166 | } | 168 | } |
167 | 169 | ||
168 | bool ListItemVisitor::visit(Journal * j) | 170 | bool ListItemVisitor::visit(Journal * j) |
169 | { | 171 | { |
170 | QString des = j->description().left(50); | 172 | QString des = j->description().left(50); |
171 | des = des.simplifyWhiteSpace (); | 173 | des = des.simplifyWhiteSpace (); |
172 | des.replace (QRegExp ("\\n"),"" ); | 174 | des.replace (QRegExp ("\\n"),"" ); |
173 | des.replace (QRegExp ("\\r"),"" ); | 175 | des.replace (QRegExp ("\\r"),"" ); |
174 | mItem->setText(0,i18n("Journal")+": "+des.left(25)); | 176 | mItem->setText(0,i18n("Journal")+": "+des.left(25)); |
175 | mItem->setText(1,j->dtStartDateStr()); | 177 | mItem->setText(1,j->dtStartDateStr()); |
176 | mItem->setText(2,"---"); | 178 | mItem->setText(2,"---"); |
177 | mItem->setText(3,"---"); | 179 | mItem->setText(3,"---"); |
178 | mItem->setText(4,"---"); | 180 | mItem->setText(4,"---"); |
179 | mItem->setText(5,"---"); | 181 | mItem->setText(5,"---"); |
180 | mItem->setText(6,"---"); | 182 | mItem->setText(6,"---"); |
181 | mItem->setText(7,j->dtStartDateStr()); | 183 | mItem->setText(7,j->dtStartDateStr()); |
182 | mItem->setText(8,"---"); | 184 | mItem->setText(8,"---"); |
183 | mItem->setText(9,"---"); | 185 | mItem->setText(9,"---"); |
184 | mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); | 186 | mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); |
185 | 187 | ||
186 | QString key; | 188 | QString key; |
187 | QDate d = j->dtStart().date(); | 189 | QDate d = j->dtStart().date(); |
188 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 190 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
189 | mItem->setSortKey(1,key); | 191 | mItem->setSortKey(1,key); |
190 | mItem->setSortKey(7,key); | 192 | mItem->setSortKey(7,key); |
191 | 193 | ||
192 | return true; | 194 | return true; |
193 | } | 195 | } |
194 | 196 | ||
195 | KOListView::KOListView(Calendar *calendar, QWidget *parent, | 197 | KOListView::KOListView(Calendar *calendar, QWidget *parent, |
196 | const char *name) | 198 | const char *name) |
197 | : KOEventView(calendar, parent, name) | 199 | : KOEventView(calendar, parent, name) |
198 | { | 200 | { |
199 | mActiveItem = 0; | 201 | mActiveItem = 0; |
200 | mListView = new KOListViewListView(this); | 202 | mListView = new KOListViewListView(this); |
201 | mListView->addColumn(i18n("Summary")); | 203 | mListView->addColumn(i18n("Summary")); |
202 | mListView->addColumn(i18n("Start Date")); | 204 | mListView->addColumn(i18n("Start Date")); |
203 | mListView->addColumn(i18n("Start Time")); | 205 | mListView->addColumn(i18n("Start Time")); |
204 | mListView->addColumn(i18n("End Date")); | 206 | mListView->addColumn(i18n("End Date")); |
205 | mListView->addColumn(i18n("End Time")); | 207 | mListView->addColumn(i18n("End Time")); |
206 | mListView->addColumn(i18n("Alarm")); // alarm set? | 208 | mListView->addColumn(i18n("Alarm")); // alarm set? |
207 | mListView->addColumn(i18n("Recurs")); // recurs? | 209 | mListView->addColumn(i18n("Recurs")); // recurs? |
208 | mListView->addColumn(i18n("Due Date")); | 210 | mListView->addColumn(i18n("Due Date")); |
209 | mListView->addColumn(i18n("Due Time")); | 211 | mListView->addColumn(i18n("Due Time")); |
210 | mListView->addColumn(i18n("Cancelled")); | 212 | mListView->addColumn(i18n("Cancelled")); |
211 | mListView->addColumn(i18n("Categories")); | 213 | mListView->addColumn(i18n("Categories")); |
212 | 214 | ||
213 | mListView->setColumnAlignment(0,AlignLeft); | 215 | mListView->setColumnAlignment(0,AlignLeft); |
214 | mListView->setColumnAlignment(1,AlignLeft); | 216 | mListView->setColumnAlignment(1,AlignLeft); |
215 | mListView->setColumnAlignment(2,AlignHCenter); | 217 | mListView->setColumnAlignment(2,AlignHCenter); |
216 | mListView->setColumnAlignment(3,AlignLeft); | 218 | mListView->setColumnAlignment(3,AlignLeft); |
217 | mListView->setColumnAlignment(4,AlignHCenter); | 219 | mListView->setColumnAlignment(4,AlignHCenter); |
218 | mListView->setColumnAlignment(5,AlignLeft); | 220 | mListView->setColumnAlignment(5,AlignLeft); |
219 | mListView->setColumnAlignment(6,AlignLeft); | 221 | mListView->setColumnAlignment(6,AlignLeft); |
220 | mListView->setColumnAlignment(7,AlignLeft); | 222 | mListView->setColumnAlignment(7,AlignLeft); |
221 | mListView->setColumnAlignment(8,AlignLeft); | 223 | mListView->setColumnAlignment(8,AlignLeft); |
222 | mListView->setColumnAlignment(9,AlignLeft); | 224 | mListView->setColumnAlignment(9,AlignLeft); |
223 | mListView->setColumnAlignment(10,AlignLeft); | 225 | mListView->setColumnAlignment(10,AlignLeft); |
224 | 226 | ||
225 | int iii = 0; | 227 | int iii = 0; |
226 | for ( iii = 0; iii< 10 ; ++iii ) | 228 | for ( iii = 0; iii< 10 ; ++iii ) |
227 | mListView->setColumnWidthMode( iii, QListView::Manual ); | 229 | mListView->setColumnWidthMode( iii, QListView::Manual ); |
228 | 230 | ||
229 | QBoxLayout *layoutTop = new QVBoxLayout(this); | 231 | QBoxLayout *layoutTop = new QVBoxLayout(this); |
230 | layoutTop->addWidget(mListView); | 232 | layoutTop->addWidget(mListView); |
231 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 233 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
232 | mPopupMenu = eventPopup(); | 234 | mPopupMenu = eventPopup(); |
233 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 235 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
234 | i18n("Select all"),this, | 236 | i18n("Select all"),this, |
235 | SLOT(allSelection()),true); | 237 | SLOT(allSelection()),true); |
236 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 238 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
237 | i18n("Deselect All"),this, | 239 | i18n("Deselect All"),this, |
238 | SLOT(clearSelection()),true); | 240 | SLOT(clearSelection()),true); |
239 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 241 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
240 | i18n("Delete all selected"),this, | 242 | i18n("Delete all selected"),this, |
241 | SLOT(deleteAll()),true); | 243 | SLOT(deleteAll()),true); |
242 | mPopupMenu->insertSeparator(); | 244 | mPopupMenu->insertSeparator(); |
243 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 245 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
244 | i18n("Save selected to file..."),this, | 246 | i18n("Save selected to file..."),this, |
245 | SLOT(saveToFile()),true); | 247 | SLOT(saveToFile()),true); |
246 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 248 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
247 | i18n("Save Journal/Description..."),this, | 249 | i18n("Save Journal/Description..."),this, |
248 | SLOT(saveDescriptionToFile()),true); | 250 | SLOT(saveDescriptionToFile()),true); |
249 | mPopupMenu->insertSeparator(); | 251 | mPopupMenu->insertSeparator(); |
250 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 252 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
251 | i18n("Add Categ. to selected..."),this, | 253 | i18n("Add Categ. to selected..."),this, |
252 | SLOT(addCat()),true); | 254 | SLOT(addCat()),true); |
253 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 255 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
254 | i18n("Set Categ. for selected..."),this, | 256 | i18n("Set Categ. for selected..."),this, |
255 | SLOT(setCat()),true); | 257 | SLOT(setCat()),true); |
256 | mPopupMenu->insertSeparator(); | 258 | mPopupMenu->insertSeparator(); |
257 | 259 | ||
258 | 260 | ||
259 | #ifndef DESKTOP_VERSION | 261 | #ifndef DESKTOP_VERSION |
260 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 262 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
261 | i18n("Beam selected via IR"),this, | 263 | i18n("Beam selected via IR"),this, |
262 | SLOT(beamSelected()),true); | 264 | SLOT(beamSelected()),true); |
263 | #endif | 265 | #endif |
264 | /* | 266 | /* |
265 | mPopupMenu = new QPopupMenu; | 267 | mPopupMenu = new QPopupMenu; |
266 | mPopupMenu->insertItem(i18n("Edit Event"), this, | 268 | mPopupMenu->insertItem(i18n("Edit Event"), this, |
267 | SLOT (editEvent())); | 269 | SLOT (editEvent())); |
268 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, | 270 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, |
269 | SLOT (deleteEvent())); | 271 | SLOT (deleteEvent())); |
270 | mPopupMenu->insertSeparator(); | 272 | mPopupMenu->insertSeparator(); |
271 | mPopupMenu->insertItem(i18n("Show Dates"), this, | 273 | mPopupMenu->insertItem(i18n("Show Dates"), this, |
272 | SLOT(showDates())); | 274 | SLOT(showDates())); |
273 | mPopupMenu->insertItem(i18n("Hide Dates"), this, | 275 | mPopupMenu->insertItem(i18n("Hide Dates"), this, |
274 | SLOT(hideDates())); | 276 | SLOT(hideDates())); |
275 | */ | 277 | */ |
276 | QObject::connect(mListView,SIGNAL( newEvent()), | 278 | QObject::connect(mListView,SIGNAL( newEvent()), |
277 | this,SIGNAL(signalNewEvent())); | 279 | this,SIGNAL(signalNewEvent())); |
278 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), | 280 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), |
279 | this,SLOT(defaultItemAction(QListViewItem *))); | 281 | this,SLOT(defaultItemAction(QListViewItem *))); |
280 | QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *, | 282 | QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *, |
281 | const QPoint &, int )), | 283 | const QPoint &, int )), |
282 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); | 284 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); |
283 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), | 285 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), |
284 | SLOT(processSelectionChange(QListViewItem *))); | 286 | SLOT(processSelectionChange(QListViewItem *))); |
285 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), | 287 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), |
286 | SIGNAL(showIncidenceSignal(Incidence *)) ); | 288 | SIGNAL(showIncidenceSignal(Incidence *)) ); |
287 | 289 | ||
288 | readSettings(KOGlobals::config(),"KOListView Layout"); | 290 | readSettings(KOGlobals::config(),"KOListView Layout"); |
289 | } | 291 | } |
290 | 292 | ||
291 | KOListView::~KOListView() | 293 | KOListView::~KOListView() |
292 | { | 294 | { |
293 | delete mPopupMenu; | 295 | delete mPopupMenu; |
294 | } | 296 | } |
295 | 297 | ||
296 | void KOListView::updateList() | 298 | void KOListView::updateList() |
297 | { | 299 | { |
298 | // qDebug(" KOListView::updateList() "); | 300 | // qDebug(" KOListView::updateList() "); |
299 | 301 | ||
300 | } | 302 | } |
301 | 303 | ||
302 | void KOListView::addCat( ) | 304 | void KOListView::addCat( ) |
303 | { | 305 | { |
304 | setCategories( false ); | 306 | setCategories( false ); |
305 | } | 307 | } |