summaryrefslogtreecommitdiff
path: root/core/pim/today/today.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/today/today.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp48
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");
+}
+
/*