summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt10
-rw-r--r--korganizer/koeventviewer.cpp14
-rw-r--r--korganizer/kolistview.cpp14
-rw-r--r--korganizer/kotodoview.cpp26
-rw-r--r--libkcal/alarm.cpp24
-rw-r--r--libkcal/alarm.h1
-rw-r--r--libkcal/kincidenceformatter.cpp14
7 files changed, 83 insertions, 20 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index fbab7dd..6b739ba 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1325,19 +1325,19 @@
1325{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, 1325{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." },
1326{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, 1326{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." },
1327{ "Printout Mode","Druck Modus" }, 1327{ "Printout Mode","Druck Modus" },
1328{ "Filter menu icon","Filtermenu Icon" }, 1328{ "Filter menu icon","Filtermenu Icon" },
1329{ "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" }, 1329{ "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" },
1330{ "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" }, 1330{ "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" },
1331{ "%1d","%1t" },
1332{ "%1h","%1std" },
1333{ "%1min","%1min" },
1334{ "( %1 before )","( %1 vorher )" },
1331{ "","" }, 1335{ "","" },
1332{ "","" }, 1336{ "","" },
1333{ "","" }, 1337{ "","" },
1334{ "","" }, 1338{ "","" },
1335{ "","" }, 1339{ "","" },
1336{ "","" }, 1340{ "","" },
1337{ "","" }, 1341{ "","" },
1338{ "","" }, 1342{ "","" },
1339{ "","" }, 1343{ "","" } \ No newline at end of file
1340{ "","" },
1341{ "","" },
1342{ "","" },
1343{ "","" }, \ No newline at end of file
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index dbe0668..bdad248 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -367,14 +367,13 @@ void KOEventViewer::appendEvent(Event *event, int mode )
367 } 367 }
368 368
369 369
370 if (event->isAlarmEnabled()) { 370 if (event->isAlarmEnabled()) {
371 Alarm *alarm =event->alarms().first() ; 371 Alarm *alarm =event->alarms().first() ;
372 QDateTime t = alarm->time(); 372 QDateTime t = alarm->time();
373 int min = t.secsTo( event->dtStart() )/60; 373 QString s =i18n("( %1 before )").arg( alarm->offsetText() );
374 QString s =i18n("( %1 min before )").arg( min );
375 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); 374 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
376 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 375 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
377 //addTag("p",s); 376 //addTag("p",s);
378 } 377 }
379 378
380 addTag("b",i18n("Access: ")); 379 addTag("b",i18n("Access: "));
@@ -466,12 +465,23 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
466 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); 465 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
467 } 466 }
468 if (event->hasDueDate()) { 467 if (event->hasDueDate()) {
469 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); 468 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
470 mMailSubject += i18n(" - " )+event->dtDueStr( true ); 469 mMailSubject += i18n(" - " )+event->dtDueStr( true );
471 } 470 }
471
472
473 if (event->isAlarmEnabled()) {
474 Alarm *alarm =event->alarms().first() ;
475 QDateTime t = alarm->time();
476 QString s =i18n("( %1 before )").arg( alarm->offsetText() );
477 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
478 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
479 //addTag("p",s);
480 }
481
472 addTag("b",i18n("Access: ")); 482 addTag("b",i18n("Access: "));
473 mText.append(event->secrecyStr()+"<br>"); 483 mText.append(event->secrecyStr()+"<br>");
474 if ( KOPrefs::instance()->mEVshowDetails ) { 484 if ( KOPrefs::instance()->mEVshowDetails ) {
475 if (!event->description().isEmpty()) { 485 if (!event->description().isEmpty()) {
476 addTag("p",i18n("<b>Details: </b>")); 486 addTag("p",i18n("<b>Details: </b>"));
477 addTag("p",deTag(event->description())); 487 addTag("p",deTag(event->description()));
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 15e094d..e0e138e 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -117,13 +117,17 @@ bool ListItemVisitor::visit(Event *e)
117 } 117 }
118 mItem->setText(0,e->summary()); 118 mItem->setText(0,e->summary());
119 mItem->setText(1,start); 119 mItem->setText(1,start);
120 mItem->setText(2,e->dtStartTimeStr()); 120 mItem->setText(2,e->dtStartTimeStr());
121 mItem->setText(3,end); 121 mItem->setText(3,end);
122 mItem->setText(4,e->dtEndTimeStr()); 122 mItem->setText(4,e->dtEndTimeStr());
123 mItem->setText(5,e->isAlarmEnabled() ? i18n("Yes") : i18n("No")); 123 if ( e->isAlarmEnabled() ) {
124 mItem->setText(5,e->alarms().first()->offsetText() );
125 } else {
126 mItem->setText(5, i18n("No"));
127 }
124 mItem->setText(6, e->recurrence()->recurrenceText()); 128 mItem->setText(6, e->recurrence()->recurrenceText());
125 mItem->setText(7,"---"); 129 mItem->setText(7,"---");
126 mItem->setText(8,"---"); 130 mItem->setText(8,"---");
127 mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); 131 mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No"));
128 mItem->setText(10,e->categoriesStr()); 132 mItem->setText(10,e->categoriesStr());
129 133
@@ -151,14 +155,18 @@ bool ListItemVisitor::visit(Todo *t)
151 } 155 }
152 } else { 156 } else {
153 mItem->setText(1,"---"); 157 mItem->setText(1,"---");
154 mItem->setText(2,"---"); 158 mItem->setText(2,"---");
155 } 159 }
156 mItem->setText(3,"---"); 160 mItem->setText(3,"---");
157 mItem->setText(4,"---"); 161 mItem->setText(4,"---");
158 mItem->setText(5,t->isAlarmEnabled() ? i18n("Yes") : i18n("No")); 162 if ( t->isAlarmEnabled() ) {
163 mItem->setText(5,t->alarms().first()->offsetText() );
164 } else {
165 mItem->setText(5, i18n("No"));
166 }
159 mItem->setText(6, t->recurrence()->recurrenceText()); 167 mItem->setText(6, t->recurrence()->recurrenceText());
160 if (t->hasDueDate()) { 168 if (t->hasDueDate()) {
161 mItem->setText(7,t->dtDueDateStr()); 169 mItem->setText(7,t->dtDueDateStr());
162 if (t->doesFloat()) { 170 if (t->doesFloat()) {
163 mItem->setText(8,"---"); 171 mItem->setText(8,"---");
164 } else { 172 } else {
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 0a315cb..01cf0ff 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -215,16 +215,18 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e)
215 // if the user clicked into the root decoration of the item, don't 215 // if the user clicked into the root decoration of the item, don't
216 // try to start a drag! 216 // try to start a drag!
217 int X = p.x(); 217 int X = p.x();
218 //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() ); 218 //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() );
219 if (X > header()->sectionPos(0) + 219 if (X > header()->sectionPos(0) +
220 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + 220 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) +
221 itemMargin() || 221 itemMargin() +i->height()||
222 X < header()->sectionPos(0)) { 222 X < header()->sectionPos(0)) {
223 rootClicked = false; 223 rootClicked = false;
224 } 224 }
225 } else {
226 rootClicked = false;
225 } 227 }
226#ifndef KORG_NODND 228#ifndef KORG_NODND
227 mMousePressed = false; 229 mMousePressed = false;
228 if (! rootClicked ) { 230 if (! rootClicked ) {
229 mPressPos = e->pos(); 231 mPressPos = e->pos();
230 mMousePressed = true; 232 mMousePressed = true;
@@ -727,15 +729,15 @@ void KOTodoView::storeCurrentItem()
727 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 729 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
728 if (mActiveItem) { 730 if (mActiveItem) {
729 mCurItem = mActiveItem->todo(); 731 mCurItem = mActiveItem->todo();
730 KOTodoViewItem* activeItemAbove = (KOTodoViewItem*)mActiveItem->itemAbove (); 732 KOTodoViewItem* activeItemAbove = (KOTodoViewItem*)mActiveItem->itemAbove ();
731 if ( activeItemAbove ) 733 if ( activeItemAbove )
732 mCurItemAbove = activeItemAbove->todo(); 734 mCurItemAbove = activeItemAbove->todo();
733 while ( mActiveItem->parent() != 0 ) 735 mCurItemRootParent = mCurItem;
734 mActiveItem = (KOTodoViewItem*)mActiveItem->parent(); 736 while ( mCurItemRootParent->relatedTo() != 0 )
735 mCurItemRootParent = mActiveItem->todo(); 737 mCurItemRootParent = mCurItemRootParent->relatedTo();
736 } 738 }
737 mActiveItem = 0; 739 mActiveItem = 0;
738} 740}
739 741
740void KOTodoView::resetCurrentItem() 742void KOTodoView::resetCurrentItem()
741{ 743{
@@ -756,16 +758,16 @@ void KOTodoView::resetCurrentItem()
756 } else if ( item->todo() == mCurItemRootParent ) { 758 } else if ( item->todo() == mCurItemRootParent ) {
757 foundItemRoot = item; 759 foundItemRoot = item;
758 } 760 }
759 item = (KOTodoViewItem*)item->itemBelow(); 761 item = (KOTodoViewItem*)item->itemBelow();
760 } 762 }
761 if ( ! foundItem ) { 763 if ( ! foundItem ) {
762 if ( foundItemAbove ) 764 if ( foundItemRoot )
763 foundItem = foundItemAbove;
764 else
765 foundItem = foundItemRoot; 765 foundItem = foundItemRoot;
766 else
767 foundItem = foundItemAbove;
766 } 768 }
767 } 769 }
768 if ( foundItem ) { 770 if ( foundItem ) {
769 mTodoListView->setCurrentItem( foundItem ); 771 mTodoListView->setCurrentItem( foundItem );
770 mTodoListView->ensureItemVisible( foundItem ); 772 mTodoListView->ensureItemVisible( foundItem );
771 } else { 773 } else {
@@ -1202,23 +1204,29 @@ void KOTodoView::clearSelection()
1202void KOTodoView::setAllOpen() 1204void KOTodoView::setAllOpen()
1203{ 1205{
1204 if ( isFlatDisplay ) { 1206 if ( isFlatDisplay ) {
1205 isFlatDisplay = false; 1207 isFlatDisplay = false;
1206 mPopupMenu->setItemChecked( 8,false ); 1208 mPopupMenu->setItemChecked( 8,false );
1207 updateView(); 1209 updateView();
1210 } else {
1211 storeCurrentItem();
1208 } 1212 }
1209 setOpen(mTodoListView->firstChild(), true); 1213 setOpen(mTodoListView->firstChild(), true);
1214 resetCurrentItem();
1210} 1215}
1211void KOTodoView::setAllClose() 1216void KOTodoView::setAllClose()
1212{ 1217{
1213 if ( isFlatDisplay ) { 1218 if ( isFlatDisplay ) {
1214 isFlatDisplay = false; 1219 isFlatDisplay = false;
1215 mPopupMenu->setItemChecked( 8,false ); 1220 mPopupMenu->setItemChecked( 8,false );
1216 updateView(); 1221 updateView();
1222 } else {
1223 storeCurrentItem();
1217 } 1224 }
1218 setOpen(mTodoListView->firstChild(), false); 1225 setOpen(mTodoListView->firstChild(), false);
1226 resetCurrentItem();
1219} 1227}
1220void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) 1228void KOTodoView::setOpen( QListViewItem* item, bool setOpenI)
1221{ 1229{
1222 1230
1223 while ( item ) { 1231 while ( item ) {
1224 setOpen( item->firstChild(), setOpenI ); 1232 setOpen( item->firstChild(), setOpenI );
@@ -1251,14 +1259,16 @@ void KOTodoView::setAllFlat()
1251{ 1259{
1252 if ( isFlatDisplay ) { 1260 if ( isFlatDisplay ) {
1253 isFlatDisplay = false; 1261 isFlatDisplay = false;
1254 mPopupMenu->setItemChecked( 8,false ); 1262 mPopupMenu->setItemChecked( 8,false );
1255 updateView(); 1263 updateView();
1256 return; 1264 return;
1257 } 1265 }
1266 storeCurrentItem();
1258 displayAllFlat(); 1267 displayAllFlat();
1268 resetCurrentItem();
1259} 1269}
1260 1270
1261void KOTodoView::purgeCompleted() 1271void KOTodoView::purgeCompleted()
1262{ 1272{
1263 emit purgeCompletedSignal(); 1273 emit purgeCompletedSignal();
1264} 1274}
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp
index 1fc7169..d8f15b5 100644
--- a/libkcal/alarm.cpp
+++ b/libkcal/alarm.cpp
@@ -17,12 +17,13 @@
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <kdebug.h> 22#include <kdebug.h>
23#include <klocale.h>
23 24
24#include "incidence.h" 25#include "incidence.h"
25#include "todo.h" 26#include "todo.h"
26 27
27#include "alarm.h" 28#include "alarm.h"
28 29
@@ -346,12 +347,35 @@ int Alarm::offset()
346 else 347 else
347 { 348 {
348 return mOffset.asSeconds(); 349 return mOffset.asSeconds();
349 } 350 }
350 351
351} 352}
353QString Alarm::offsetText()
354{
355 int min = -offset()/60;
356 int hours = min /60;
357 min = min % 60;
358 int days = hours /24;
359 hours = hours % 24;
360 QString message;
361 qDebug("%d %d %d ", days, hours, min );
362 if ( days > 0 )
363 message += i18n("%1d").arg( days );
364 if ( hours > 0 ) {
365 if ( !message.isEmpty() ) message += "/";
366 message += i18n("%1h").arg( hours );
367 }
368 if ( min > 0 ) {
369 if ( !message.isEmpty() ) message += "/";
370 message += i18n("%1min").arg( min );
371 }
372 if ( message.isEmpty() )
373 message = i18n("%1min").arg( 0 );
374 return message;
375}
352 376
353 377
354QDateTime Alarm::time() const 378QDateTime Alarm::time() const
355{ 379{
356 if ( hasTime() ) 380 if ( hasTime() )
357 return mAlarmTime; 381 return mAlarmTime;
diff --git a/libkcal/alarm.h b/libkcal/alarm.h
index 682b626..ac6ea0d 100644
--- a/libkcal/alarm.h
+++ b/libkcal/alarm.h
@@ -56,12 +56,13 @@ class Alarm : public CustomProperties
56 @param type type of alarm. 56 @param type type of alarm.
57 */ 57 */
58 void setType(Type type); 58 void setType(Type type);
59 /** Return the type of the alarm */ 59 /** Return the type of the alarm */
60 Type type() const; 60 Type type() const;
61 int offset(); 61 int offset();
62 QString offsetText();
62 /** Set the alarm to be a display alarm. 63 /** Set the alarm to be a display alarm.
63 @param text text to display when the alarm is triggered. 64 @param text text to display when the alarm is triggered.
64 */ 65 */
65 void setDisplayAlarm(const QString &text); 66 void setDisplayAlarm(const QString &text);
66 /** Set the text to be displayed when the alarm is triggered. 67 /** Set the text to be displayed when the alarm is triggered.
67 Ignored if the alarm is not a display alarm. 68 Ignored if the alarm is not a display alarm.
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index e506a96..d67ad52 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -128,19 +128,20 @@ void KIncidenceFormatter::setEvent(Event *event)
128 } 128 }
129 129
130 130
131 if (event->isAlarmEnabled()) { 131 if (event->isAlarmEnabled()) {
132 Alarm *alarm =event->alarms().first() ; 132 Alarm *alarm =event->alarms().first() ;
133 QDateTime t = alarm->time(); 133 QDateTime t = alarm->time();
134 int min = t.secsTo( event->dtStart() )/60; 134 QString s =i18n("( %1 before )").arg( alarm->offsetText() );
135 QString s =i18n("(%1 min before)").arg( min );
136 addTag("p",i18n("<b>Alarm on: </b>") + s + ": "+KGlobal::locale()->formatDateTime( t, shortDate )); 135 addTag("p",i18n("<b>Alarm on: </b>") + s + ": "+KGlobal::locale()->formatDateTime( t, shortDate ));
137 //addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 136 //addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
138 //addTag("p",s); 137 //addTag("p",s);
139 } 138 }
140 139
140
141
141 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); 142 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
142 // mText.append(event->secrecyStr()+"<br>"); 143 // mText.append(event->secrecyStr()+"<br>");
143 formatCategories(event); 144 formatCategories(event);
144 if ( mDetails ) { 145 if ( mDetails ) {
145 if (!event->description().isEmpty()) { 146 if (!event->description().isEmpty()) {
146 addTag("p",i18n("<b>Details: </b>")); 147 addTag("p",i18n("<b>Details: </b>"));
@@ -221,12 +222,21 @@ void KIncidenceFormatter::setTodo(Todo *event )
221 if (event->hasDueDate()) { 222 if (event->hasDueDate()) {
222 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate))); 223 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate)));
223 } 224 }
224 mText.append(i18n("<p><b>Priority:</b> %2</p>") 225 mText.append(i18n("<p><b>Priority:</b> %2</p>")
225 .arg(QString::number(event->priority()))); 226 .arg(QString::number(event->priority())));
226 227
228 if (event->isAlarmEnabled()) {
229 Alarm *alarm =event->alarms().first() ;
230 QDateTime t = alarm->time();
231 QString s =i18n("( %1 before )").arg( alarm->offsetText() );
232 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
233 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
234 //addTag("p",s);
235 }
236
227 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); 237 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
228 formatCategories(event); 238 formatCategories(event);
229 if ( mDetails ) { 239 if ( mDetails ) {
230 if (!event->description().isEmpty()) { 240 if (!event->description().isEmpty()) {
231 addTag("p",i18n("<b>Details: </b>")); 241 addTag("p",i18n("<b>Details: </b>"));
232 addTag("p",deTag(event->description())); 242 addTag("p",deTag(event->description()));