author | harlekin <harlekin> | 2002-02-16 19:59:21 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-02-16 19:59:21 (UTC) |
commit | 4e6ec847f469a3669be864db69dee0d8b0e4a93b (patch) (side-by-side diff) | |
tree | db92798a54f2eca93aa71fcf4d9aab3d116f0c5e /core/pim/today/today.cpp | |
parent | be1704ffdb21c6d304ba36bfd5ef1f5db622baea (diff) | |
download | opie-4e6ec847f469a3669be864db69dee0d8b0e4a93b.zip opie-4e6ec847f469a3669be864db69dee0d8b0e4a93b.tar.gz opie-4e6ec847f469a3669be864db69dee0d8b0e4a93b.tar.bz2 |
new features: auto update and opiemail support
-rw-r--r-- | core/pim/today/today.cpp | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 00a8842..eb8b50c 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -37,2 +37,3 @@ #include <qlabel.h> +#include <qtimer.h> @@ -59,2 +60,3 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) ); + QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startMail() ) ); @@ -65,7 +67,15 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) + draw(); +} + + +void Today::draw() +{ init(); getDates(); - getTodo(); -} + getMail(); + getTodo(); + QTimer::singleShot( 60*1000, this, SLOT(draw()) ); +} @@ -128,6 +138,3 @@ void Today::startConfig() - init(); - getDates(); - getTodo(); - //cout << location << endl; + draw(); } @@ -264,2 +271,18 @@ QList<TodoItem> Today::loadTodo(const char *filename) +void Today::getMail() +{ + Config cfg("opiemail"); + cfg.setGroup("today"); + + // how many lines should be showed in the task section + int NEW_MAILS = cfg.readNumEntry("newmails",0); + int OUTGOING = cfg.readNumEntry("outgoing",0); + + QString output = tr("<b>%1</b> new mails, <b>%2</b> outgoing").arg(NEW_MAILS).arg(OUTGOING); + + + MailField->setText(output); +} + + /* @@ -310,3 +333,3 @@ void Today::getTodo() /* - * lanches datebook + * launches datebook */ @@ -319,3 +342,3 @@ void Today::startDatebook() /* - * lanches todolist + * launches todolist */ @@ -327,2 +350,11 @@ void Today::startTodo() +/* + * launch opiemail + */ +void Today::startMail() +{ + QCopEnvelope e("QPE/System", "execute(QString)"); + e << QString("opiemail"); +} + /* |