From 4e6ec847f469a3669be864db69dee0d8b0e4a93b Mon Sep 17 00:00:00 2001 From: harlekin Date: Sat, 16 Feb 2002 19:59:21 +0000 Subject: new features: auto update and opiemail support --- (limited to 'core/pim/today/today.cpp') 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 @@ -35,6 +35,7 @@ #include #include #include +#include //#include //#include @@ -57,17 +58,26 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) ); 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(); QString time = (date.toString()); TextLabel1->setText(time); db = new DateBookDB; + draw(); +} + + +void Today::draw() +{ init(); getDates(); - getTodo(); -} + getMail(); + getTodo(); + QTimer::singleShot( 60*1000, this, SLOT(draw()) ); +} void Today::init() { @@ -126,10 +136,7 @@ void Today::startConfig() // sync it to "disk" cfg.write(); - init(); - getDates(); - getTodo(); - //cout << location << endl; + draw(); } @@ -262,6 +269,22 @@ QList 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("%1 new mails, %2 outgoing").arg(NEW_MAILS).arg(OUTGOING); + + + MailField->setText(output); +} + + /* * Get the todos * @@ -308,7 +331,7 @@ void Today::getTodo() } /* - * lanches datebook + * launches datebook */ void Today::startDatebook() { @@ -317,7 +340,7 @@ void Today::startDatebook() } /* - * lanches todolist + * launches todolist */ void Today::startTodo() { @@ -325,6 +348,15 @@ void Today::startTodo() e << QString("todolist"); } +/* + * launch opiemail + */ +void Today::startMail() +{ + QCopEnvelope e("QPE/System", "execute(QString)"); + e << QString("opiemail"); +} + /* * Destroys the object and frees any allocated resources */ -- cgit v0.9.0.2