Diffstat (limited to 'noncore/net/mailit/readmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mailit/readmail.cpp | 64 |
1 files changed, 48 insertions, 16 deletions
diff --git a/noncore/net/mailit/readmail.cpp b/noncore/net/mailit/readmail.cpp index 4eae7f6..1682675 100644 --- a/noncore/net/mailit/readmail.cpp +++ b/noncore/net/mailit/readmail.cpp | |||
@@ -20,6 +20,8 @@ | |||
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 | ||
@@ -43,4 +45,6 @@ void ReadMail::init() | |||
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 ); |
@@ -56,15 +60,9 @@ void ReadMail::init() | |||
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() ) ); |
@@ -95,4 +93,21 @@ void ReadMail::init() | |||
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() ) ); |
@@ -120,17 +135,24 @@ void ReadMail::updateView() | |||
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 |
@@ -358,4 +380,9 @@ void ReadMail::viewAttachments() | |||
358 | void ReadMail::reply() | 380 | void ReadMail::reply() |
359 | { | 381 | { |
382 | emit replyRequested(*mail, (bool&)FALSE); | ||
383 | } | ||
384 | |||
385 | void ReadMail::replyAll() | ||
386 | { | ||
360 | emit replyRequested(*mail, (bool&)TRUE); | 387 | emit replyRequested(*mail, (bool&)TRUE); |
361 | } | 388 | } |
@@ -366,2 +393,7 @@ void ReadMail::forward() | |||
366 | } | 393 | } |
367 | 394 | ||
395 | void ReadMail::download() | ||
396 | { | ||
397 | emit download(mail); | ||
398 | } | ||
399 | |||