summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mailit/readmail.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/mailit/readmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mailit/readmail.cpp64
1 files changed, 48 insertions, 16 deletions
diff --git a/noncore/unsupported/mailit/readmail.cpp b/noncore/unsupported/mailit/readmail.cpp
index 4eae7f6..1682675 100644
--- a/noncore/unsupported/mailit/readmail.cpp
+++ b/noncore/unsupported/mailit/readmail.cpp
@@ -19,8 +19,10 @@
19**********************************************************************/ 19**********************************************************************/
20#include "readmail.h" 20#include "readmail.h"
21#include <qimage.h> 21#include <qimage.h>
22#include <qwhatsthis.h>
22#include <qmime.h> 23#include <qmime.h>
23#include <qaction.h> 24#include <qaction.h>
25#include <qpopupmenu.h>
24#include <qpe/resource.h> 26#include <qpe/resource.h>
25 27
26ReadMail::ReadMail( QWidget* parent, const char* name, WFlags fl ) 28ReadMail::ReadMail( QWidget* parent, const char* name, WFlags fl )
@@ -42,6 +44,8 @@ void ReadMail::init()
42{ 44{
43 setToolBarsMovable(FALSE); 45 setToolBarsMovable(FALSE);
44 46
47 QPopupMenu* mailaction=new QPopupMenu(this);
48
45 bar = new QToolBar(this); 49 bar = new QToolBar(this);
46 bar->setHorizontalStretchable( TRUE ); 50 bar->setHorizontalStretchable( TRUE );
47 51
@@ -55,17 +59,11 @@ void ReadMail::init()
55 59
56 bar = new QToolBar(this); 60 bar = new QToolBar(this);
57 61
58 //reply dependant on viewing inbox 62 downloadButton = new QAction( tr( "Download" ), Resource::loadPixmap( "mailit/download" ),QString::null, 0, this, 0 );
59 replyButton = new QAction( tr( "Reply" ), Resource::loadPixmap( "mailit/reply" ), 63 connect(downloadButton, SIGNAL(activated()), this, SLOT(download()) );
60 QString::null, 0, this, 0 ); 64 downloadButton->setWhatsThis(tr("Click here to download the selected mail"));
61 connect(replyButton, SIGNAL(activated()), this, SLOT(reply()) );
62 replyButton->setWhatsThis(tr("Click here to reply to the selected mail"));
63
64 forwardButton = new QAction( tr( "Forward" ), Resource::loadPixmap( "mailit/forward" ),
65 QString::null, 0, this, 0 );
66 connect(forwardButton, SIGNAL(activated()), this, SLOT(forward()) );
67 forwardButton->setWhatsThis(tr("Click here to forward the selected mail"));
68 65
66
69 previousButton = new QAction( tr( "Previous" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); 67 previousButton = new QAction( tr( "Previous" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
70 connect( previousButton, SIGNAL( activated() ), this, SLOT( previous() ) ); 68 connect( previousButton, SIGNAL( activated() ), this, SLOT( previous() ) );
71 previousButton->addTo(bar); 69 previousButton->addTo(bar);
@@ -94,6 +92,23 @@ void ReadMail::init()
94 "<LI><B>Plain</B> shows the mail as standard plain text</LI>" 92 "<LI><B>Plain</B> shows the mail as standard plain text</LI>"
95 "Click here to switch between those view modes" )); 93 "Click here to switch between those view modes" ));
96 94
95 //reply dependant on viewing inbox
96 replyButton = new QToolButton(Resource::loadPixmap("mailit/reply"),tr("reply"),tr("reply to mail"), this,SLOT(reply()),bar);
97 QWhatsThis::add(replyButton,tr("Click here to reply to the selected mail\nPress and hold for more options."));
98 replyButton->setPopup(mailaction);
99
100 replyAllButton = new QAction( tr( "Reply all" ), Resource::loadPixmap( "mailit/reply" ),QString::null, 0, this, 0 );
101 connect(replyAllButton, SIGNAL(activated()), this, SLOT(replyAll()));
102 replyAllButton->setWhatsThis(tr("Click here to reply to the selected mail to CC: addresses also"));
103 replyAllButton->addTo(mailaction);
104
105 forwardButton = new QAction( tr( "Forward" ), Resource::loadPixmap( "mailit/forward" ),
106 QString::null, 0, this, 0 );
107 connect(forwardButton, SIGNAL(activated()), this, SLOT(forward()));
108 forwardButton->setWhatsThis(tr("Click here to forward the selected mail"));
109 forwardButton->addTo(mailaction);
110
111
97 deleteButton = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, 0, this, 0 ); 112 deleteButton = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, 0, this, 0 );
98 connect( deleteButton, SIGNAL( activated() ), this, SLOT( deleteItem() ) ); 113 connect( deleteButton, SIGNAL( activated() ), this, SLOT( deleteItem() ) );
99 deleteButton->addTo(bar); 114 deleteButton->addTo(bar);
@@ -119,19 +134,26 @@ void ReadMail::updateView()
119 mail->read = TRUE; //mark as read 134 mail->read = TRUE; //mark as read
120 inbox = mail->received; 135 inbox = mail->received;
121 136
122 replyButton->removeFrom(mailMenu); 137 replyButton->setEnabled(false);
123 replyButton->removeFrom(bar); 138 /*replyButton->removeFrom(bar);
124 forwardButton->removeFrom(mailMenu); 139 forwardButton->removeFrom(mailMenu);
125 forwardButton->removeFrom(bar); 140 forwardButton->removeFrom(bar);*/
141 downloadButton->removeFrom(bar);
142
143 //downloadButton->setEnabled(!mail->downloaded);
126 144
145
127 if (inbox == TRUE) { 146 if (inbox == TRUE) {
128 replyButton->addTo(bar); 147 replyButton->setEnabled(true);
129 replyButton->addTo(mailMenu); 148 /*replyButton->addTo(mailMenu);
130 forwardButton->addTo(bar); 149 forwardButton->addTo(bar);
131 forwardButton->addTo(mailMenu); 150 forwardButton->addTo(mailMenu);*/
132 151
133 152
134 if (!mail->downloaded) { 153 if (!mail->downloaded) {
154
155 downloadButton->addTo(bar);
156
135 //report currently viewed mail so that it will be 157 //report currently viewed mail so that it will be
136 //placed first in the queue of new mails to download 158 //placed first in the queue of new mails to download
137 emit viewingMail(mail); 159 emit viewingMail(mail);
@@ -357,6 +379,11 @@ void ReadMail::viewAttachments()
357 379
358void ReadMail::reply() 380void ReadMail::reply()
359{ 381{
382 emit replyRequested(*mail, (bool&)FALSE);
383}
384
385void ReadMail::replyAll()
386{
360 emit replyRequested(*mail, (bool&)TRUE); 387 emit replyRequested(*mail, (bool&)TRUE);
361} 388}
362 389
@@ -365,3 +392,8 @@ void ReadMail::forward()
365 emit forwardRequested(*mail); 392 emit forwardRequested(*mail);
366} 393}
367 394
395void ReadMail::download()
396{
397 emit download(mail);
398}
399