summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/mail/mailpluginwidget.cpp
authorharlekin <harlekin>2003-02-10 21:28:14 (UTC)
committer harlekin <harlekin>2003-02-10 21:28:14 (UTC)
commitbbb3cdf8f91d567f6c2e786bd144b64bd679ff9a (patch) (unidiff)
tree9c622e670cab66c44d9bd079707945cf3c9bcb89 /core/pim/today/plugins/mail/mailpluginwidget.cpp
parentde272b8c47c3960a3fe574317fe2e6fb0c32e4af (diff)
downloadopie-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) (show whitespace changes)
-rw-r--r--core/pim/today/plugins/mail/mailpluginwidget.cpp33
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
@@ -21,53 +21,68 @@
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
30MailPluginWidget::MailPluginWidget( QWidget *parent, const char* name) 30MailPluginWidget::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
37MailPluginWidget::~MailPluginWidget() { 53MailPluginWidget::~MailPluginWidget() {
54 delete m_mailLabel;
55 delete m_layout;
38} 56}
39 57
40 58
41void MailPluginWidget::readConfig() { 59void MailPluginWidget::readConfig() {
42 Config cfg( "todaymailplugin" ); 60 Config cfg( "todaymailplugin" );
43 cfg.setGroup( "config" ); 61 cfg.setGroup( "config" );
44} 62}
45 63
46 64
47void MailPluginWidget::getInfo() { 65void MailPluginWidget::refresh() {
48 66 getInfo();
49 QHBoxLayout* layout = new QHBoxLayout( this ); 67}
50 68
51 mailLabel = new OClickableLabel( this ); 69void 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 */
70void MailPluginWidget::startMail() { 85void 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}