summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-02-17 21:31:18 (UTC)
committer zautrix <zautrix>2005-02-17 21:31:18 (UTC)
commit8e8d2bd0c31eb272a7f26756252ff4930d0602bc (patch) (unidiff)
tree8392e9ca561d1444bcd949e9f1aaf78f698cde98 /korganizer
parent002e4f8cea2352e4b9a046b98f66be946fbeb5fc (diff)
downloadkdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.zip
kdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.tar.gz
kdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.tar.bz2
fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp5
-rw-r--r--korganizer/koeventviewer.cpp31
-rw-r--r--korganizer/kolistview.cpp5
-rw-r--r--korganizer/komonthview.cpp6
-rw-r--r--korganizer/koprefs.cpp8
-rw-r--r--korganizer/koprefs.h8
-rw-r--r--korganizer/koprefsdialog.cpp32
-rw-r--r--korganizer/kotodoview.cpp5
8 files changed, 86 insertions, 14 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 6a312b3..cead612 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -69,49 +69,52 @@ protected:
69private: 69private:
70 KOAgendaItem * _view; 70 KOAgendaItem * _view;
71}; 71};
72 72
73KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, 73KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday,
74 const char *name,WFlags) : 74 const char *name,WFlags) :
75 QWidget(parent, name), mIncidence(incidence), mDate(qd) 75 QWidget(parent, name), mIncidence(incidence), mDate(qd)
76{ 76{
77#ifndef DESKTOP_VERSION 77#ifndef DESKTOP_VERSION
78 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); 78 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
79#endif 79#endif
80 new KOAgendaItemWhatsThis(this); 80 new KOAgendaItemWhatsThis(this);
81 int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase 81 int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase
82 setWFlags ( wflags); 82 setWFlags ( wflags);
83 mAllDay = allday; 83 mAllDay = allday;
84 init ( incidence, qd ); 84 init ( incidence, qd );
85 setMouseTracking(true); 85 setMouseTracking(true);
86 //setAcceptDrops(true); 86 //setAcceptDrops(true);
87 xPaintCoord = -1; 87 xPaintCoord = -1;
88 yPaintCoord = -1; 88 yPaintCoord = -1;
89} 89}
90QString KOAgendaItem::getWhatsThisText() 90QString KOAgendaItem::getWhatsThisText()
91{ 91{
92 if ( mIncidence ) 92 if ( mIncidence )
93 return KIncidenceFormatter::instance()->getFormattedText( mIncidence ); 93 return KIncidenceFormatter::instance()->getFormattedText( mIncidence,
94 KOPrefs::instance()->mWTshowDetails,
95 KOPrefs::instance()->mWTshowCreated,
96 KOPrefs::instance()->mWTshowChanged);
94 return "KOAgendaItem::getWhatsThisText()::internal error"; 97 return "KOAgendaItem::getWhatsThisText()::internal error";
95} 98}
96void KOAgendaItem::init ( Incidence *incidence, QDate qd ) 99void KOAgendaItem::init ( Incidence *incidence, QDate qd )
97{ 100{
98 mIncidence = incidence; 101 mIncidence = incidence;
99 mDate = qd; 102 mDate = qd;
100 mFirstMultiItem = 0; 103 mFirstMultiItem = 0;
101 mNextMultiItem = 0; 104 mNextMultiItem = 0;
102 mLastMultiItem = 0; 105 mLastMultiItem = 0;
103 computeText(); 106 computeText();
104 107
105 if ( (incidence->type() == "Todo") && 108 if ( (incidence->type() == "Todo") &&
106 ( !((static_cast<Todo*>(incidence))->isCompleted()) && 109 ( !((static_cast<Todo*>(incidence))->isCompleted()) &&
107 ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) { 110 ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) {
108 if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date()) 111 if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date())
109 mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; 112 mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ;
110 else 113 else
111 mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; 114 mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor;
112 } 115 }
113 else { 116 else {
114 QStringList categories = mIncidence->categories(); 117 QStringList categories = mIncidence->categories();
115 QString cat = categories.first(); 118 QString cat = categories.first();
116 if (cat.isEmpty()) { 119 if (cat.isEmpty()) {
117 if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) 120 if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) )
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index f6c9624..d87938a 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -318,58 +318,71 @@ void KOEventViewer::appendEvent(Event *event, int mode )
318 nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); 318 nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last );
319 if ( last ) { 319 if ( last ) {
320 addTag("p",i18n("<b>Last recurrence was on:</b>") ); 320 addTag("p",i18n("<b>Last recurrence was on:</b>") );
321 addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); 321 addTag("p", KGlobal::locale()->formatDate( nextd, shortDate ));
322 } 322 }
323 } 323 }
324 } else { 324 } else {
325 mMailSubject += i18n(" - " )+event->dtStartStr( true ); 325 mMailSubject += i18n(" - " )+event->dtStartStr( true );
326 326
327 } 327 }
328 328
329 329
330 if (event->isAlarmEnabled()) { 330 if (event->isAlarmEnabled()) {
331 Alarm *alarm =event->alarms().first() ; 331 Alarm *alarm =event->alarms().first() ;
332 QDateTime t = alarm->time(); 332 QDateTime t = alarm->time();
333 int min = t.secsTo( event->dtStart() )/60; 333 int min = t.secsTo( event->dtStart() )/60;
334 QString s =i18n("( %1 min before )").arg( min ); 334 QString s =i18n("( %1 min before )").arg( min );
335 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); 335 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
336 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 336 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
337 //addTag("p",s); 337 //addTag("p",s);
338 } 338 }
339 339
340 addTag("b",i18n("Access: ")); 340 addTag("b",i18n("Access: "));
341 mText.append(event->secrecyStr()+"<br>"); 341 mText.append(event->secrecyStr()+"<br>");
342 if (!event->description().isEmpty()) { 342
343 addTag("p",i18n("<b>Details: </b>"));
344 addTag("p",event->description());
345 }
346 343
344 if ( KOPrefs::instance()->mEVshowDetails ) {
345 if (!event->description().isEmpty()) {
346 addTag("p",i18n("<b>Details: </b>"));
347 addTag("p",event->description());
348 }
349 }
347 formatCategories(event); 350 formatCategories(event);
348 351
349 formatReadOnly(event); 352 formatReadOnly(event);
350 formatAttendees(event); 353 formatAttendees(event);
351 354
355 if ( KOPrefs::instance()->mEVshowCreated ) {
356 addTag("p",i18n("<b>Created: ") +" </b>");
357 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
358
359 }
360 if ( KOPrefs::instance()->mEVshowChanged ) {
361 addTag("p",i18n("<b>Last modified: ") +" </b>");
362 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
363
364 }
352 setText(mText); 365 setText(mText);
353 //QWhatsThis::add(this,mText); 366 //QWhatsThis::add(this,mText);
354 367
355} 368}
356 369
357void KOEventViewer::appendTodo(Todo *event, int mode ) 370void KOEventViewer::appendTodo(Todo *event, int mode )
358{ 371{
359 mMailSubject = ""; 372 mMailSubject = "";
360 mCurrentIncidence = event; 373 mCurrentIncidence = event;
361 topLevelWidget()->setCaption(i18n("Todo Viewer")); 374 topLevelWidget()->setCaption(i18n("Todo Viewer"));
362 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 375 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
363 if (mode == 0 ) 376 if (mode == 0 )
364 addTag("h2",event->summary()); 377 addTag("h2",event->summary());
365 else { 378 else {
366 if ( mColorMode == 1 ) { 379 if ( mColorMode == 1 ) {
367 mText +="<font color=\"#00A000\">"; 380 mText +="<font color=\"#00A000\">";
368 } 381 }
369 if ( mColorMode == 2 ) { 382 if ( mColorMode == 2 ) {
370 mText +="<font color=\"#B00000\">"; 383 mText +="<font color=\"#B00000\">";
371 } 384 }
372 if ( mode == 1 ) { 385 if ( mode == 1 ) {
373 addTag("h2",i18n( "Local: " ) +event->summary()); 386 addTag("h2",i18n( "Local: " ) +event->summary());
374 } else { 387 } else {
375 addTag("h2",i18n( "Remote: " ) +event->summary()); 388 addTag("h2",i18n( "Remote: " ) +event->summary());
@@ -397,51 +410,53 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
397 mMailSubject += i18n("(cancelled)"); 410 mMailSubject += i18n("(cancelled)");
398 } 411 }
399 412
400 if (!event->location().isEmpty()) { 413 if (!event->location().isEmpty()) {
401 addTag("b",i18n("Location: ")); 414 addTag("b",i18n("Location: "));
402 mText.append(event->location()+"<br>"); 415 mText.append(event->location()+"<br>");
403 mMailSubject += i18n(" at ") + event->location(); 416 mMailSubject += i18n(" at ") + event->location();
404 } 417 }
405 418
406 if (event->recurrence()->doesRecur()) { 419 if (event->recurrence()->doesRecur()) {
407 420
408 QString recurText = event->recurrence()->recurrenceText(); 421 QString recurText = event->recurrence()->recurrenceText();
409 addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); 422 addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>");
410 423
411 } 424 }
412 if (event->hasStartDate()) { 425 if (event->hasStartDate()) {
413 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); 426 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
414 } 427 }
415 if (event->hasDueDate()) { 428 if (event->hasDueDate()) {
416 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); 429 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
417 mMailSubject += i18n(" - " )+event->dtDueStr( true ); 430 mMailSubject += i18n(" - " )+event->dtDueStr( true );
418 } 431 }
419 addTag("b",i18n("Access: ")); 432 addTag("b",i18n("Access: "));
420 mText.append(event->secrecyStr()+"<br>"); 433 mText.append(event->secrecyStr()+"<br>");
421 if (!event->description().isEmpty()) { 434 if ( KOPrefs::instance()->mEVshowDetails ) {
422 addTag("p",i18n("<b>Details: </b>")); 435 if (!event->description().isEmpty()) {
423 addTag("p",event->description()); 436 addTag("p",i18n("<b>Details: </b>"));
437 addTag("p",event->description());
438 }
424 } 439 }
425 440
426 formatCategories(event); 441 formatCategories(event);
427 442
428 mText.append(i18n("<p><b>Priority:</b> %2</p>") 443 mText.append(i18n("<p><b>Priority:</b> %2</p>")
429 .arg(QString::number(event->priority()))); 444 .arg(QString::number(event->priority())));
430 445
431 formatReadOnly(event); 446 formatReadOnly(event);
432 formatAttendees(event); 447 formatAttendees(event);
433 if ( event->relatedTo() ) { 448 if ( event->relatedTo() ) {
434 addTag("b",i18n("Parent todo:<br>")); 449 addTag("b",i18n("Parent todo:<br>"));
435 mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); 450 mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>");
436 } 451 }
437 QPtrList<Incidence> Relations = event->relations(); 452 QPtrList<Incidence> Relations = event->relations();
438 Incidence *to; 453 Incidence *to;
439 if ( Relations.first() ) 454 if ( Relations.first() )
440 addTag("b",i18n("Sub todos:<br>")); 455 addTag("b",i18n("Sub todos:<br>"));
441 for (to=Relations.first();to;to=Relations.next()) { 456 for (to=Relations.first();to;to=Relations.next()) {
442 mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); 457 mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>");
443 458
444 } 459 }
445 setText(mText); 460 setText(mText);
446} 461}
447 462
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index d8e940b..1f5afc0 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -304,49 +304,52 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
304 */ 304 */
305 QObject::connect(mListView,SIGNAL( newEvent()), 305 QObject::connect(mListView,SIGNAL( newEvent()),
306 this,SIGNAL(signalNewEvent())); 306 this,SIGNAL(signalNewEvent()));
307 QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), 307 QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)),
308 this,SLOT(defaultItemAction(QListViewItem *))); 308 this,SLOT(defaultItemAction(QListViewItem *)));
309 QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *, 309 QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *,
310 const QPoint &, int )), 310 const QPoint &, int )),
311 this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); 311 this,SLOT(popupMenu(QListViewItem *,const QPoint &,int)));
312 QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), 312 QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)),
313 SLOT(processSelectionChange(QListViewItem *))); 313 SLOT(processSelectionChange(QListViewItem *)));
314 QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), 314 QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)),
315 SIGNAL(showIncidenceSignal(Incidence *)) ); 315 SIGNAL(showIncidenceSignal(Incidence *)) );
316 316
317 readSettings(KOGlobals::config(),"KOListView Layout"); 317 readSettings(KOGlobals::config(),"KOListView Layout");
318} 318}
319 319
320KOListView::~KOListView() 320KOListView::~KOListView()
321{ 321{
322 delete mPopupMenu; 322 delete mPopupMenu;
323} 323}
324QString KOListView::getWhatsThisText(QPoint p) 324QString KOListView::getWhatsThisText(QPoint p)
325{ 325{
326 KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p ); 326 KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p );
327 if ( item ) 327 if ( item )
328 return KIncidenceFormatter::instance()->getFormattedText( item->data() ); 328 return KIncidenceFormatter::instance()->getFormattedText( item->data(),
329 KOPrefs::instance()->mWTshowDetails,
330 KOPrefs::instance()->mWTshowCreated,
331 KOPrefs::instance()->mWTshowChanged);
329 return i18n("That is the list view" ); 332 return i18n("That is the list view" );
330 333
331} 334}
332 335
333void KOListView::updateList() 336void KOListView::updateList()
334{ 337{
335 // qDebug(" KOListView::updateList() "); 338 // qDebug(" KOListView::updateList() ");
336 339
337} 340}
338 341
339void KOListView::addCat( ) 342void KOListView::addCat( )
340{ 343{
341 setCategories( false ); 344 setCategories( false );
342} 345}
343void KOListView::setCat() 346void KOListView::setCat()
344{ 347{
345 setCategories( true ); 348 setCategories( true );
346} 349}
347void KOListView::setAlarm() 350void KOListView::setAlarm()
348{ 351{
349 KOAlarmPrefs kap( this); 352 KOAlarmPrefs kap( this);
350 if ( !kap.exec() ) 353 if ( !kap.exec() )
351 return; 354 return;
352 355
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index f9bc1ca..2fe80af 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -73,49 +73,52 @@ protected:
73private: 73private:
74 KNoScrollListBox* _wid; 74 KNoScrollListBox* _wid;
75 75
76}; 76};
77 77
78 78
79KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) 79KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
80 : QListBox(parent, name, WRepaintNoErase) 80 : QListBox(parent, name, WRepaintNoErase)
81{ 81{
82#ifndef DESKTOP_VERSION 82#ifndef DESKTOP_VERSION
83 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 83 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
84#endif 84#endif
85 mWT = new KNOWhatsThis(this); 85 mWT = new KNOWhatsThis(this);
86} 86}
87KNoScrollListBox::~KNoScrollListBox() 87KNoScrollListBox::~KNoScrollListBox()
88{ 88{
89 89
90} 90}
91QString KNoScrollListBox::getWhatsThisText(QPoint p) 91QString KNoScrollListBox::getWhatsThisText(QPoint p)
92{ 92{
93 QListBoxItem* item = itemAt ( p ); 93 QListBoxItem* item = itemAt ( p );
94 if ( ! item ) { 94 if ( ! item ) {
95 return i18n("Click in the cell\nto add an event!"); 95 return i18n("Click in the cell\nto add an event!");
96 } 96 }
97 return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence()); 97 return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence(),
98 KOPrefs::instance()->mWTshowDetails,
99 KOPrefs::instance()->mWTshowCreated,
100 KOPrefs::instance()->mWTshowChanged);
98} 101}
99void KNoScrollListBox::keyPressEvent(QKeyEvent *e) 102void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
100{ 103{
101 104
102 switch(e->key()) { 105 switch(e->key()) {
103 case Key_Right: 106 case Key_Right:
104 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 107 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
105 { 108 {
106 e->ignore(); 109 e->ignore();
107 return; 110 return;
108 } 111 }
109 scrollBy(10,0); 112 scrollBy(10,0);
110 break; 113 break;
111 case Key_Left: 114 case Key_Left:
112 if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 115 if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
113 { 116 {
114 e->ignore(); 117 e->ignore();
115 return; 118 return;
116 } 119 }
117 scrollBy(-10,0); 120 scrollBy(-10,0);
118 break; 121 break;
119 case Key_Up: 122 case Key_Up:
120 if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { 123 if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
121 e->ignore(); 124 e->ignore();
@@ -174,49 +177,48 @@ void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e)
174 case Key_Shift: 177 case Key_Shift:
175 emit shiftUp(); 178 emit shiftUp();
176 break; 179 break;
177 default: 180 default:
178 break; 181 break;
179 } 182 }
180} 183}
181 184
182void KNoScrollListBox::mousePressEvent(QMouseEvent *e) 185void KNoScrollListBox::mousePressEvent(QMouseEvent *e)
183{ 186{
184 QListBox::mousePressEvent(e); 187 QListBox::mousePressEvent(e);
185 188
186 if(e->button() == RightButton) { 189 if(e->button() == RightButton) {
187 emit rightClick(); 190 emit rightClick();
188 } 191 }
189} 192}
190 193
191MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s) 194MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s)
192 : QListBoxItem() 195 : QListBoxItem()
193{ 196{
194 setText( s ); 197 setText( s );
195 198
196 mIncidence = incidence; 199 mIncidence = incidence;
197 mDate = qd; 200 mDate = qd;
198 // QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence ));
199 mRecur = false; 201 mRecur = false;
200 mAlarm = false; 202 mAlarm = false;
201 mReply = false; 203 mReply = false;
202 mInfo = false; 204 mInfo = false;
203} 205}
204 206
205void MonthViewItem::paint(QPainter *p) 207void MonthViewItem::paint(QPainter *p)
206{ 208{
207#if QT_VERSION >= 0x030000 209#if QT_VERSION >= 0x030000
208 bool sel = isSelected(); 210 bool sel = isSelected();
209#else 211#else
210 bool sel = selected(); 212 bool sel = selected();
211#endif 213#endif
212 214
213 215
214 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) 216 if (KOPrefs::instance()->mMonthViewUsesCategoryColor)
215 { 217 {
216 p->setBackgroundColor( palette().color( QPalette::Normal, \ 218 p->setBackgroundColor( palette().color( QPalette::Normal, \
217 sel ? QColorGroup::Highlight : QColorGroup::Background ) ); 219 sel ? QColorGroup::Highlight : QColorGroup::Background ) );
218 p->eraseRect( 0, 0, listBox()->maxItemWidth(), height( listBox() ) ); 220 p->eraseRect( 0, 0, listBox()->maxItemWidth(), height( listBox() ) );
219 } 221 }
220 int x = 1; 222 int x = 1;
221 int y = 3;//(height() - mRecurPixmap.height()) /2; 223 int y = 3;//(height() - mRecurPixmap.height()) /2;
222 int size = PIXMAP_SIZE; 224 int size = PIXMAP_SIZE;
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 5efc247..a91074f 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -270,49 +270,55 @@ KOPrefs::KOPrefs() :
270 addItemBool("VerticalScreen",&mVerticalScreen,true); 270 addItemBool("VerticalScreen",&mVerticalScreen,true);
271 271
272 KPrefs::setCurrentGroup("KOrganizer Plugins"); 272 KPrefs::setCurrentGroup("KOrganizer Plugins");
273 273
274 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 274 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
275 275
276 KPrefs::setCurrentGroup("Group Scheduling"); 276 KPrefs::setCurrentGroup("Group Scheduling");
277 277
278 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 278 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
279 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 279 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
280 addItemStringList("AdditionalMails",&mAdditionalMails,""); 280 addItemStringList("AdditionalMails",&mAdditionalMails,"");
281 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 281 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
282 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 282 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
283 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 283 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
284 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 284 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
285 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 285 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
286 286
287 KPrefs::setCurrentGroup( "Editors" ); 287 KPrefs::setCurrentGroup( "Editors" );
288 288
289 addItemStringList( "EventTemplates", &mEventTemplates ); 289 addItemStringList( "EventTemplates", &mEventTemplates );
290 addItemStringList( "TodoTemplates", &mTodoTemplates ); 290 addItemStringList( "TodoTemplates", &mTodoTemplates );
291 291
292 addItemInt("DestinationPolicy",&mDestination,standardDestination); 292 addItemInt("DestinationPolicy",&mDestination,standardDestination);
293 293
294 294 KPrefs::setCurrentGroup( "ViewOptions" );
295 addItemBool("EVshowDetails",&mEVshowDetails,true);
296 addItemBool("EVshowCreated",&mEVshowCreated,true);
297 addItemBool("EVshowChanged",&mEVshowChanged,true);
298 addItemBool("WTshowDetails",&mWTshowDetails,false);
299 addItemBool("WTshowCreated",&mWTshowCreated,false);
300 addItemBool("WTshowChanged",&mWTshowChanged,false);
295 301
296} 302}
297 303
298 304
299KOPrefs::~KOPrefs() 305KOPrefs::~KOPrefs()
300{ 306{
301 if (mInstance == this) 307 if (mInstance == this)
302 mInstance = insd.setObject(0); 308 mInstance = insd.setObject(0);
303 309
304 //qDebug("KOPrefs::~KOPrefs() "); 310 //qDebug("KOPrefs::~KOPrefs() ");
305} 311}
306 312
307 313
308KOPrefs *KOPrefs::instance() 314KOPrefs *KOPrefs::instance()
309{ 315{
310 if (!mInstance) { 316 if (!mInstance) {
311 mInstance = insd.setObject(new KOPrefs()); 317 mInstance = insd.setObject(new KOPrefs());
312 mInstance->readConfig(); 318 mInstance->readConfig();
313 } 319 }
314 320
315 return mInstance; 321 return mInstance;
316} 322}
317 323
318void KOPrefs::usrSetDefaults() 324void KOPrefs::usrSetDefaults()
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index e300067..e4e3dd7 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -248,37 +248,45 @@ class KOPrefs : public KPimPrefs
248 bool mTodoViewUsesForegroundColor; 248 bool mTodoViewUsesForegroundColor;
249 bool mMonthViewUsesForegroundColor; 249 bool mMonthViewUsesForegroundColor;
250 250
251 bool mHightlightDateTimeEdit; 251 bool mHightlightDateTimeEdit;
252 bool mShortDateInViewer; 252 bool mShortDateInViewer;
253 253
254 bool mShowDateNavigator; 254 bool mShowDateNavigator;
255 255
256 QStringList mLocationDefaults; 256 QStringList mLocationDefaults;
257 QStringList mEventSummaryUser; 257 QStringList mEventSummaryUser;
258 QStringList mTodoSummaryUser; 258 QStringList mTodoSummaryUser;
259 259
260 bool mUseInternalAlarmNotification; 260 bool mUseInternalAlarmNotification;
261 int mAlarmPlayBeeps; 261 int mAlarmPlayBeeps;
262 int mAlarmSuspendTime; 262 int mAlarmSuspendTime;
263 int mAlarmSuspendCount; 263 int mAlarmSuspendCount;
264 int mAlarmBeepInterval; 264 int mAlarmBeepInterval;
265 int mOldLanguage; 265 int mOldLanguage;
266 int mOldLoadedLanguage; 266 int mOldLoadedLanguage;
267 267
268 268
269 QString mActiveSyncPort; 269 QString mActiveSyncPort;
270 QString mActiveSyncIP; 270 QString mActiveSyncIP;
271 271
272 // settings for eventviewer
273 bool mEVshowDetails;
274 bool mEVshowCreated;
275 bool mEVshowChanged;
276 bool mWTshowDetails;
277 bool mWTshowCreated;
278 bool mWTshowChanged;
279
272 private: 280 private:
273 QDict<QColor> mCategoryColors; 281 QDict<QColor> mCategoryColors;
274 QColor mDefaultCategoryColor; 282 QColor mDefaultCategoryColor;
275 283
276 QFont mDefaultTimeBarFont; 284 QFont mDefaultTimeBarFont;
277 QFont mDefaultViewFont; 285 QFont mDefaultViewFont;
278 QFont mDefaultMonthViewFont; 286 QFont mDefaultMonthViewFont;
279 287
280 QString mName; 288 QString mName;
281 QString mEmail; 289 QString mEmail;
282}; 290};
283 291
284#endif 292#endif
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 452d019..443508d 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -883,48 +883,80 @@ dummy =
883 topLayout->addWidget(wid,ii++,0); 883 topLayout->addWidget(wid,ii++,0);
884 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 884 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
885 885
886 // Todo overdue color 886 // Todo overdue color
887 wid = new QWidget( topFrame ); 887 wid = new QWidget( topFrame );
888 widLayout = new QHBoxLayout(wid); 888 widLayout = new QHBoxLayout(wid);
889 KPrefsDialogWidColor *todoOverdueColor = 889 KPrefsDialogWidColor *todoOverdueColor =
890 addWidColor(i18n("Todo overdue color:"), 890 addWidColor(i18n("Todo overdue color:"),
891 &(KOPrefs::instance()->mTodoOverdueColor),wid); 891 &(KOPrefs::instance()->mTodoOverdueColor),wid);
892 widLayout->addWidget(todoOverdueColor->label()); 892 widLayout->addWidget(todoOverdueColor->label());
893 widLayout->addWidget(todoOverdueColor->button()); 893 widLayout->addWidget(todoOverdueColor->button());
894 topLayout->addWidget(wid,ii++,0); 894 topLayout->addWidget(wid,ii++,0);
895 895
896 dummy = 896 dummy =
897 addWidBool(i18n("Colors are applied to text"), 897 addWidBool(i18n("Colors are applied to text"),
898 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 898 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
899 topLayout->addWidget(dummy->checkBox(),ii++,0); 899 topLayout->addWidget(dummy->checkBox(),ii++,0);
900 900
901 dummy = 901 dummy =
902 addWidBool(i18n("Allday Agenda view shows todos"), 902 addWidBool(i18n("Allday Agenda view shows todos"),
903 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 903 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
904 topLayout->addWidget(dummy->checkBox(),ii++,0); 904 topLayout->addWidget(dummy->checkBox(),ii++,0);
905 905
906 906
907 topFrame = addPage(i18n("View Options"),0,0);
908
909 topLayout = new QGridLayout(topFrame,4,1);
910 topLayout->setSpacing(spacingHint());
911 topLayout->setMargin(marginHint());
912 ii = 0;
913 lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame);
914 topLayout->addWidget(lab ,ii++,0);
915
916 dummy = addWidBool(i18n("Details"),
917 &(KOPrefs::instance()->mEVshowDetails),topFrame);
918 topLayout->addWidget(dummy->checkBox(),ii++,0);
919 dummy = addWidBool(i18n("Created time"),
920 &(KOPrefs::instance()->mEVshowCreated),topFrame);
921 topLayout->addWidget(dummy->checkBox(),ii++,0);
922 dummy = addWidBool(i18n("Last modified time"),
923 &(KOPrefs::instance()->mEVshowChanged),topFrame);
924 topLayout->addWidget(dummy->checkBox(),ii++,0);
925
926
927 lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame);
928 topLayout->addWidget(lab ,ii++,0);
929
930 dummy = addWidBool(i18n("Details"),
931 &(KOPrefs::instance()->mWTshowDetails),topFrame);
932 topLayout->addWidget(dummy->checkBox(),ii++,0);
933 dummy = addWidBool(i18n("Created time"),
934 &(KOPrefs::instance()->mWTshowCreated),topFrame);
935 topLayout->addWidget(dummy->checkBox(),ii++,0);
936 dummy = addWidBool(i18n("Last modified time"),
937 &(KOPrefs::instance()->mWTshowChanged),topFrame);
938 topLayout->addWidget(dummy->checkBox(),ii++,0);
907 939
908 940
909 topFrame = addPage(i18n("Alarm"),0,0); 941 topFrame = addPage(i18n("Alarm"),0,0);
910 // DesktopIcon("viewmag",KIcon::SizeMedium)); 942 // DesktopIcon("viewmag",KIcon::SizeMedium));
911 943
912 topLayout = new QGridLayout(topFrame,2,1); 944 topLayout = new QGridLayout(topFrame,2,1);
913 topLayout->setSpacing(spacingHint()); 945 topLayout->setSpacing(spacingHint());
914 topLayout->setMargin(marginHint()); 946 topLayout->setMargin(marginHint());
915 int iii = 0; 947 int iii = 0;
916 948
917 dummy = 949 dummy =
918 addWidBool(i18n("Use internal alarm notification"), 950 addWidBool(i18n("Use internal alarm notification"),
919 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 951 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
920 topLayout->addWidget(dummy->checkBox(),iii++,0); 952 topLayout->addWidget(dummy->checkBox(),iii++,0);
921 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); 953 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
922 954
923 topLayout->addWidget(lab ,iii++,0); 955 topLayout->addWidget(lab ,iii++,0);
924#ifndef DESKTOP_VERSION 956#ifndef DESKTOP_VERSION
925 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 957 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
926#else 958#else
927 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 959 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
928 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 960 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
929#endif 961#endif
930 962
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 3011458..3483e95 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -535,49 +535,52 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
535 SLOT(selectionChanged(QListViewItem *))); 535 SLOT(selectionChanged(QListViewItem *)));
536 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), 536 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)),
537 SLOT(selectionChanged(QListViewItem *))); 537 SLOT(selectionChanged(QListViewItem *)));
538#endif 538#endif
539 539
540 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); 540 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) ));
541 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); 541 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) ));
542 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); 542 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) ));
543 543
544 connect( mTodoListView, SIGNAL(selectionChanged() ), 544 connect( mTodoListView, SIGNAL(selectionChanged() ),
545 SLOT( processSelectionChange() ) ); 545 SLOT( processSelectionChange() ) );
546 connect( mQuickAdd, SIGNAL( returnPressed () ), 546 connect( mQuickAdd, SIGNAL( returnPressed () ),
547 SLOT( addQuickTodo() ) ); 547 SLOT( addQuickTodo() ) );
548 548
549} 549}
550 550
551KOTodoView::~KOTodoView() 551KOTodoView::~KOTodoView()
552{ 552{
553 delete mDocPrefs; 553 delete mDocPrefs;
554} 554}
555QString KOTodoView::getWhatsThisText(QPoint p) 555QString KOTodoView::getWhatsThisText(QPoint p)
556{ 556{
557 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); 557 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p );
558 if ( item ) 558 if ( item )
559 return KIncidenceFormatter::instance()->getFormattedText( item->todo() ); 559 return KIncidenceFormatter::instance()->getFormattedText( item->todo(),
560 KOPrefs::instance()->mWTshowDetails,
561 KOPrefs::instance()->mWTshowCreated,
562 KOPrefs::instance()->mWTshowChanged);
560 return i18n("That is the todo view" ); 563 return i18n("That is the todo view" );
561 564
562} 565}
563 566
564void KOTodoView::jumpToDate () 567void KOTodoView::jumpToDate ()
565{ 568{
566 // if (mActiveItem) { 569 // if (mActiveItem) {
567// mActiveItem->todo()); 570// mActiveItem->todo());
568// if ( mActiveItem->todo()->hasDueDate() ) 571// if ( mActiveItem->todo()->hasDueDate() )
569// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); 572// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() );
570} 573}
571void KOTodoView::paintNeeded() 574void KOTodoView::paintNeeded()
572{ 575{
573 if ( mPendingUpdateBeforeRepaint ) { 576 if ( mPendingUpdateBeforeRepaint ) {
574 updateView(); 577 updateView();
575 mPendingUpdateBeforeRepaint = false; 578 mPendingUpdateBeforeRepaint = false;
576 } 579 }
577} 580}
578void KOTodoView::paintEvent(QPaintEvent * pevent) 581void KOTodoView::paintEvent(QPaintEvent * pevent)
579{ 582{
580 if ( mPendingUpdateBeforeRepaint ) { 583 if ( mPendingUpdateBeforeRepaint ) {
581 updateView(); 584 updateView();
582 mPendingUpdateBeforeRepaint = false; 585 mPendingUpdateBeforeRepaint = false;
583 } 586 }