author | harlekin <harlekin> | 2002-03-21 10:57:44 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-03-21 10:57:44 (UTC) |
commit | 20fa51b3d38725ca151364a14d8005b4e6c9b415 (patch) (side-by-side diff) | |
tree | e8a987bc0824020f531344fa36a845b2e0e6f4ab | |
parent | 74b4a41d2671bd85a47041f107624d0c61edc346 (diff) | |
download | opie-20fa51b3d38725ca151364a14d8005b4e6c9b415.zip opie-20fa51b3d38725ca151364a14d8005b4e6c9b415.tar.gz opie-20fa51b3d38725ca151364a14d8005b4e6c9b415.tar.bz2 |
fixes reagarding calendar part
-rw-r--r-- | core/pim/today/today.cpp | 28 | ||||
-rw-r--r-- | core/pim/today/today.h | 14 |
2 files changed, 25 insertions, 17 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 2dc96fc..58ba4f4 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -187,9 +187,8 @@ void Today::init() { QDate date = QDate::currentDate(); QString time = (tr( date.toString()) ); TextLabel1->setText(QString("<font color=#FFFFFF>" + time + "</font>")); - db = new DateBookDB; // read config Config cfg("today"); cfg.setGroup("BaseConfig"); @@ -206,10 +205,11 @@ void Today::init() { // if notes should be shown SHOW_NOTES = cfg.readNumEntry("shownotes",0); // should only later appointments be shown or all for the current day. ONLY_LATER = cfg.readNumEntry("onlylater",1); -} + db = new DateBookDB; +} /* * The method for the configuration dialog. */ @@ -295,17 +295,17 @@ void Today::getDates() { QTime time = QTime::currentTime(); if (!ONLY_LATER) { count++; - DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents); + DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents, SHOW_LOCATION, SHOW_NOTES); layoutDates->addWidget(l); connect (l, SIGNAL(editEvent(const Event &)), this, SLOT(editEvent(const Event &))); } else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) { count++; // show only later appointments - DateBookEventLater *l=new DateBookEventLater(*it, AllDateBookEvents); + DateBookEventLater *l=new DateBookEventLater(*it, AllDateBookEvents, SHOW_LOCATION, SHOW_NOTES); layoutDates->addWidget(l); connect (l, SIGNAL(editEvent(const Event &)), this, SLOT(editEvent(const Event &))); } @@ -441,11 +441,13 @@ Today::~Today() { /* * Gets the events for the current day, if it should get all dates */ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, - QWidget* parent = 0, - const char* name = 0, - WFlags fl = 0) : + QWidget* parent = 0, + int SHOW_LOCATION = 0, + int SHOW_NOTES = 0, + const char* name = 0, + WFlags fl = 0) : ClickableLabel(parent,name,fl), event(ev) { QString msg; //QTime time = QTime::currentTime(); @@ -456,10 +458,9 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, msg += " <b>[with alarm]</b>"; } // include location or not if (SHOW_LOCATION == 1) { - msg += "<BR><i>" + (ev).location(); - msg += "</i>"; + msg += "<BR><i>" + (ev).location() + "</i>"; } if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { msg += "<br>All day"; @@ -471,9 +472,9 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, } // include possible note or not if (SHOW_NOTES == 1) { - msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; + msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP); } } setText(msg); connect(this, SIGNAL(clicked()), this, SLOT(editMe())); @@ -482,8 +483,10 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev, QWidget* parent = 0, + int SHOW_LOCATION = 0, + int SHOW_NOTES = 0, const char* name = 0, WFlags fl = 0) : ClickableLabel(parent,name,fl), event(ev) { @@ -497,10 +500,9 @@ DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev, msg += " <b>[with alarm]</b>"; } // include location or not if (SHOW_LOCATION == 1) { - msg += "<BR><i>" + (ev).location(); - msg += "</i>"; + msg += "<BR><i>" + (ev).location() + "</i>"; } if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { msg += "<br>All day"; @@ -511,9 +513,9 @@ DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev, + "<b> - </b>" + TimeString::timeString(QTime((ev).event().end().time()) ); } // include possible note or not if (SHOW_NOTES == 1) { - msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; + msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP); } } setText(msg); diff --git a/core/pim/today/today.h b/core/pim/today/today.h index 6048781..090e8f9 100644 --- a/core/pim/today/today.h +++ b/core/pim/today/today.h @@ -77,10 +77,13 @@ class Today : public TodayBase { class DateBookEvent: public ClickableLabel { Q_OBJECT public: DateBookEvent(const EffectiveEvent &ev, - QWidget* parent = 0, const char* name = 0, - WFlags fl = 0); + QWidget* parent = 0, + int SHOW_LOCATION = 0, + int SHOW_NOTES = 0, + const char* name = 0, + WFlags fl = 0); signals: void editEvent(const Event &e); private slots: void editMe(); @@ -91,10 +94,13 @@ private: class DateBookEventLater: public ClickableLabel { Q_OBJECT public: DateBookEventLater(const EffectiveEvent &ev, - QWidget* parent = 0, const char* name = 0, - WFlags fl = 0); + QWidget* parent = 0, + int SHOW_LOCATION = 0, + int SHOW_NOTES = 0, + const char* name = 0, + WFlags fl = 0); signals: void editEvent(const Event &e); private slots: void editMe(); |