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 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/pim/today/plugins/mail/mailpluginwidget.cpp b/core/pim/today/plugins/mail/mailpluginwidget.cpp index 4194270..a8e4c41 100644 --- a/core/pim/today/plugins/mail/mailpluginwidget.cpp +++ b/core/pim/today/plugins/mail/mailpluginwidget.cpp | |||
@@ -1,92 +1,92 @@ | |||
1 | /* | 1 | /* |
2 | * mailpluginwidget.cpp | 2 | * mailpluginwidget.cpp |
3 | * | 3 | * |
4 | * copyright : (c) 2002,2003,2004 by Maximilian Reiß | 4 | * copyright : (c) 2002,2003,2004 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | /*************************************************************************** | 8 | /*************************************************************************** |
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 | #include "mailpluginwidget.h" | 16 | #include "mailpluginwidget.h" |
17 | 17 | ||
18 | #include <qpe/config.h> | 18 | #include <qpe/config.h> |
19 | #include <qpe/qcopenvelope_qws.h> | 19 | #include <qpe/qcopenvelope_qws.h> |
20 | 20 | ||
21 | MailPluginWidget::MailPluginWidget( QWidget *parent, const char* name) | 21 | MailPluginWidget::MailPluginWidget( QWidget *parent, const char* name) |
22 | : QWidget(parent, name ) { | 22 | : QWidget(parent, name ) { |
23 | 23 | ||
24 | m_mailLabel = 0l; | 24 | m_mailLabel = 0l; |
25 | m_layout = 0l; | 25 | m_layout = 0l; |
26 | 26 | ||
27 | if ( m_mailLabel ) { | 27 | if ( m_mailLabel ) { |
28 | delete m_mailLabel; | 28 | delete m_mailLabel; |
29 | } | 29 | } |
30 | m_mailLabel = new OClickableLabel( this ); | 30 | m_mailLabel = new OClickableLabel( this ); |
31 | connect( m_mailLabel, SIGNAL( clicked() ), this, SLOT( startMail() ) ); | 31 | connect( m_mailLabel, SIGNAL( clicked() ), this, SLOT( startMail() ) ); |
32 | 32 | ||
33 | if ( m_layout ) { | 33 | if ( m_layout ) { |
34 | delete m_layout; | 34 | delete m_layout; |
35 | } | 35 | } |
36 | m_layout = new QHBoxLayout( this ); | 36 | m_layout = new QHBoxLayout( this ); |
37 | m_layout->setAutoAdd( true ); | 37 | m_layout->setAutoAdd( true ); |
38 | 38 | ||
39 | 39 | ||
40 | #if defined(Q_WS_QWS) | 40 | #if defined(Q_WS_QWS) |
41 | #if !defined(QT_NO_COP) | 41 | #if !defined(QT_NO_COP) |
42 | QCopChannel *qCopChannel = new QCopChannel( "QPE/Pim" , this ); | 42 | QCopChannel *qCopChannel = new QCopChannel( "QPE/Pim" , this ); |
43 | connect ( qCopChannel, SIGNAL( received( const QCString &, const QByteArray &) ), | 43 | connect ( qCopChannel, SIGNAL( received(const QCString&,const QByteArray&) ), |
44 | this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); | 44 | this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) ); |
45 | #endif | 45 | #endif |
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | readConfig(); | 48 | readConfig(); |
49 | getInfo(); | 49 | getInfo(); |
50 | } | 50 | } |
51 | 51 | ||
52 | 52 | ||
53 | void MailPluginWidget::channelReceived( const QCString &msg, const QByteArray & data ) { | 53 | void MailPluginWidget::channelReceived( const QCString &msg, const QByteArray & data ) { |
54 | QDataStream stream( data, IO_ReadOnly ); | 54 | QDataStream stream( data, IO_ReadOnly ); |
55 | if ( msg == "outgoingMails(int)" ) { | 55 | if ( msg == "outgoingMails(int)" ) { |
56 | stream >> m_outgoing; | 56 | stream >> m_outgoing; |
57 | } else if ( msg == "newMails(int)" ) { | 57 | } else if ( msg == "newMails(int)" ) { |
58 | stream >> m_newMails; | 58 | stream >> m_newMails; |
59 | } | 59 | } |
60 | getInfo(); | 60 | getInfo(); |
61 | } | 61 | } |
62 | MailPluginWidget::~MailPluginWidget() { | 62 | MailPluginWidget::~MailPluginWidget() { |
63 | delete m_mailLabel; | 63 | delete m_mailLabel; |
64 | delete m_layout; | 64 | delete m_layout; |
65 | } | 65 | } |
66 | 66 | ||
67 | 67 | ||
68 | void MailPluginWidget::readConfig() { | 68 | void MailPluginWidget::readConfig() { |
69 | Config cfg( "todaymailplugin" ); | 69 | Config cfg( "todaymailplugin" ); |
70 | cfg.setGroup( "config" ); | 70 | cfg.setGroup( "config" ); |
71 | 71 | ||
72 | Config cfg2( "mail" ); | 72 | Config cfg2( "mail" ); |
73 | cfg2.setGroup( "Status" ); | 73 | cfg2.setGroup( "Status" ); |
74 | 74 | ||
75 | m_newMails = cfg2.readNumEntry( "newMails", 0 ); | 75 | m_newMails = cfg2.readNumEntry( "newMails", 0 ); |
76 | m_outgoing = cfg2.readNumEntry( "outgoing", 0 ); | 76 | m_outgoing = cfg2.readNumEntry( "outgoing", 0 ); |
77 | } | 77 | } |
78 | 78 | ||
79 | 79 | ||
80 | void MailPluginWidget::refresh() { | 80 | void MailPluginWidget::refresh() { |
81 | getInfo(); | 81 | getInfo(); |
82 | } | 82 | } |
83 | 83 | ||
84 | void MailPluginWidget::getInfo() { | 84 | void MailPluginWidget::getInfo() { |
85 | 85 | ||
86 | 86 | ||
87 | 87 | ||
88 | m_mailLabel->setText( QObject::tr( "<b>%1</b> new mail(s), <b>%2</b> outgoing" ).arg( m_newMails ).arg( m_outgoing ) ); | 88 | m_mailLabel->setText( QObject::tr( "<b>%1</b> new mail(s), <b>%2</b> outgoing" ).arg( m_newMails ).arg( m_outgoing ) ); |
89 | } | 89 | } |
90 | 90 | ||
91 | /** | 91 | /** |
92 | * launches datebook | 92 | * launches datebook |