-rw-r--r-- | core/pim/today/today.cpp | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index eb8b50c..0f6e598 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -49,3 +49,3 @@ int SHOW_NOTES; // show only later dates -int ONLY_LATER = 1; +int ONLY_LATER; /* @@ -77,3 +77,4 @@ void Today::draw() getTodo(); - QTimer::singleShot( 60*1000, this, SLOT(draw()) ); + // how often refresh + QTimer::singleShot( 30*1000, this, SLOT(draw()) ); @@ -97,2 +98,4 @@ void Today::init() SHOW_NOTES = cfg.readNumEntry("shownotes",0); + ONLY_LATER = cfg.readNumEntry("onlylater",1); + } @@ -121,3 +124,5 @@ void Today::startConfig() conf->SpinBox7->setValue(MAX_CHAR_CLIP); - + // only later + conf->CheckBox3->setChecked(ONLY_LATER); + conf->exec(); @@ -129,3 +134,4 @@ void Today::startConfig() int maxcharclip = conf->SpinBox7->value(); - + int onlylater = conf->CheckBox3->isChecked(); + cfg.writeEntry("maxlinestask",maxlinestask); @@ -135,2 +141,3 @@ void Today::startConfig() cfg.writeEntry("shownotes", notes); + cfg.writeEntry("onlylater", onlylater); // sync it to "disk" @@ -171,3 +178,25 @@ void Today::getDates() // still some bug in here, 1 h off - if ((time.toString() <= TimeString::dateString((*it).event().end())) && ONLY_LATER ) + + // decide if to get all day or only later appointments + if (!ONLY_LATER) + { + msg += "<B>" + (*it).description() + "</B>"; + // include location or not + if (SHOW_LOCATION == 1) + { + msg+= "<BR>" + (*it).location(); + } + msg += "<BR>" + // start time of event + + TimeString::timeString(QTime((*it).event().start().time()) ) + // end time of event + + "<b> - </b>" + TimeString::timeString(QTime((*it).event().end().time()) ) + + "<BR>"; + // include possible note or not + if (SHOW_NOTES == 1) + { + msg += " <i>note</i>:" +((*it).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; + } + } + else if ((time.toString() <= TimeString::dateString((*it).event().end())) && ONLY_LATER ) { @@ -192,2 +221,7 @@ void Today::getDates() } + + if (msg.isEmpty()) + { + msg = "No more appointments today"; + } } |