Diffstat (limited to 'core/pim/today/plugins/mail/mailpluginwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/today/plugins/mail/mailpluginwidget.cpp | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/core/pim/today/plugins/mail/mailpluginwidget.cpp b/core/pim/today/plugins/mail/mailpluginwidget.cpp new file mode 100644 index 0000000..a6f3562 --- a/dev/null +++ b/core/pim/today/plugins/mail/mailpluginwidget.cpp | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | * mailpluginwidget.cpp | ||
3 | * | ||
4 | * copyright : (c) 2002 by Maximilian Reiß | ||
5 | * email : harlekin@handhelds.org | ||
6 | * | ||
7 | */ | ||
8 | /*************************************************************************** | ||
9 | * * | ||
10 | * This program is free software; you can redistribute it and/or modify * | ||
11 | * it under the terms of the GNU General Public License as published by * | ||
12 | * the Free Software Foundation; either version 2 of the License, or * | ||
13 | * (at your option) any later version. * | ||
14 | * * | ||
15 | ***************************************************************************/ | ||
16 | |||
17 | |||
18 | #include <qvaluelist.h> | ||
19 | #include <qtl.h> | ||
20 | #include <qstring.h> | ||
21 | #include <qobject.h> | ||
22 | #include <qlayout.h> | ||
23 | |||
24 | #include <qpe/config.h> | ||
25 | #include <qpe/timestring.h> | ||
26 | #include <qpe/qcopenvelope_qws.h> | ||
27 | |||
28 | #include "mailpluginwidget.h" | ||
29 | |||
30 | MailPluginWidget::MailPluginWidget( QWidget *parent, const char* name) | ||
31 | : QWidget(parent, name ) { | ||
32 | |||
33 | readConfig(); | ||
34 | getInfo(); | ||
35 | } | ||
36 | |||
37 | MailPluginWidget::~MailPluginWidget() { | ||
38 | } | ||
39 | |||
40 | |||
41 | void MailPluginWidget::readConfig() { | ||
42 | Config cfg( "todaymailplugin" ); | ||
43 | cfg.setGroup( "config" ); | ||
44 | } | ||
45 | |||
46 | |||
47 | void MailPluginWidget::getInfo() { | ||
48 | |||
49 | QHBoxLayout* layout = new QHBoxLayout( this ); | ||
50 | |||
51 | mailLabel = new OClickableLabel( this ); | ||
52 | mailLabel->setMaximumHeight( 15 ); | ||
53 | connect( mailLabel, SIGNAL( clicked() ), this, SLOT( startMail() ) ); | ||
54 | |||
55 | Config cfg( "opiemail" ); | ||
56 | cfg.setGroup( "today" ); | ||
57 | |||
58 | int NEW_MAILS = cfg.readNumEntry( "newmails", 0 ); | ||
59 | int OUTGOING = cfg.readNumEntry( "outgoing", 0 ); | ||
60 | |||
61 | QString output = QObject::tr( "<b>%1</b> new mail(s), <b>%2</b> outgoing" ).arg( NEW_MAILS ).arg( OUTGOING ); | ||
62 | |||
63 | mailLabel->setText( output ); | ||
64 | layout->addWidget( mailLabel ); | ||
65 | } | ||
66 | |||
67 | /** | ||
68 | * launches datebook | ||
69 | */ | ||
70 | void MailPluginWidget::startMail() { | ||
71 | QCopEnvelope e("QPE/System", "execute(QString)"); | ||
72 | e << QString( "mail" ); | ||
73 | } | ||