author | zautrix <zautrix> | 2004-10-29 21:05:07 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-29 21:05:07 (UTC) |
commit | 3c0edb4b4c4a77b334331749dfde776911c3a3a0 (patch) (side-by-side diff) | |
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 @@ -71,8 +71,4 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, QStyleSheet* stsh = mView->styleSheet(); QStyleSheetItem * style ; - style = stsh->item ("a" ); - if ( style ) { - style->setMargin(QStyleSheetItem::MarginAll,0); - } style = stsh->item ("h2" ); if ( style ) { @@ -83,8 +79,4 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, style->setMargin(QStyleSheetItem::MarginAll,0); } - style = stsh->item ("table" ); - if ( style ) { - style->setMargin(QStyleSheetItem::MarginAll,0); - } mEventViewer = 0; @@ -162,5 +154,5 @@ void KOWhatsNextView::updateView() // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); //<big><big><strong>" + date + "</strong></big></big>\n"; - mText = "<qt><table width=\"100%\">\n"; + mText = "<table width=\"100%\">\n"; //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; #ifdef DESKTOP_VERSION @@ -217,12 +209,16 @@ void KOWhatsNextView::updateView() if ( ! itemAdded ) { appendDay ( iii, mEventDate ); - itemAdded = true; } + // for first day (iii == 0) + // we may have syncevents, or events in the past, which maybe should nor be diaplayed + // for that reason we cannot append <table> in appendDay () for iii == 0 + // we must append it in the first successful call of appendEvent() Event *ev = events.first(); while(ev) { //qDebug("+++++event append %s", ev->summary().latin1()); if ( true /*!ev->recurrence()->doesRecur() || ev->recursOn( mEventDate)*/) { - appendEvent(ev, false , iii!= 0 ); + if ( appendEvent(ev, false , iii!= 0,!itemAdded ) ) + itemAdded = true; } ev = events.next(); @@ -344,5 +340,5 @@ void KOWhatsNextView::updateView() - mText += "</td></tr>\n</table></qt>\n"; + mText += "</td></tr>\n</table>\n"; mView->setText(mText); @@ -358,5 +354,5 @@ void KOWhatsNextView::updateView() // mView->setBackgroundMode(FixedPixmap ); // mView->setBackgroundPixmap ( bPix ); - // qDebug("%s ",mText.latin1()); + qDebug("%s ",mText.latin1()); } @@ -367,5 +363,5 @@ void KOWhatsNextView::appendDay( int i, QDate eventDate ) if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) { if ( i == 0 ) { - mText += "<table>\n"; + //mText += "<table>\n"; return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>"; } @@ -381,5 +377,5 @@ void KOWhatsNextView::appendDay( int i, QDate eventDate ) } else { if ( i == 0 ) { - mText += "<table>\n"; + //mText += "<table>\n"; return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>"; } @@ -431,16 +427,19 @@ void KOWhatsNextView::changeEventDisplay(Event *, int action) } -void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) +bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool appendTable ) { if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") ) - return; + return false; QDateTime cdt = QDateTime::currentDateTime(); QDateTime noc; QString tempText; + if ( appendTable && !notRed ) { + tempText = "<table>"; + } bool ok = true; if ( reply ) { noc = ev->getNextOccurence( cdt, &ok ); if (! ok && ev->type() == "Event") - return; + return false; } tempText += "<tr><td><b>"; @@ -487,5 +486,5 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) if ( end < cdt ) { if ( !KOPrefs::instance()->mWNViewShowsPast ) - return; + return false; tempText += "<font color=\"#F00000\">" + dateText + "</font>"; } @@ -576,4 +575,5 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) tempText += "</td></tr>\n"; mText += tempText; + return true; } diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h index 1118bdd..9049268 100644 --- a/korganizer/kowhatsnextview.h +++ b/korganizer/kowhatsnextview.h @@ -71,5 +71,5 @@ class KOWhatsNextView : public KOrg::BaseView protected: - void appendEvent(Incidence *, bool reply=false, bool notRed = true); + bool appendEvent(Incidence *, bool reply=false, bool notRed = true, bool appendTable = false); bool appendTodo(Incidence *, QString ind = "", bool isSub = false ); void appendDay( int i, QDate date ); |