author | zautrix <zautrix> | 2005-01-19 11:41:45 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-19 11:41:45 (UTC) |
commit | 0d878a0144644499ead17b2532cc94abb545bcdb (patch) (unidiff) | |
tree | 241010225cf2b26847750c5f511ff15a9ebef9e1 /korganizer | |
parent | af56077eeeab7b46b98ad5159c6653114abf6602 (diff) | |
download | kdepimpi-0d878a0144644499ead17b2532cc94abb545bcdb.zip kdepimpi-0d878a0144644499ead17b2532cc94abb545bcdb.tar.gz kdepimpi-0d878a0144644499ead17b2532cc94abb545bcdb.tar.bz2 |
translation added
-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 | |||
@@ -73,217 +73,218 @@ ListItemVisitor::~ListItemVisitor() | |||
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 | QDate ds, de; |
81 | if ( e->doesRecur() ) { | 81 | if ( e->doesRecur() ) { |
82 | ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); | 82 | ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); |
83 | if ( ok ) { | 83 | if ( ok ) { |
84 | int days = e->dtStart().date().daysTo(e->dtEnd().date() ); | 84 | int days = e->dtStart().date().daysTo(e->dtEnd().date() ); |
85 | start = KGlobal::locale()->formatDate(ds,true); | 85 | start = KGlobal::locale()->formatDate(ds,true); |
86 | de = ds.addDays( days); | 86 | de = ds.addDays( days); |
87 | end = KGlobal::locale()->formatDate(de,true); | 87 | end = KGlobal::locale()->formatDate(de,true); |
88 | } | 88 | } |
89 | 89 | ||
90 | } | 90 | } |
91 | if ( ! ok ) { | 91 | if ( ! ok ) { |
92 | start =e->dtStartDateStr(); | 92 | start =e->dtStartDateStr(); |
93 | end = e->dtEndDateStr(); | 93 | end = e->dtEndDateStr(); |
94 | ds = e->dtStart().date(); | 94 | ds = e->dtStart().date(); |
95 | de = e->dtEnd().date(); | 95 | de = e->dtEnd().date(); |
96 | } | 96 | } |
97 | mItem->setText(0,e->summary()); | 97 | mItem->setText(0,e->summary()); |
98 | mItem->setText(1,start); | 98 | mItem->setText(1,start); |
99 | mItem->setText(2,e->dtStartTimeStr()); | 99 | mItem->setText(2,e->dtStartTimeStr()); |
100 | mItem->setText(3,end); | 100 | mItem->setText(3,end); |
101 | mItem->setText(4,e->dtEndTimeStr()); | 101 | mItem->setText(4,e->dtEndTimeStr()); |
102 | mItem->setText(5,e->isAlarmEnabled() ? i18n("Yes") : i18n("No")); | 102 | mItem->setText(5,e->isAlarmEnabled() ? i18n("Yes") : i18n("No")); |
103 | mItem->setText(6, e->recurrence()->recurrenceText()); | 103 | mItem->setText(6, e->recurrence()->recurrenceText()); |
104 | mItem->setText(7,"---"); | 104 | mItem->setText(7,"---"); |
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 | ||
170 | bool ListItemVisitor::visit(Journal * j) | 170 | bool ListItemVisitor::visit(Journal * j) |
171 | { | 171 | { |
172 | QString des = j->description().left(50); | 172 | QString des = j->description().left(50); |
173 | des = des.simplifyWhiteSpace (); | 173 | des = des.simplifyWhiteSpace (); |
174 | des.replace (QRegExp ("\\n"),"" ); | 174 | des.replace (QRegExp ("\\n"),"" ); |
175 | des.replace (QRegExp ("\\r"),"" ); | 175 | des.replace (QRegExp ("\\r"),"" ); |
176 | mItem->setText(0,i18n("Journal")+": "+des.left(25)); | 176 | mItem->setText(0,i18n("Journal")+": "+des.left(25)); |
177 | mItem->setText(1,j->dtStartDateStr()); | 177 | mItem->setText(1,j->dtStartDateStr()); |
178 | mItem->setText(2,"---"); | 178 | mItem->setText(2,"---"); |
179 | mItem->setText(3,"---"); | 179 | mItem->setText(3,"---"); |
180 | mItem->setText(4,"---"); | 180 | mItem->setText(4,"---"); |
181 | mItem->setText(5,"---"); | 181 | mItem->setText(5,"---"); |
182 | mItem->setText(6,"---"); | 182 | mItem->setText(6,"---"); |
183 | mItem->setText(7,j->dtStartDateStr()); | 183 | mItem->setText(7,j->dtStartDateStr()); |
184 | mItem->setText(8,"---"); | 184 | mItem->setText(8,"---"); |
185 | mItem->setText(9,"---"); | 185 | mItem->setText(9,"---"); |
186 | 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) ); |
187 | 187 | ||
188 | QString key; | 188 | QString key; |
189 | QDate d = j->dtStart().date(); | 189 | QDate d = j->dtStart().date(); |
190 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 190 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
191 | mItem->setSortKey(1,key); | 191 | mItem->setSortKey(1,key); |
192 | mItem->setSortKey(7,key); | 192 | mItem->setSortKey(7,key); |
193 | 193 | ||
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); |
258 | mPopupMenu->insertSeparator(); | 259 | mPopupMenu->insertSeparator(); |
259 | 260 | ||
260 | 261 | ||
261 | #ifndef DESKTOP_VERSION | 262 | #ifndef DESKTOP_VERSION |
262 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 263 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
263 | i18n("Beam selected via IR"),this, | 264 | i18n("Beam selected via IR"),this, |
264 | SLOT(beamSelected()),true); | 265 | SLOT(beamSelected()),true); |
265 | #endif | 266 | #endif |
266 | /* | 267 | /* |
267 | mPopupMenu = new QPopupMenu; | 268 | mPopupMenu = new QPopupMenu; |
268 | mPopupMenu->insertItem(i18n("Edit Event"), this, | 269 | mPopupMenu->insertItem(i18n("Edit Event"), this, |
269 | SLOT (editEvent())); | 270 | SLOT (editEvent())); |
270 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, | 271 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, |
271 | SLOT (deleteEvent())); | 272 | SLOT (deleteEvent())); |
272 | mPopupMenu->insertSeparator(); | 273 | mPopupMenu->insertSeparator(); |
273 | mPopupMenu->insertItem(i18n("Show Dates"), this, | 274 | mPopupMenu->insertItem(i18n("Show Dates"), this, |
274 | SLOT(showDates())); | 275 | SLOT(showDates())); |
275 | mPopupMenu->insertItem(i18n("Hide Dates"), this, | 276 | mPopupMenu->insertItem(i18n("Hide Dates"), this, |
276 | SLOT(hideDates())); | 277 | SLOT(hideDates())); |
277 | */ | 278 | */ |
278 | QObject::connect(mListView,SIGNAL( newEvent()), | 279 | QObject::connect(mListView,SIGNAL( newEvent()), |
279 | this,SIGNAL(signalNewEvent())); | 280 | this,SIGNAL(signalNewEvent())); |
280 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), | 281 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), |
281 | this,SLOT(defaultItemAction(QListViewItem *))); | 282 | this,SLOT(defaultItemAction(QListViewItem *))); |
282 | QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *, | 283 | QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *, |
283 | const QPoint &, int )), | 284 | const QPoint &, int )), |
284 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); | 285 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); |
285 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), | 286 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), |
286 | SLOT(processSelectionChange(QListViewItem *))); | 287 | SLOT(processSelectionChange(QListViewItem *))); |
287 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), | 288 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), |
288 | SIGNAL(showIncidenceSignal(Incidence *)) ); | 289 | SIGNAL(showIncidenceSignal(Incidence *)) ); |
289 | 290 | ||