author | zautrix <zautrix> | 2005-06-18 09:12:06 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-18 09:12:06 (UTC) |
commit | 39112dfe29d2108d54d37f25dc57dcd9299f1f93 (patch) (unidiff) | |
tree | d240d7a346ae56d41a68e77ae83eba119665b86b /korganizer/kolistview.cpp | |
parent | 86e7069527cf45b4ba7889619fb0a8a6dd5867cc (diff) | |
download | kdepimpi-39112dfe29d2108d54d37f25dc57dcd9299f1f93.zip kdepimpi-39112dfe29d2108d54d37f25dc57dcd9299f1f93.tar.gz kdepimpi-39112dfe29d2108d54d37f25dc57dcd9299f1f93.tar.bz2 |
icons for todos
-rw-r--r-- | korganizer/kolistview.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index c705c73..0b2f9a4 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -46,48 +46,50 @@ | |||
46 | #include <libkcal/calendar.h> | 46 | #include <libkcal/calendar.h> |
47 | #include <libkcal/calendarlocal.h> | 47 | #include <libkcal/calendarlocal.h> |
48 | #include <libkcal/icalformat.h> | 48 | #include <libkcal/icalformat.h> |
49 | #include <libkcal/vcalformat.h> | 49 | #include <libkcal/vcalformat.h> |
50 | #include <libkcal/recurrence.h> | 50 | #include <libkcal/recurrence.h> |
51 | #include <libkcal/filestorage.h> | 51 | #include <libkcal/filestorage.h> |
52 | #include <libkdepim/categoryselectdialog.h> | 52 | #include <libkdepim/categoryselectdialog.h> |
53 | #include <libkcal/kincidenceformatter.h> | 53 | #include <libkcal/kincidenceformatter.h> |
54 | #ifndef DESKTOP_VERSION | 54 | #ifndef DESKTOP_VERSION |
55 | #include <qpe/qpeapplication.h> | 55 | #include <qpe/qpeapplication.h> |
56 | #else | 56 | #else |
57 | #include <qapplication.h> | 57 | #include <qapplication.h> |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #ifndef KORG_NOPRINTER | 60 | #ifndef KORG_NOPRINTER |
61 | #include "calprinter.h" | 61 | #include "calprinter.h" |
62 | #endif | 62 | #endif |
63 | #include "koglobals.h" | 63 | #include "koglobals.h" |
64 | #include "koprefs.h" | 64 | #include "koprefs.h" |
65 | #include "kfiledialog.h" | 65 | #include "kfiledialog.h" |
66 | 66 | ||
67 | #include "kolistview.h" | 67 | #include "kolistview.h" |
68 | #include "koeventviewer.h" | 68 | #include "koeventviewer.h" |
69 | 69 | ||
70 | extern QPixmap* sgListViewCompletedPix[6]; | ||
71 | |||
70 | class KOListViewWhatsThis :public QWhatsThis | 72 | class KOListViewWhatsThis :public QWhatsThis |
71 | { | 73 | { |
72 | public: | 74 | public: |
73 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; | 75 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; |
74 | 76 | ||
75 | protected: | 77 | protected: |
76 | virtual QString text( const QPoint& p) | 78 | virtual QString text( const QPoint& p) |
77 | { | 79 | { |
78 | return _view->getWhatsThisText(p) ; | 80 | return _view->getWhatsThisText(p) ; |
79 | } | 81 | } |
80 | private: | 82 | private: |
81 | QWidget* _wid; | 83 | QWidget* _wid; |
82 | KOListView * _view; | 84 | KOListView * _view; |
83 | }; | 85 | }; |
84 | 86 | ||
85 | 87 | ||
86 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) | 88 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) |
87 | { | 89 | { |
88 | mItem = item; | 90 | mItem = item; |
89 | mDate = date; | 91 | mDate = date; |
90 | } | 92 | } |
91 | 93 | ||
92 | ListItemVisitor::~ListItemVisitor() | 94 | ListItemVisitor::~ListItemVisitor() |
93 | { | 95 | { |
@@ -131,49 +133,54 @@ bool ListItemVisitor::visit(Event *e) | |||
131 | mItem->setText(5, i18n("No")); | 133 | mItem->setText(5, i18n("No")); |
132 | } | 134 | } |
133 | mItem->setText(6, e->recurrence()->recurrenceText()); | 135 | mItem->setText(6, e->recurrence()->recurrenceText()); |
134 | if( ! e->doesRecur() ) | 136 | if( ! e->doesRecur() ) |
135 | mItem->setSortKey( 6, "-" ); | 137 | mItem->setSortKey( 6, "-" ); |
136 | mItem->setText(7,"---"); | 138 | mItem->setText(7,"---"); |
137 | mItem->setText(8,"---"); | 139 | mItem->setText(8,"---"); |
138 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); | 140 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); |
139 | mItem->setText(10,e->categoriesStr()); | 141 | mItem->setText(10,e->categoriesStr()); |
140 | mItem->setText(11, KOPrefs::instance()->calName( e->calID() )); | 142 | mItem->setText(11, KOPrefs::instance()->calName( e->calID() )); |
141 | 143 | ||
142 | QString key; | 144 | QString key; |
143 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); | 145 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); |
144 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); | 146 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); |
145 | mItem->setSortKey(1,key); | 147 | mItem->setSortKey(1,key); |
146 | 148 | ||
147 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); | 149 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); |
148 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); | 150 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); |
149 | mItem->setSortKey(3,key); | 151 | mItem->setSortKey(3,key); |
150 | return true; | 152 | return true; |
151 | } | 153 | } |
152 | 154 | ||
153 | bool ListItemVisitor::visit(Todo *t) | 155 | bool ListItemVisitor::visit(Todo *t) |
154 | { | 156 | { |
155 | mItem->setText(0,i18n("Todo: %1").arg(t->summary())); | 157 | mItem->setText(0,t->summary()); |
158 | if ( t->isCompleted() ) { | ||
159 | mItem->setSortKey(0,"99"+ t->summary().left(10)); | ||
160 | } else | ||
161 | mItem->setSortKey(0,QString::number( t->percentComplete() )+ t->summary().left(10)); | ||
162 | mItem->setPixmap( 0, *(sgListViewCompletedPix[t->percentComplete()/20])); | ||
156 | if (t->hasStartDate()) { | 163 | if (t->hasStartDate()) { |
157 | mItem->setText(1,t->dtStartDateStr()); | 164 | mItem->setText(1,t->dtStartDateStr()); |
158 | if (t->doesFloat()) { | 165 | if (t->doesFloat()) { |
159 | mItem->setText(2,"---"); | 166 | mItem->setText(2,"---"); |
160 | } else { | 167 | } else { |
161 | mItem->setText(2,t->dtStartTimeStr()); | 168 | mItem->setText(2,t->dtStartTimeStr()); |
162 | } | 169 | } |
163 | } else { | 170 | } else { |
164 | mItem->setText(1,"---"); | 171 | mItem->setText(1,"---"); |
165 | mItem->setText(2,"---"); | 172 | mItem->setText(2,"---"); |
166 | } | 173 | } |
167 | mItem->setText(3,"---"); | 174 | mItem->setText(3,"---"); |
168 | mItem->setText(4,"---"); | 175 | mItem->setText(4,"---"); |
169 | if ( t->isAlarmEnabled() ) { | 176 | if ( t->isAlarmEnabled() ) { |
170 | mItem->setText(5,t->alarms().first()->offsetText() ); | 177 | mItem->setText(5,t->alarms().first()->offsetText() ); |
171 | } else { | 178 | } else { |
172 | mItem->setText(5, i18n("No")); | 179 | mItem->setText(5, i18n("No")); |
173 | } | 180 | } |
174 | mItem->setText(6, t->recurrence()->recurrenceText()); | 181 | mItem->setText(6, t->recurrence()->recurrenceText()); |
175 | if( ! t->doesRecur() ) | 182 | if( ! t->doesRecur() ) |
176 | mItem->setSortKey( 6, "-" ); | 183 | mItem->setSortKey( 6, "-" ); |
177 | if (t->hasDueDate()) { | 184 | if (t->hasDueDate()) { |
178 | mItem->setText(7,t->dtDueDateStr()); | 185 | mItem->setText(7,t->dtDueDateStr()); |
179 | if (t->doesFloat()) { | 186 | if (t->doesFloat()) { |
@@ -217,48 +224,49 @@ bool ListItemVisitor::visit(Journal * j) | |||
217 | mItem->setText(2,"---"); | 224 | mItem->setText(2,"---"); |
218 | mItem->setText(3,"---"); | 225 | mItem->setText(3,"---"); |
219 | mItem->setText(4,"---"); | 226 | mItem->setText(4,"---"); |
220 | mItem->setText(5,"---"); | 227 | mItem->setText(5,"---"); |
221 | mItem->setText(6,"---"); | 228 | mItem->setText(6,"---"); |
222 | mItem->setText(7,j->dtStartDateStr()); | 229 | mItem->setText(7,j->dtStartDateStr()); |
223 | mItem->setText(8,"---"); | 230 | mItem->setText(8,"---"); |
224 | mItem->setText(9,"---"); | 231 | mItem->setText(9,"---"); |
225 | mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); | 232 | mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); |
226 | mItem->setText(11, KOPrefs::instance()->calName( j->calID() )); | 233 | mItem->setText(11, KOPrefs::instance()->calName( j->calID() )); |
227 | 234 | ||
228 | QString key; | 235 | QString key; |
229 | QDate d = j->dtStart().date(); | 236 | QDate d = j->dtStart().date(); |
230 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 237 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
231 | mItem->setSortKey(1,key); | 238 | mItem->setSortKey(1,key); |
232 | mItem->setSortKey(7,key); | 239 | mItem->setSortKey(7,key); |
233 | 240 | ||
234 | return true; | 241 | return true; |
235 | } | 242 | } |
236 | 243 | ||
237 | KOListView::KOListView(Calendar *calendar, QWidget *parent, | 244 | KOListView::KOListView(Calendar *calendar, QWidget *parent, |
238 | const char *name) | 245 | const char *name) |
239 | : KOEventView(calendar, parent, name) | 246 | : KOEventView(calendar, parent, name) |
240 | { | 247 | { |
248 | |||
241 | mActiveItem = 0; | 249 | mActiveItem = 0; |
242 | mListView = new KOListViewListView(this); | 250 | mListView = new KOListViewListView(this); |
243 | mListView->addColumn(i18n("Summary")); | 251 | mListView->addColumn(i18n("Summary")); |
244 | mListView->addColumn(i18n("Start Date")); | 252 | mListView->addColumn(i18n("Start Date")); |
245 | mListView->addColumn(i18n("Start Time")); | 253 | mListView->addColumn(i18n("Start Time")); |
246 | mListView->addColumn(i18n("End Date")); | 254 | mListView->addColumn(i18n("End Date")); |
247 | mListView->addColumn(i18n("End Time")); | 255 | mListView->addColumn(i18n("End Time")); |
248 | mListView->addColumn(i18n("Alarm")); // alarm set? | 256 | mListView->addColumn(i18n("Alarm")); // alarm set? |
249 | mListView->addColumn(i18n("Recurs")); // recurs? | 257 | mListView->addColumn(i18n("Recurs")); // recurs? |
250 | mListView->addColumn(i18n("Due Date")); | 258 | mListView->addColumn(i18n("Due Date")); |
251 | mListView->addColumn(i18n("Due Time")); | 259 | mListView->addColumn(i18n("Due Time")); |
252 | mListView->addColumn(i18n("Cancelled")); | 260 | mListView->addColumn(i18n("Cancelled")); |
253 | mListView->addColumn(i18n("Categories")); | 261 | mListView->addColumn(i18n("Categories")); |
254 | mListView->addColumn(i18n("Calendar")); | 262 | mListView->addColumn(i18n("Calendar")); |
255 | 263 | ||
256 | mListView->setColumnAlignment(0,AlignLeft); | 264 | mListView->setColumnAlignment(0,AlignLeft); |
257 | mListView->setColumnAlignment(1,AlignLeft); | 265 | mListView->setColumnAlignment(1,AlignLeft); |
258 | mListView->setColumnAlignment(2,AlignHCenter); | 266 | mListView->setColumnAlignment(2,AlignHCenter); |
259 | mListView->setColumnAlignment(3,AlignLeft); | 267 | mListView->setColumnAlignment(3,AlignLeft); |
260 | mListView->setColumnAlignment(4,AlignHCenter); | 268 | mListView->setColumnAlignment(4,AlignHCenter); |
261 | mListView->setColumnAlignment(5,AlignLeft); | 269 | mListView->setColumnAlignment(5,AlignLeft); |
262 | mListView->setColumnAlignment(6,AlignLeft); | 270 | mListView->setColumnAlignment(6,AlignLeft); |
263 | mListView->setColumnAlignment(7,AlignLeft); | 271 | mListView->setColumnAlignment(7,AlignLeft); |
264 | mListView->setColumnAlignment(8,AlignLeft); | 272 | mListView->setColumnAlignment(8,AlignLeft); |