author | harlekin <harlekin> | 2003-02-10 21:28:14 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-02-10 21:28:14 (UTC) |
commit | bbb3cdf8f91d567f6c2e786bd144b64bd679ff9a (patch) (unidiff) | |
tree | 9c622e670cab66c44d9bd079707945cf3c9bcb89 /core/pim/today/plugins/mail/mailpluginwidget.cpp | |
parent | de272b8c47c3960a3fe574317fe2e6fb0c32e4af (diff) | |
download | opie-bbb3cdf8f91d567f6c2e786bd144b64bd679ff9a.zip opie-bbb3cdf8f91d567f6c2e786bd144b64bd679ff9a.tar.gz opie-bbb3cdf8f91d567f6c2e786bd144b64bd679ff9a.tar.bz2 |
adapted to new refresh, datebookplugin still need some work
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 | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/core/pim/today/plugins/mail/mailpluginwidget.cpp b/core/pim/today/plugins/mail/mailpluginwidget.cpp index a6f3562..aad1d07 100644 --- a/core/pim/today/plugins/mail/mailpluginwidget.cpp +++ b/core/pim/today/plugins/mail/mailpluginwidget.cpp | |||
@@ -9,65 +9,80 @@ | |||
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 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 * | 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 * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | 17 | ||
18 | #include <qvaluelist.h> | 18 | #include <qvaluelist.h> |
19 | #include <qtl.h> | 19 | #include <qtl.h> |
20 | #include <qstring.h> | 20 | #include <qstring.h> |
21 | #include <qobject.h> | 21 | #include <qobject.h> |
22 | #include <qlayout.h> | 22 | #include <qlayout.h> |
23 | 23 | ||
24 | #include <qpe/config.h> | 24 | #include <qpe/config.h> |
25 | #include <qpe/timestring.h> | 25 | #include <qpe/timestring.h> |
26 | #include <qpe/qcopenvelope_qws.h> | 26 | #include <qpe/qcopenvelope_qws.h> |
27 | 27 | ||
28 | #include "mailpluginwidget.h" | 28 | #include "mailpluginwidget.h" |
29 | 29 | ||
30 | MailPluginWidget::MailPluginWidget( QWidget *parent, const char* name) | 30 | MailPluginWidget::MailPluginWidget( QWidget *parent, const char* name) |
31 | : QWidget(parent, name ) { | 31 | : QWidget(parent, name ) { |
32 | 32 | ||
33 | m_mailLabel = 0l; | ||
34 | m_layout = 0l; | ||
35 | |||
36 | if ( m_mailLabel ) { | ||
37 | delete m_mailLabel; | ||
38 | } | ||
39 | m_mailLabel = new OClickableLabel( this ); | ||
40 | m_mailLabel->setMaximumHeight( 15 ); | ||
41 | connect( m_mailLabel, SIGNAL( clicked() ), this, SLOT( startMail() ) ); | ||
42 | |||
43 | if ( m_layout ) { | ||
44 | delete m_layout; | ||
45 | } | ||
46 | m_layout = new QHBoxLayout( this ); | ||
47 | m_layout->setAutoAdd( true ); | ||
48 | |||
33 | readConfig(); | 49 | readConfig(); |
34 | getInfo(); | 50 | getInfo(); |
35 | } | 51 | } |
36 | 52 | ||
37 | MailPluginWidget::~MailPluginWidget() { | 53 | MailPluginWidget::~MailPluginWidget() { |
54 | delete m_mailLabel; | ||
55 | delete m_layout; | ||
38 | } | 56 | } |
39 | 57 | ||
40 | 58 | ||
41 | void MailPluginWidget::readConfig() { | 59 | void MailPluginWidget::readConfig() { |
42 | Config cfg( "todaymailplugin" ); | 60 | Config cfg( "todaymailplugin" ); |
43 | cfg.setGroup( "config" ); | 61 | cfg.setGroup( "config" ); |
44 | } | 62 | } |
45 | 63 | ||
46 | 64 | ||
47 | void MailPluginWidget::getInfo() { | 65 | void MailPluginWidget::refresh() { |
48 | 66 | getInfo(); | |
49 | QHBoxLayout* layout = new QHBoxLayout( this ); | 67 | } |
50 | 68 | ||
51 | mailLabel = new OClickableLabel( this ); | 69 | void MailPluginWidget::getInfo() { |
52 | mailLabel->setMaximumHeight( 15 ); | ||
53 | connect( mailLabel, SIGNAL( clicked() ), this, SLOT( startMail() ) ); | ||
54 | 70 | ||
55 | Config cfg( "opiemail" ); | 71 | Config cfg( "opiemail" ); |
56 | cfg.setGroup( "today" ); | 72 | cfg.setGroup( "today" ); |
57 | 73 | ||
58 | int NEW_MAILS = cfg.readNumEntry( "newmails", 0 ); | 74 | int NEW_MAILS = cfg.readNumEntry( "newmails", 0 ); |
59 | int OUTGOING = cfg.readNumEntry( "outgoing", 0 ); | 75 | int OUTGOING = cfg.readNumEntry( "outgoing", 0 ); |
60 | 76 | ||
61 | QString output = QObject::tr( "<b>%1</b> new mail(s), <b>%2</b> outgoing" ).arg( NEW_MAILS ).arg( OUTGOING ); | 77 | //QString output = QObject::tr( "<b>%1</b> new mail(s), <b>%2</b> outgoing" ).arg( NEW_MAILS ).arg( OUTGOING ); |
62 | 78 | ||
63 | mailLabel->setText( output ); | 79 | m_mailLabel->setText( QObject::tr( "<b>%1</b> new mail(s), <b>%2</b> outgoing" ).arg( NEW_MAILS ).arg( OUTGOING ) ); |
64 | layout->addWidget( mailLabel ); | ||
65 | } | 80 | } |
66 | 81 | ||
67 | /** | 82 | /** |
68 | * launches datebook | 83 | * launches datebook |
69 | */ | 84 | */ |
70 | void MailPluginWidget::startMail() { | 85 | void MailPluginWidget::startMail() { |
71 | QCopEnvelope e("QPE/System", "execute(QString)"); | 86 | QCopEnvelope e("QPE/System", "execute(QString)"); |
72 | e << QString( "mail" ); | 87 | e << QString( "mail" ); |
73 | } | 88 | } |