-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 @@ | |||
37 | #include <qlabel.h> | 37 | #include <qlabel.h> |
38 | #include <qtimer.h> | ||
38 | 39 | ||
@@ -59,2 +60,3 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) | |||
59 | QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) ); | 60 | QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) ); |
61 | QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startMail() ) ); | ||
60 | 62 | ||
@@ -65,7 +67,15 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) | |||
65 | 67 | ||
68 | draw(); | ||
69 | } | ||
70 | |||
71 | |||
72 | void Today::draw() | ||
73 | { | ||
66 | init(); | 74 | init(); |
67 | getDates(); | 75 | getDates(); |
68 | getTodo(); | 76 | getMail(); |
69 | } | 77 | getTodo(); |
78 | QTimer::singleShot( 60*1000, this, SLOT(draw()) ); | ||
70 | 79 | ||
80 | } | ||
71 | 81 | ||
@@ -128,6 +138,3 @@ void Today::startConfig() | |||
128 | 138 | ||
129 | init(); | 139 | draw(); |
130 | getDates(); | ||
131 | getTodo(); | ||
132 | //cout << location << endl; | ||
133 | } | 140 | } |
@@ -264,2 +271,18 @@ QList<TodoItem> Today::loadTodo(const char *filename) | |||
264 | 271 | ||
272 | void Today::getMail() | ||
273 | { | ||
274 | Config cfg("opiemail"); | ||
275 | cfg.setGroup("today"); | ||
276 | |||
277 | // how many lines should be showed in the task section | ||
278 | int NEW_MAILS = cfg.readNumEntry("newmails",0); | ||
279 | int OUTGOING = cfg.readNumEntry("outgoing",0); | ||
280 | |||
281 | QString output = tr("<b>%1</b> new mails, <b>%2</b> outgoing").arg(NEW_MAILS).arg(OUTGOING); | ||
282 | |||
283 | |||
284 | MailField->setText(output); | ||
285 | } | ||
286 | |||
287 | |||
265 | /* | 288 | /* |
@@ -310,3 +333,3 @@ void Today::getTodo() | |||
310 | /* | 333 | /* |
311 | * lanches datebook | 334 | * launches datebook |
312 | */ | 335 | */ |
@@ -319,3 +342,3 @@ void Today::startDatebook() | |||
319 | /* | 342 | /* |
320 | * lanches todolist | 343 | * launches todolist |
321 | */ | 344 | */ |
@@ -327,2 +350,11 @@ void Today::startTodo() | |||
327 | 350 | ||
351 | /* | ||
352 | * launch opiemail | ||
353 | */ | ||
354 | void Today::startMail() | ||
355 | { | ||
356 | QCopEnvelope e("QPE/System", "execute(QString)"); | ||
357 | e << QString("opiemail"); | ||
358 | } | ||
359 | |||
328 | /* | 360 | /* |