author | zautrix <zautrix> | 2004-10-27 01:07:05 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-27 01:07:05 (UTC) |
commit | 4efb020e137fbb8b94d845a2aa0ffc894561aea9 (patch) (side-by-side diff) | |
tree | 62fa8844366362ccc7b8ed87b908e0222ab9a5f9 | |
parent | ba3d660ed4f856362d2b914ed744874c235b4001 (diff) | |
download | kdepimpi-4efb020e137fbb8b94d845a2aa0ffc894561aea9.zip kdepimpi-4efb020e137fbb8b94d845a2aa0ffc894561aea9.tar.gz kdepimpi-4efb020e137fbb8b94d845a2aa0ffc894561aea9.tar.bz2 |
fixed wn view
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 59b864c..0f0bf11 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -49,53 +49,60 @@ void WhatsNextTextBrowser::setSource(const QString& n) if (n.startsWith("event:")) { emit showIncidence(n); return; } else if (n.startsWith("todo:")) { emit showIncidence(n); return; } else { QTextBrowser::setSource(n); } } KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, const char *name) : KOrg::BaseView(calendar, parent, name) { // mDateLabel = // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this); // mDateLabel->setMargin(2); // mDateLabel->setAlignment(AlignCenter); setFont( KOPrefs::instance()->mWhatsNextFont ); mView = new WhatsNextTextBrowser(this); connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); QStyleSheet* stsh = mView->styleSheet(); QStyleSheetItem * style ; - + style = stsh->item ("a" ); + if ( style ) { + style->setMargin(QStyleSheetItem::MarginAll,0); + } style = stsh->item ("h2" ); if ( style ) { style->setMargin(QStyleSheetItem::MarginAll,0); } + style = stsh->item ("h3" ); + if ( style ) { + style->setMargin(QStyleSheetItem::MarginAll,0); + } style = stsh->item ("table" ); if ( style ) { style->setMargin(QStyleSheetItem::MarginAll,0); } mEventViewer = 0; QBoxLayout *topLayout = new QVBoxLayout(this); // topLayout->addWidget(mDateLabel); topLayout->addWidget(mView); mTimer = new QTimer( this ); connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView())); connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); } KOWhatsNextView::~KOWhatsNextView() { } int KOWhatsNextView::maxDatesHint() { return 0; } @@ -243,175 +250,175 @@ void KOWhatsNextView::updateView() //mText +="</table>"; } if ( itemAdded ) mText += "</table>\n"; mEventDate = mEventDate.addDays( 1 ); } int topmostPrios = KOPrefs::instance()->mWhatsNextPrios; if (todos.count() > 0 && topmostPrios > 0 ) { // kil.loadIcon("todo",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); // mText += "<h2>"; //<img src=\""; // mText += ipath; // mText += "\">"; // mText += i18n("Overdue To-Do:") + "</h2>\n"; //mText += "<ul>\n"; bool gotone = false; int priority = 1; int priosFound = 0; #ifdef DESKTOP_VERSION mText +="<p></p>"; #endif - mText +="<big><big><strong><em><font color=\"#000080\">" + i18n("Incomplete Todo:") + "</font></em></strong></big></big>\n"; + mText +="<h2><em><font color=\"#000080\">" + i18n("Incomplete Todo:") + "</font></em></h2>\n"; mText += "<ul>\n"; while (!gotone && priority<6) { todo = todos.first(); while(todo) { if (!todo->isCompleted() && (todo->priority() == priority) ) { if ( appendTodo(todo) ) gotone = true; } todo = todos.next(); } if ( gotone ) { gotone = false; ++priosFound; if ( priosFound == topmostPrios ) break; } priority++; // kdDebug() << "adding the todos..." << endl; } mText += "</ul>\n"; } int replys = 0; events = calendar()->events(QDate::currentDate(), QDate(2975,12,6)); if (events.count() > 0) { Event *ev = events.first(); while(ev) { Attendee *me = ev->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); if (me!=0) { if (me->status()==Attendee::NeedsAction && me->RSVP()) { if (replys == 0) { mText += "<p></p>"; // kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); //mText += "<h2>"; //<img src=\""; // mText += ipath; // mText += "\">"; //mText += i18n("Events and To-Dos that need a reply:") + "</h2>\n"; - mText +="<big><big><strong><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></strong></big></big>\n"; + mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n"; mText += "<table>\n"; } replys++; appendEvent(ev,true); } } ev = events.next(); } } todos = calendar()->todos(); if (todos.count() > 0) { Todo *to = todos.first(); while(to) { if ( !to->isCompleted() ){ Attendee *me = to->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); if (me!=0) { if (me->status()==Attendee::NeedsAction && me->RSVP()) { if (replys == 0) { - mText +="<big><big><strong><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></strong></big></big>\n"; + mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n"; mText += "<table>\n"; } replys++; appendEvent(to, true); } } } to = todos.next(); } } if (replys > 0 ) mText += "</table>\n"; mText += "</td></tr>\n</table></qt>\n"; mView->setText(mText); mView->setFocus(); // QPixmap bPix = SmallIcon( "back" ); // qDebug("xxxxxxxxxxxxxxxxxxxxx "); // QWidget* test = new QWidget(); // test->setBackgroundMode(FixedPixmap ); // test->setBackgroundPixmap ( bPix ); // test->resize( 300, 400 ); // test->show(); // mView->setBackgroundMode(FixedPixmap ); // mView->setBackgroundPixmap ( bPix ); qDebug("%s ",mText.latin1()); } void KOWhatsNextView::appendDay( int i, QDate eventDate ) { QString date; QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer); if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) { if ( i == 0 ) { mText += "<table>\n"; return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>"; } else if ( i == 1 ) date = "<em><font color=\"#000080\">" + day + "</font></em>" ; else date = "<em><font color=\"#000080\">" + day + "</font></em>"; - //mText += "<h2>" + date + "</h2>\n"; - mText += "<big><big><strong>" + date + "</strong></big></big>\n"; + mText += "<h2>" + date + "</h2>\n"; + //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; mText += "<table>\n"; } else { if ( i == 0 ) { mText += "<table>\n"; return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>"; } #ifdef DESKTOP_VERSION else if ( i == 1 ) { date = "<h2><em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em></h2>" ; } else date = "<h2><em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em></h2>"; #else else if ( i == 1 ) { date = "<em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em>" ; } else date = "<em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em>"; #endif - //mText += "<h2>" + date + "</h2>\n"; - mText += "<big><big><strong>" + date + "</strong></big></big>\n"; + mText += "<h2>" + date + "</h2>\n"; + //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; mText += "<table>\n"; } } void KOWhatsNextView::showDates(const QDate &, const QDate &) { updateView(); } void KOWhatsNextView::showEvents(QPtrList<Event>) { } void KOWhatsNextView::changeEventDisplay(Event *, int action) { switch(action) { case KOGlobals::EVENTADDED: updateView(); break; case KOGlobals::EVENTEDITED: updateView(); break; case KOGlobals::EVENTDELETED: |