author | zautrix <zautrix> | 2004-10-29 21:05:07 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-29 21:05:07 (UTC) |
commit | 3c0edb4b4c4a77b334331749dfde776911c3a3a0 (patch) (unidiff) | |
tree | 89de7078a1a062c19b2f13ededd49f471c362abf /korganizer | |
parent | a7e2fe5bb10af47a239b8b014a210568cc79287a (diff) | |
download | kdepimpi-3c0edb4b4c4a77b334331749dfde776911c3a3a0.zip kdepimpi-3c0edb4b4c4a77b334331749dfde776911c3a3a0.tar.gz kdepimpi-3c0edb4b4c4a77b334331749dfde776911c3a3a0.tar.bz2 |
KO WN view fix
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 38 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.h | 2 |
2 files changed, 20 insertions, 20 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index aa33588..2f7409d 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp | |||
@@ -70,10 +70,6 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, | |||
70 | connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); | 70 | connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); |
71 | QStyleSheet* stsh = mView->styleSheet(); | 71 | QStyleSheet* stsh = mView->styleSheet(); |
72 | QStyleSheetItem * style ; | 72 | QStyleSheetItem * style ; |
73 | style = stsh->item ("a" ); | ||
74 | if ( style ) { | ||
75 | style->setMargin(QStyleSheetItem::MarginAll,0); | ||
76 | } | ||
77 | style = stsh->item ("h2" ); | 73 | style = stsh->item ("h2" ); |
78 | if ( style ) { | 74 | if ( style ) { |
79 | style->setMargin(QStyleSheetItem::MarginAll,0); | 75 | style->setMargin(QStyleSheetItem::MarginAll,0); |
@@ -82,10 +78,6 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, | |||
82 | if ( style ) { | 78 | if ( style ) { |
83 | style->setMargin(QStyleSheetItem::MarginAll,0); | 79 | style->setMargin(QStyleSheetItem::MarginAll,0); |
84 | } | 80 | } |
85 | style = stsh->item ("table" ); | ||
86 | if ( style ) { | ||
87 | style->setMargin(QStyleSheetItem::MarginAll,0); | ||
88 | } | ||
89 | mEventViewer = 0; | 81 | mEventViewer = 0; |
90 | 82 | ||
91 | QBoxLayout *topLayout = new QVBoxLayout(this); | 83 | QBoxLayout *topLayout = new QVBoxLayout(this); |
@@ -161,7 +153,7 @@ void KOWhatsNextView::updateView() | |||
161 | QString ipath;// = new QString(); | 153 | QString ipath;// = new QString(); |
162 | // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); | 154 | // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); |
163 | //<big><big><strong>" + date + "</strong></big></big>\n"; | 155 | //<big><big><strong>" + date + "</strong></big></big>\n"; |
164 | mText = "<qt><table width=\"100%\">\n"; | 156 | mText = "<table width=\"100%\">\n"; |
165 | //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; | 157 | //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; |
166 | #ifdef DESKTOP_VERSION | 158 | #ifdef DESKTOP_VERSION |
167 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>"; | 159 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>"; |
@@ -216,14 +208,18 @@ void KOWhatsNextView::updateView() | |||
216 | //mText += "\">"; | 208 | //mText += "\">"; |
217 | if ( ! itemAdded ) { | 209 | if ( ! itemAdded ) { |
218 | appendDay ( iii, mEventDate ); | 210 | appendDay ( iii, mEventDate ); |
219 | itemAdded = true; | ||
220 | 211 | ||
221 | } | 212 | } |
213 | // for first day (iii == 0) | ||
214 | // we may have syncevents, or events in the past, which maybe should nor be diaplayed | ||
215 | // for that reason we cannot append <table> in appendDay () for iii == 0 | ||
216 | // we must append it in the first successful call of appendEvent() | ||
222 | Event *ev = events.first(); | 217 | Event *ev = events.first(); |
223 | while(ev) { | 218 | while(ev) { |
224 | //qDebug("+++++event append %s", ev->summary().latin1()); | 219 | //qDebug("+++++event append %s", ev->summary().latin1()); |
225 | if ( true /*!ev->recurrence()->doesRecur() || ev->recursOn( mEventDate)*/) { | 220 | if ( true /*!ev->recurrence()->doesRecur() || ev->recursOn( mEventDate)*/) { |
226 | appendEvent(ev, false , iii!= 0 ); | 221 | if ( appendEvent(ev, false , iii!= 0,!itemAdded ) ) |
222 | itemAdded = true; | ||
227 | } | 223 | } |
228 | ev = events.next(); | 224 | ev = events.next(); |
229 | } | 225 | } |
@@ -343,7 +339,7 @@ void KOWhatsNextView::updateView() | |||
343 | if (replys > 0 ) mText += "</table>\n"; | 339 | if (replys > 0 ) mText += "</table>\n"; |
344 | 340 | ||
345 | 341 | ||
346 | mText += "</td></tr>\n</table></qt>\n"; | 342 | mText += "</td></tr>\n</table>\n"; |
347 | 343 | ||
348 | mView->setText(mText); | 344 | mView->setText(mText); |
349 | mView->setFocus(); | 345 | mView->setFocus(); |
@@ -357,7 +353,7 @@ void KOWhatsNextView::updateView() | |||
357 | // test->show(); | 353 | // test->show(); |
358 | // mView->setBackgroundMode(FixedPixmap ); | 354 | // mView->setBackgroundMode(FixedPixmap ); |
359 | // mView->setBackgroundPixmap ( bPix ); | 355 | // mView->setBackgroundPixmap ( bPix ); |
360 | // qDebug("%s ",mText.latin1()); | 356 | qDebug("%s ",mText.latin1()); |
361 | } | 357 | } |
362 | 358 | ||
363 | void KOWhatsNextView::appendDay( int i, QDate eventDate ) | 359 | void KOWhatsNextView::appendDay( int i, QDate eventDate ) |
@@ -366,7 +362,7 @@ void KOWhatsNextView::appendDay( int i, QDate eventDate ) | |||
366 | QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer); | 362 | QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer); |
367 | if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) { | 363 | if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) { |
368 | if ( i == 0 ) { | 364 | if ( i == 0 ) { |
369 | mText += "<table>\n"; | 365 | //mText += "<table>\n"; |
370 | return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>"; | 366 | return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>"; |
371 | } | 367 | } |
372 | else if ( i == 1 ) | 368 | else if ( i == 1 ) |
@@ -380,7 +376,7 @@ void KOWhatsNextView::appendDay( int i, QDate eventDate ) | |||
380 | 376 | ||
381 | } else { | 377 | } else { |
382 | if ( i == 0 ) { | 378 | if ( i == 0 ) { |
383 | mText += "<table>\n"; | 379 | //mText += "<table>\n"; |
384 | return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>"; | 380 | return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>"; |
385 | } | 381 | } |
386 | 382 | ||
@@ -430,18 +426,21 @@ void KOWhatsNextView::changeEventDisplay(Event *, int action) | |||
430 | } | 426 | } |
431 | } | 427 | } |
432 | 428 | ||
433 | void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) | 429 | bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool appendTable ) |
434 | { | 430 | { |
435 | if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") ) | 431 | if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") ) |
436 | return; | 432 | return false; |
437 | QDateTime cdt = QDateTime::currentDateTime(); | 433 | QDateTime cdt = QDateTime::currentDateTime(); |
438 | QDateTime noc; | 434 | QDateTime noc; |
439 | QString tempText; | 435 | QString tempText; |
436 | if ( appendTable && !notRed ) { | ||
437 | tempText = "<table>"; | ||
438 | } | ||
440 | bool ok = true; | 439 | bool ok = true; |
441 | if ( reply ) { | 440 | if ( reply ) { |
442 | noc = ev->getNextOccurence( cdt, &ok ); | 441 | noc = ev->getNextOccurence( cdt, &ok ); |
443 | if (! ok && ev->type() == "Event") | 442 | if (! ok && ev->type() == "Event") |
444 | return; | 443 | return false; |
445 | } | 444 | } |
446 | tempText += "<tr><td><b>"; | 445 | tempText += "<tr><td><b>"; |
447 | if (ev->type()=="Event") { | 446 | if (ev->type()=="Event") { |
@@ -486,7 +485,7 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) | |||
486 | else { | 485 | else { |
487 | if ( end < cdt ) { | 486 | if ( end < cdt ) { |
488 | if ( !KOPrefs::instance()->mWNViewShowsPast ) | 487 | if ( !KOPrefs::instance()->mWNViewShowsPast ) |
489 | return; | 488 | return false; |
490 | tempText += "<font color=\"#F00000\">" + dateText + "</font>"; | 489 | tempText += "<font color=\"#F00000\">" + dateText + "</font>"; |
491 | } | 490 | } |
492 | else if ( st < cdt ) | 491 | else if ( st < cdt ) |
@@ -575,6 +574,7 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) | |||
575 | tempText += " ["+ev->relatedTo()->summary() +"]"; | 574 | tempText += " ["+ev->relatedTo()->summary() +"]"; |
576 | tempText += "</td></tr>\n"; | 575 | tempText += "</td></tr>\n"; |
577 | mText += tempText; | 576 | mText += tempText; |
577 | return true; | ||
578 | } | 578 | } |
579 | 579 | ||
580 | bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) | 580 | bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) |
diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h index 1118bdd..9049268 100644 --- a/korganizer/kowhatsnextview.h +++ b/korganizer/kowhatsnextview.h | |||
@@ -70,7 +70,7 @@ class KOWhatsNextView : public KOrg::BaseView | |||
70 | void changeEventDisplay(Event *, int); | 70 | void changeEventDisplay(Event *, int); |
71 | 71 | ||
72 | protected: | 72 | protected: |
73 | void appendEvent(Incidence *, bool reply=false, bool notRed = true); | 73 | bool appendEvent(Incidence *, bool reply=false, bool notRed = true, bool appendTable = false); |
74 | bool appendTodo(Incidence *, QString ind = "", bool isSub = false ); | 74 | bool appendTodo(Incidence *, QString ind = "", bool isSub = false ); |
75 | void appendDay( int i, QDate date ); | 75 | void appendDay( int i, QDate date ); |
76 | QDate mEventDate; | 76 | QDate mEventDate; |