-rw-r--r-- | korganizer/kolistview.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index f8bfc8b..b21b419 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -105,65 +105,65 @@ bool ListItemVisitor::visit(Event *e) | |||
105 | mItem->setText(8,"---"); | 105 | mItem->setText(8,"---"); |
106 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); | 106 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); |
107 | mItem->setText(10,e->categoriesStr()); | 107 | mItem->setText(10,e->categoriesStr()); |
108 | 108 | ||
109 | QString key; | 109 | QString key; |
110 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); | 110 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); |
111 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); | 111 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); |
112 | mItem->setSortKey(1,key); | 112 | mItem->setSortKey(1,key); |
113 | 113 | ||
114 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); | 114 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); |
115 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); | 115 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); |
116 | mItem->setSortKey(3,key); | 116 | mItem->setSortKey(3,key); |
117 | 117 | ||
118 | return true; | 118 | return true; |
119 | } | 119 | } |
120 | 120 | ||
121 | bool ListItemVisitor::visit(Todo *t) | 121 | bool ListItemVisitor::visit(Todo *t) |
122 | { | 122 | { |
123 | mItem->setText(0,i18n("To-Do: %1").arg(t->summary())); | 123 | mItem->setText(0,i18n("To-Do: %1").arg(t->summary())); |
124 | if (t->hasStartDate()) { | 124 | if (t->hasStartDate()) { |
125 | mItem->setText(1,t->dtStartDateStr()); | 125 | mItem->setText(1,t->dtStartDateStr()); |
126 | if (t->doesFloat()) { | 126 | if (t->doesFloat()) { |
127 | mItem->setText(2,"---"); | 127 | mItem->setText(2,"---"); |
128 | } else { | 128 | } else { |
129 | mItem->setText(2,t->dtStartTimeStr()); | 129 | mItem->setText(2,t->dtStartTimeStr()); |
130 | } | 130 | } |
131 | } else { | 131 | } else { |
132 | mItem->setText(1,"---"); | 132 | mItem->setText(1,"---"); |
133 | mItem->setText(2,"---"); | 133 | mItem->setText(2,"---"); |
134 | } | 134 | } |
135 | mItem->setText(3,"---"); | 135 | mItem->setText(3,"---"); |
136 | mItem->setText(4,"---"); | 136 | mItem->setText(4,"---"); |
137 | mItem->setText(5,"---"); | 137 | mItem->setText(5,t->isAlarmEnabled() ? i18n("Yes") : i18n("No")); |
138 | mItem->setText(6,"---"); | 138 | mItem->setText(6,"---"); |
139 | if (t->hasDueDate()) { | 139 | if (t->hasDueDate()) { |
140 | mItem->setText(7,t->dtDueDateStr()); | 140 | mItem->setText(7,t->dtDueDateStr()); |
141 | if (t->doesFloat()) { | 141 | if (t->doesFloat()) { |
142 | mItem->setText(8,"---"); | 142 | mItem->setText(8,"---"); |
143 | } else { | 143 | } else { |
144 | mItem->setText(8,t->dtDueTimeStr()); | 144 | mItem->setText(8,t->dtDueTimeStr()); |
145 | } | 145 | } |
146 | } else { | 146 | } else { |
147 | mItem->setText(7,"---"); | 147 | mItem->setText(7,"---"); |
148 | mItem->setText(8,"---"); | 148 | mItem->setText(8,"---"); |
149 | } | 149 | } |
150 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); | 150 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); |
151 | mItem->setText(10,t->categoriesStr()); | 151 | mItem->setText(10,t->categoriesStr()); |
152 | 152 | ||
153 | QString key; | 153 | QString key; |
154 | QDate d; | 154 | QDate d; |
155 | if (t->hasDueDate()) { | 155 | if (t->hasDueDate()) { |
156 | d = t->dtDue().date(); | 156 | d = t->dtDue().date(); |
157 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); | 157 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); |
158 | 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()); |
159 | mItem->setSortKey(7,key); | 159 | mItem->setSortKey(7,key); |
160 | } | 160 | } |
161 | if ( t->hasStartDate() ) { | 161 | if ( t->hasStartDate() ) { |
162 | d = t->dtStart().date(); | 162 | d = t->dtStart().date(); |
163 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); | 163 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); |
164 | 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()); |
165 | mItem->setSortKey(1,key); | 165 | mItem->setSortKey(1,key); |
166 | } | 166 | } |
167 | return true; | 167 | return true; |
168 | } | 168 | } |
169 | 169 | ||
@@ -194,64 +194,65 @@ bool ListItemVisitor::visit(Journal * j) | |||
194 | return true; | 194 | return true; |
195 | } | 195 | } |
196 | 196 | ||
197 | KOListView::KOListView(Calendar *calendar, QWidget *parent, | 197 | KOListView::KOListView(Calendar *calendar, QWidget *parent, |
198 | const char *name) | 198 | const char *name) |
199 | : KOEventView(calendar, parent, name) | 199 | : KOEventView(calendar, parent, name) |
200 | { | 200 | { |
201 | mActiveItem = 0; | 201 | mActiveItem = 0; |
202 | mListView = new KOListViewListView(this); | 202 | mListView = new KOListViewListView(this); |
203 | mListView->addColumn(i18n("Summary")); | 203 | mListView->addColumn(i18n("Summary")); |
204 | mListView->addColumn(i18n("Start Date")); | 204 | mListView->addColumn(i18n("Start Date")); |
205 | mListView->addColumn(i18n("Start Time")); | 205 | mListView->addColumn(i18n("Start Time")); |
206 | mListView->addColumn(i18n("End Date")); | 206 | mListView->addColumn(i18n("End Date")); |
207 | mListView->addColumn(i18n("End Time")); | 207 | mListView->addColumn(i18n("End Time")); |
208 | mListView->addColumn(i18n("Alarm")); // alarm set? | 208 | mListView->addColumn(i18n("Alarm")); // alarm set? |
209 | mListView->addColumn(i18n("Recurs")); // recurs? | 209 | mListView->addColumn(i18n("Recurs")); // recurs? |
210 | mListView->addColumn(i18n("Due Date")); | 210 | mListView->addColumn(i18n("Due Date")); |
211 | mListView->addColumn(i18n("Due Time")); | 211 | mListView->addColumn(i18n("Due Time")); |
212 | mListView->addColumn(i18n("Cancelled")); | 212 | mListView->addColumn(i18n("Cancelled")); |
213 | mListView->addColumn(i18n("Categories")); | 213 | mListView->addColumn(i18n("Categories")); |
214 | 214 | ||
215 | mListView->setColumnAlignment(0,AlignLeft); | 215 | mListView->setColumnAlignment(0,AlignLeft); |
216 | mListView->setColumnAlignment(1,AlignLeft); | 216 | mListView->setColumnAlignment(1,AlignLeft); |
217 | mListView->setColumnAlignment(2,AlignHCenter); | 217 | mListView->setColumnAlignment(2,AlignHCenter); |
218 | mListView->setColumnAlignment(3,AlignLeft); | 218 | mListView->setColumnAlignment(3,AlignLeft); |
219 | mListView->setColumnAlignment(4,AlignHCenter); | 219 | mListView->setColumnAlignment(4,AlignHCenter); |
220 | mListView->setColumnAlignment(5,AlignLeft); | 220 | mListView->setColumnAlignment(5,AlignLeft); |
221 | mListView->setColumnAlignment(6,AlignLeft); | 221 | mListView->setColumnAlignment(6,AlignLeft); |
222 | mListView->setColumnAlignment(7,AlignLeft); | 222 | mListView->setColumnAlignment(7,AlignLeft); |
223 | mListView->setColumnAlignment(8,AlignLeft); | 223 | mListView->setColumnAlignment(8,AlignLeft); |
224 | mListView->setColumnAlignment(9,AlignLeft); | 224 | mListView->setColumnAlignment(9,AlignLeft); |
225 | mListView->setColumnAlignment(10,AlignLeft); | 225 | mListView->setColumnAlignment(10,AlignLeft); |
226 | mListView->setColumnWidthMode(10, QListView::Manual); | ||
226 | 227 | ||
227 | int iii = 0; | 228 | int iii = 0; |
228 | for ( iii = 0; iii< 10 ; ++iii ) | 229 | for ( iii = 0; iii< 10 ; ++iii ) |
229 | mListView->setColumnWidthMode( iii, QListView::Manual ); | 230 | mListView->setColumnWidthMode( iii, QListView::Manual ); |
230 | 231 | ||
231 | QBoxLayout *layoutTop = new QVBoxLayout(this); | 232 | QBoxLayout *layoutTop = new QVBoxLayout(this); |
232 | layoutTop->addWidget(mListView); | 233 | layoutTop->addWidget(mListView); |
233 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 234 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
234 | mPopupMenu = eventPopup(); | 235 | mPopupMenu = eventPopup(); |
235 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 236 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
236 | i18n("Select all"),this, | 237 | i18n("Select all"),this, |
237 | SLOT(allSelection()),true); | 238 | SLOT(allSelection()),true); |
238 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 239 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
239 | i18n("Deselect All"),this, | 240 | i18n("Deselect All"),this, |
240 | SLOT(clearSelection()),true); | 241 | SLOT(clearSelection()),true); |
241 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 242 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
242 | i18n("Delete all selected"),this, | 243 | i18n("Delete all selected"),this, |
243 | SLOT(deleteAll()),true); | 244 | SLOT(deleteAll()),true); |
244 | mPopupMenu->insertSeparator(); | 245 | mPopupMenu->insertSeparator(); |
245 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 246 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
246 | i18n("Save selected to file..."),this, | 247 | i18n("Save selected to file..."),this, |
247 | SLOT(saveToFile()),true); | 248 | SLOT(saveToFile()),true); |
248 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 249 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
249 | i18n("Save Journal/Description..."),this, | 250 | i18n("Save Journal/Description..."),this, |
250 | SLOT(saveDescriptionToFile()),true); | 251 | SLOT(saveDescriptionToFile()),true); |
251 | mPopupMenu->insertSeparator(); | 252 | mPopupMenu->insertSeparator(); |
252 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 253 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
253 | i18n("Add Categ. to selected..."),this, | 254 | i18n("Add Categ. to selected..."),this, |
254 | SLOT(addCat()),true); | 255 | SLOT(addCat()),true); |
255 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 256 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
256 | i18n("Set Categ. for selected..."),this, | 257 | i18n("Set Categ. for selected..."),this, |
257 | SLOT(setCat()),true); | 258 | SLOT(setCat()),true); |