summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/mail/mailpluginwidget.cpp
Unidiff
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
@@ -27,44 +27,59 @@
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() {