-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 @@ -36,4 +36,5 @@ #include <qpushbutton.h> #include <qlabel.h> +#include <qtimer.h> //#include <iostream.h> @@ -58,4 +59,5 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) ); QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) ); + QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startMail() ) ); QDate date = QDate::currentDate(); @@ -64,9 +66,17 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) db = new DateBookDB; + draw(); +} + + +void Today::draw() +{ init(); getDates(); - getTodo(); -} + getMail(); + getTodo(); + QTimer::singleShot( 60*1000, this, SLOT(draw()) ); +} void Today::init() @@ -127,8 +137,5 @@ void Today::startConfig() cfg.write(); - init(); - getDates(); - getTodo(); - //cout << location << endl; + draw(); } @@ -263,4 +270,20 @@ 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); +} + + /* * Get the todos @@ -309,5 +332,5 @@ void Today::getTodo() /* - * lanches datebook + * launches datebook */ void Today::startDatebook() @@ -318,5 +341,5 @@ void Today::startDatebook() /* - * lanches todolist + * launches todolist */ void Today::startTodo() @@ -326,4 +349,13 @@ void Today::startTodo() } +/* + * launch opiemail + */ +void Today::startMail() +{ + QCopEnvelope e("QPE/System", "execute(QString)"); + e << QString("opiemail"); +} + /* * Destroys the object and frees any allocated resources |