author | tille <tille> | 2002-06-18 13:49:13 (UTC) |
---|---|---|
committer | tille <tille> | 2002-06-18 13:49:13 (UTC) |
commit | 99cf287037a0d9f99e4fc035d1b9f6db08bb6583 (patch) (unidiff) | |
tree | 6c4707892003f6bfb1b4b088d57aba109ef63a4a /noncore/unsupported | |
parent | 1e6635662a329dc8f7958b29044e1ce843ff7208 (diff) | |
download | opie-99cf287037a0d9f99e4fc035d1b9f6db08bb6583.zip opie-99cf287037a0d9f99e4fc035d1b9f6db08bb6583.tar.gz opie-99cf287037a0d9f99e4fc035d1b9f6db08bb6583.tar.bz2 |
added queue mail support
-rw-r--r-- | noncore/unsupported/mail2/composer.cpp | 150 | ||||
-rw-r--r-- | noncore/unsupported/mail2/composer.h | 7 | ||||
-rw-r--r-- | noncore/unsupported/mail2/composerbase.cpp | 3 | ||||
-rw-r--r-- | noncore/unsupported/mail2/composerbase.h | 2 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mainwindow.cpp | 10 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mainwindow.h | 1 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mainwindowbase.cpp | 3 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mainwindowbase.h | 2 |
8 files changed, 173 insertions, 5 deletions
diff --git a/noncore/unsupported/mail2/composer.cpp b/noncore/unsupported/mail2/composer.cpp index c36d973..cabffe5 100644 --- a/noncore/unsupported/mail2/composer.cpp +++ b/noncore/unsupported/mail2/composer.cpp | |||
@@ -6,12 +6,13 @@ | |||
6 | #include <qaction.h> | 6 | #include <qaction.h> |
7 | #include <qtimer.h> | 7 | #include <qtimer.h> |
8 | #include <qlabel.h> | 8 | #include <qlabel.h> |
9 | #include <qapplication.h> | 9 | #include <qapplication.h> |
10 | 10 | ||
11 | #include <qpe/resource.h> | 11 | #include <qpe/resource.h> |
12 | #include <qpe/config.h> | ||
12 | 13 | ||
13 | #include "addresspicker.h" | 14 | #include "addresspicker.h" |
14 | #include "listviewplus.h" | 15 | #include "listviewplus.h" |
15 | #include "smtphandler.h" | 16 | #include "smtphandler.h" |
16 | #include "attachdiag.h" | 17 | #include "attachdiag.h" |
17 | #include "composer.h" | 18 | #include "composer.h" |
@@ -22,29 +23,32 @@ AttachViewItem::AttachViewItem(QListView *parent, Attachment &attachment) | |||
22 | { | 23 | { |
23 | setPixmap(0, _attachment.docLnk().pixmap().isNull() ? Resource::loadPixmap("UnknownDocument-14") : _attachment.docLnk().pixmap()); | 24 | setPixmap(0, _attachment.docLnk().pixmap().isNull() ? Resource::loadPixmap("UnknownDocument-14") : _attachment.docLnk().pixmap()); |
24 | setText(0, _attachment.newName().isEmpty() ? _attachment.fileName() : _attachment.newName()); | 25 | setText(0, _attachment.newName().isEmpty() ? _attachment.fileName() : _attachment.newName()); |
25 | setText(1, _attachment.description()); | 26 | setText(1, _attachment.description()); |
26 | } | 27 | } |
27 | 28 | ||
28 | Composer::Composer(QWidget *parent, const char *name, WFlags fl) | 29 | Composer::Composer(QWidget *parent, const char *name, WFlags fl, bool sendQueue) |
29 | : ComposerBase(parent, name, fl), _inLoop(false) | 30 | : ComposerBase(parent, name, fl), _inLoop(false) |
30 | { | 31 | { |
32 | _sendQueued = sendQueue; | ||
31 | abort->setEnabled(false); | 33 | abort->setEnabled(false); |
32 | to->setFocus(); | 34 | to->setFocus(); |
33 | 35 | ||
34 | connect(sendmail, SIGNAL(activated()), SLOT(slotSendMail())); | 36 | connect(sendmail, SIGNAL(activated()), SLOT(slotSendMail())); |
37 | connect(queuemail, SIGNAL(activated()), SLOT(slotQueueMail())); | ||
35 | connect(addressbook, SIGNAL(activated()), SLOT(slotOpenAddressPicker())); | 38 | connect(addressbook, SIGNAL(activated()), SLOT(slotOpenAddressPicker())); |
36 | connect(addattach, SIGNAL(activated()), SLOT(slotAddAttach())); | 39 | connect(addattach, SIGNAL(activated()), SLOT(slotAddAttach())); |
37 | connect(delattach, SIGNAL(activated()), SLOT(slotDelAttach())); | 40 | connect(delattach, SIGNAL(activated()), SLOT(slotDelAttach())); |
38 | 41 | ||
39 | connect(from, SIGNAL(activated(int)), SLOT(slotFromChanged(int))); | 42 | connect(from, SIGNAL(activated(int)), SLOT(slotFromChanged(int))); |
40 | 43 | ||
41 | connect(attachPopup, SIGNAL(activated(int)), SLOT(slotPopupHandler(int))); | 44 | connect(attachPopup, SIGNAL(activated(int)), SLOT(slotPopupHandler(int))); |
42 | 45 | ||
43 | QTimer::singleShot(0, this, SLOT(slotFillStuff())); | 46 | QTimer::singleShot(0, this, SLOT(slotFillStuff())); |
44 | QTimer::singleShot(0, this, SLOT(slotResizing())); | 47 | QTimer::singleShot(0, this, SLOT(slotResizing())); |
48 | |||
45 | } | 49 | } |
46 | 50 | ||
47 | Composer::~Composer() | 51 | Composer::~Composer() |
48 | { | 52 | { |
49 | hide(); | 53 | hide(); |
50 | } | 54 | } |
@@ -87,12 +91,17 @@ void Composer::setSendMail(SendMail &sendMail) | |||
87 | } | 91 | } |
88 | 92 | ||
89 | void Composer::slotResizing() | 93 | void Composer::slotResizing() |
90 | { | 94 | { |
91 | from->setMaximumWidth(width() - fromBox->width()); | 95 | from->setMaximumWidth(width() - fromBox->width()); |
92 | from->resize(width() - fromBox->width(), y()); | 96 | from->resize(width() - fromBox->width(), y()); |
97 | if (_sendQueued) | ||
98 | { | ||
99 | slotSendQueued(); | ||
100 | close(); | ||
101 | } | ||
93 | } | 102 | } |
94 | 103 | ||
95 | void Composer::slotPopupHandler(int itemid) | 104 | void Composer::slotPopupHandler(int itemid) |
96 | { | 105 | { |
97 | if (attachView->currentItem() == NULL) { | 106 | if (attachView->currentItem() == NULL) { |
98 | QMessageBox::information(this, tr("Error"), tr("Please select an entry first."), tr("Ok")); | 107 | QMessageBox::information(this, tr("Error"), tr("Please select an entry first."), tr("Ok")); |
@@ -153,12 +162,150 @@ void Composer::slotSendMail() | |||
153 | SmtpHandler *handler = new SmtpHandler(header, message, accountsLoaded[from->currentItem()], to->text()); | 162 | SmtpHandler *handler = new SmtpHandler(header, message, accountsLoaded[from->currentItem()], to->text()); |
154 | connect(handler, SIGNAL(finished()), SLOT(slotSendFinished())); | 163 | connect(handler, SIGNAL(finished()), SLOT(slotSendFinished())); |
155 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendError(const QString &))); | 164 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendError(const QString &))); |
156 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); | 165 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); |
157 | } | 166 | } |
158 | 167 | ||
168 | void Composer::slotSendQueued() | ||
169 | { | ||
170 | |||
171 | qDebug("Sending queued messages"); | ||
172 | Config cfg( "mailqueue", Config::User ); | ||
173 | cfg.setGroup( "Settings" ); | ||
174 | int count = cfg.readNumEntry( "count", 0 ); | ||
175 | // tille: should not be here | ||
176 | // but no error checking for the moment | ||
177 | cfg.writeEntry( "count", 0 ); | ||
178 | |||
179 | |||
180 | qDebug("%i messages to send", count); | ||
181 | QString str; | ||
182 | for (int i=1;i<=count;i++) | ||
183 | { | ||
184 | qDebug("sending message %i",i); | ||
185 | cfg.setGroup( "Mail_" + QString::number(i) ); | ||
186 | SendMail smail; | ||
187 | str = cfg.readEntry("from"); | ||
188 | qDebug("setFrom %s",str.latin1()); | ||
189 | smail.setFrom( str ); | ||
190 | str = cfg.readEntry("reply"); | ||
191 | qDebug("setReplyTo %s",str.latin1()); | ||
192 | smail.setReplyTo( str ); | ||
193 | QString toAdr = cfg.readEntry("to"); | ||
194 | qDebug("to %s",toAdr.latin1()); | ||
195 | smail.setTo( toAdr ); //to->text()); | ||
196 | str = cfg.readEntry("cc"); | ||
197 | qDebug("setCc %s",str.latin1()); | ||
198 | smail.setCc( str ); //cc->text()); | ||
199 | smail.setBcc( cfg.readEntry("bcc") ); //bcc->text()); | ||
200 | str = cfg.readEntry("subject"); | ||
201 | qDebug("setSubject %s",str.latin1()); | ||
202 | smail.setSubject( str ); //subject->text()); | ||
203 | str = cfg.readEntryCrypt("message"); | ||
204 | qDebug("setMessage %s",str.latin1()); | ||
205 | smail.setMessage( str ); //message->text()); | ||
206 | smail.setNeedsMime( cfg.readBoolEntry("mime") ); //attachView->childCount() == 0 ? false : true); | ||
207 | |||
208 | qDebug("setting account [%i]",cfg.readNumEntry("account")); | ||
209 | Account accnt = accountsLoaded[ cfg.readNumEntry("account") ]; | ||
210 | smail.setAccount( accnt ); //accountsLoaded[from->currentItem()]); | ||
211 | |||
212 | |||
213 | int prio = cfg.readNumEntry( "priority" ); | ||
214 | qDebug("setting priority %i",prio); | ||
215 | if (prio == POPUP_PRIO_LOW) { | ||
216 | smail.setPriority("Low");// No i18n on purpose | ||
217 | } else if (prio == POPUP_PRIO_NORMAL) { | ||
218 | smail.setPriority("Normal");// No i18n on purpose | ||
219 | } else if (prio == POPUP_PRIO_HIGH) { | ||
220 | smail.setPriority("High");// No i18n on purpose | ||
221 | } | ||
222 | |||
223 | QValueList<Attachment> attachments; | ||
224 | Attachment a; | ||
225 | QString an; | ||
226 | |||
227 | int ac = cfg.readNumEntry( "attachments", 0 ); | ||
228 | qDebug("%i Attachments",ac); | ||
229 | for (int j = 0; i < ac; ac++) { | ||
230 | an = "Attachment_" + QString::number( j ); | ||
231 | qDebug(an.latin1()); | ||
232 | a.setFileName(cfg.readEntry( an + "fileName" )); | ||
233 | a.setNewName(cfg.readEntry( an + "newName" )); | ||
234 | a.setDescription(cfg.readEntry( an + "description" )); | ||
235 | a.setDocLnk( DocLnk( cfg.readEntry( an + "docLnk" )) ); | ||
236 | attachments.append( a ); | ||
237 | } | ||
238 | |||
239 | smail.setAttachments(attachments); | ||
240 | |||
241 | qDebug("putting mail together"); | ||
242 | |||
243 | QString header, message; | ||
244 | MailFactory::genMail(header, message, smail, this); | ||
245 | if (header.isNull() || message.isNull()) continue;//return;// Aborted. | ||
246 | |||
247 | // abort->setEnabled(true); | ||
248 | |||
249 | qDebug("Sending to %s",toAdr.latin1()); | ||
250 | SmtpHandler *handler = new SmtpHandler(header, message, accnt ,toAdr); | ||
251 | |||
252 | connect(handler, SIGNAL(finished()), SLOT(slotSendFinished())); | ||
253 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendError(const QString &))); | ||
254 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); | ||
255 | |||
256 | qDebug("remove mail %i", i); | ||
257 | cfg.clearGroup(); | ||
258 | cfg.removeEntry( "Mail_" + QString::number(i) ); | ||
259 | } | ||
260 | } | ||
261 | |||
262 | void Composer::slotQueueMail() | ||
263 | { | ||
264 | if (to->text().find(QRegExp(".*\\@.*\\..*")) == -1) { | ||
265 | QMessageBox::information(this, tr("Error"), tr("<p>You have to specify a recipient.<br>(eg: foo@bar.org)</p>"), tr("Ok")); | ||
266 | return; | ||
267 | } | ||
268 | |||
269 | Config cfg( "mailqueue", Config::User ); | ||
270 | |||
271 | cfg.setGroup( "Settings" ); | ||
272 | int count = cfg.readNumEntry( "count", 0 ); | ||
273 | count++; | ||
274 | cfg.writeEntry( "count", count ); | ||
275 | qDebug("queueing mail %i",count); | ||
276 | |||
277 | cfg.setGroup( "Mail_" + QString::number( count )); | ||
278 | cfg.writeEntry( "from", from->currentText() ); | ||
279 | cfg.writeEntry( "reply", replyto->text()); | ||
280 | cfg.writeEntry( "to", to->text()); | ||
281 | cfg.writeEntry( "cc", cc->text()); | ||
282 | cfg.writeEntry( "bcc", bcc->text()); | ||
283 | cfg.writeEntry( "subject", subject->text()); | ||
284 | cfg.writeEntryCrypt( "message", message->text()); | ||
285 | cfg.writeEntry( "mime", attachView->childCount() == 0 ); | ||
286 | cfg.writeEntry( "account", from->currentItem()); | ||
287 | cfg.writeEntry( "priority", priority->currentItem() ); | ||
288 | cfg.writeEntry( "attachments", attachView->childCount() ); | ||
289 | |||
290 | Attachment a; | ||
291 | QListViewItem *item; | ||
292 | QString an; | ||
293 | int i = 0; | ||
294 | for (item = attachView->firstChild(); item != 0; item = item->itemBelow()) { | ||
295 | a = ((AttachViewItem *)item)->attachment(); | ||
296 | an = "Attachment_" + QString::number( i++ ); | ||
297 | cfg.writeEntry( an + "fileName", a.fileName() ); | ||
298 | cfg.writeEntry( an + "newName", a.newName() ); | ||
299 | cfg.writeEntry( an + "description", a.description() ); | ||
300 | cfg.writeEntry( an + "docLnk", a.docLnk().file() ); | ||
301 | } | ||
302 | |||
303 | //cfg.close(); | ||
304 | } | ||
305 | |||
159 | void Composer::slotSendError(const QString &error) | 306 | void Composer::slotSendError(const QString &error) |
160 | { | 307 | { |
161 | status->setText(tr("<font color=#ff0000>Error occoured during sending.</font>")); | 308 | status->setText(tr("<font color=#ff0000>Error occoured during sending.</font>")); |
162 | QMessageBox::warning(this, tr("Error"), tr("<p>%1</p").arg(error), tr("Ok")); | 309 | QMessageBox::warning(this, tr("Error"), tr("<p>%1</p").arg(error), tr("Ok")); |
163 | } | 310 | } |
164 | 311 | ||
@@ -238,7 +385,6 @@ void Composer::slotAddAttach() | |||
238 | 385 | ||
239 | void Composer::slotDelAttach() | 386 | void Composer::slotDelAttach() |
240 | { | 387 | { |
241 | if (attachView->currentItem() == NULL) return; | 388 | if (attachView->currentItem() == NULL) return; |
242 | attachView->takeItem(attachView->currentItem()); | 389 | attachView->takeItem(attachView->currentItem()); |
243 | } | 390 | } |
244 | |||
diff --git a/noncore/unsupported/mail2/composer.h b/noncore/unsupported/mail2/composer.h index 2640d7e..00235bf 100644 --- a/noncore/unsupported/mail2/composer.h +++ b/noncore/unsupported/mail2/composer.h | |||
@@ -22,23 +22,27 @@ private: | |||
22 | 22 | ||
23 | class Composer : public ComposerBase | 23 | class Composer : public ComposerBase |
24 | { | 24 | { |
25 | Q_OBJECT | 25 | Q_OBJECT |
26 | 26 | ||
27 | public: | 27 | public: |
28 | Composer(QWidget *parent = 0, const char *name = 0, WFlags fl = Qt::WType_Modal); | 28 | Composer(QWidget *parent = 0, const char *name = 0, WFlags fl = Qt::WType_Modal, bool sendQueue = false); |
29 | ~Composer(); | 29 | ~Composer(); |
30 | 30 | ||
31 | void hide(); | 31 | void hide(); |
32 | void exec(); | 32 | void exec(); |
33 | 33 | ||
34 | void setSendMail(SendMail &sendMail); | 34 | void setSendMail(SendMail &sendMail); |
35 | 35 | ||
36 | public slots: | ||
37 | void slotSendQueued(); | ||
38 | |||
36 | protected slots: | 39 | protected slots: |
37 | void slotPopupHandler(int itemid); | 40 | void slotPopupHandler(int itemid); |
38 | void slotSendMail(); | 41 | void slotSendMail(); |
42 | void slotQueueMail(); | ||
39 | void slotSendError(const QString &); | 43 | void slotSendError(const QString &); |
40 | void slotSendFinished(); | 44 | void slotSendFinished(); |
41 | void slotResizing(); | 45 | void slotResizing(); |
42 | void slotFillStuff(); | 46 | void slotFillStuff(); |
43 | void slotFromChanged(int id); | 47 | void slotFromChanged(int id); |
44 | void slotOpenAddressPicker(); | 48 | void slotOpenAddressPicker(); |
@@ -46,12 +50,13 @@ protected slots: | |||
46 | void slotDelAttach(); | 50 | void slotDelAttach(); |
47 | 51 | ||
48 | protected: | 52 | protected: |
49 | QValueList<Account> accountsLoaded; | 53 | QValueList<Account> accountsLoaded; |
50 | 54 | ||
51 | private: | 55 | private: |
56 | bool _sendQueued; | ||
52 | bool _inLoop; | 57 | bool _inLoop; |
53 | QString _inReplyTo; | 58 | QString _inReplyTo; |
54 | 59 | ||
55 | }; | 60 | }; |
56 | 61 | ||
57 | #endif | 62 | #endif |
diff --git a/noncore/unsupported/mail2/composerbase.cpp b/noncore/unsupported/mail2/composerbase.cpp index 10d567d..6627701 100644 --- a/noncore/unsupported/mail2/composerbase.cpp +++ b/noncore/unsupported/mail2/composerbase.cpp | |||
@@ -23,12 +23,15 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) | |||
23 | addToolBar(toolbar); | 23 | addToolBar(toolbar); |
24 | toolbar->setHorizontalStretchable(true); | 24 | toolbar->setHorizontalStretchable(true); |
25 | 25 | ||
26 | sendmail = new QAction(tr("Send the mail"), QIconSet(Resource::loadPixmap("mail/sendmail")), 0, 0, this); | 26 | sendmail = new QAction(tr("Send the mail"), QIconSet(Resource::loadPixmap("mail/sendmail")), 0, 0, this); |
27 | sendmail->addTo(toolbar); | 27 | sendmail->addTo(toolbar); |
28 | 28 | ||
29 | queuemail = new QAction(tr("Queue the mail"), QIconSet(Resource::loadPixmap("mail/sendall")), 0, 0, this); | ||
30 | queuemail->addTo(toolbar); | ||
31 | |||
29 | attachfile = new QAction(tr("Attach a file"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true); | 32 | attachfile = new QAction(tr("Attach a file"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true); |
30 | attachfile->addTo(toolbar); | 33 | attachfile->addTo(toolbar); |
31 | connect(attachfile, SIGNAL(toggled(bool)), SLOT(slotAttachfileChanged(bool))); | 34 | connect(attachfile, SIGNAL(toggled(bool)), SLOT(slotAttachfileChanged(bool))); |
32 | 35 | ||
33 | addressbook = new QAction(tr("Addressbook"), QIconSet(Resource::loadPixmap("mail/addbook")), 0, 0, this); | 36 | addressbook = new QAction(tr("Addressbook"), QIconSet(Resource::loadPixmap("mail/addbook")), 0, 0, this); |
34 | addressbook->addTo(toolbar); | 37 | addressbook->addTo(toolbar); |
diff --git a/noncore/unsupported/mail2/composerbase.h b/noncore/unsupported/mail2/composerbase.h index 75b77f4..9d3e4fc 100644 --- a/noncore/unsupported/mail2/composerbase.h +++ b/noncore/unsupported/mail2/composerbase.h | |||
@@ -38,13 +38,13 @@ protected: | |||
38 | ListViewPlus *attachView; | 38 | ListViewPlus *attachView; |
39 | QMainWindow *attachWindow; | 39 | QMainWindow *attachWindow; |
40 | QPopupMenu *attachPopup; | 40 | QPopupMenu *attachPopup; |
41 | QPEToolBar *toolbar, *attachToolbar; | 41 | QPEToolBar *toolbar, *attachToolbar; |
42 | QComboBox *fromBox, *from, *receiversBox, *subjectBox, *priority; | 42 | QComboBox *fromBox, *from, *receiversBox, *subjectBox, *priority; |
43 | QLineEdit *replyto, *to, *cc, *bcc, *subject; | 43 | QLineEdit *replyto, *to, *cc, *bcc, *subject; |
44 | QAction *sendmail, *attachfile, *addressbook, *abort, *addattach, *delattach; | 44 | QAction *sendmail, *queuemail, *attachfile, *addressbook, *abort, *addattach, *delattach; |
45 | QLabel *fromLabel, *status; | 45 | QLabel *fromLabel, *status; |
46 | 46 | ||
47 | protected slots: | 47 | protected slots: |
48 | void slotAttachfileChanged(bool toggled); | 48 | void slotAttachfileChanged(bool toggled); |
49 | void slotFromMenuChanged(int id); | 49 | void slotFromMenuChanged(int id); |
50 | void slotReceiverMenuChanged(int id); | 50 | void slotReceiverMenuChanged(int id); |
diff --git a/noncore/unsupported/mail2/mainwindow.cpp b/noncore/unsupported/mail2/mainwindow.cpp index 2230dc0..652db94 100644 --- a/noncore/unsupported/mail2/mainwindow.cpp +++ b/noncore/unsupported/mail2/mainwindow.cpp | |||
@@ -27,23 +27,33 @@ MainWindow::MainWindow(QWidget *parent, const char *name, WFlags fl) | |||
27 | connect(mailView, SIGNAL(resetProgress()), statusProgress, SLOT(reset())); | 27 | connect(mailView, SIGNAL(resetProgress()), statusProgress, SLOT(reset())); |
28 | connect(mailView, SIGNAL(stopEnabled(bool)), stop, SLOT(setEnabled(bool))); | 28 | connect(mailView, SIGNAL(stopEnabled(bool)), stop, SLOT(setEnabled(bool))); |
29 | 29 | ||
30 | connect(stop, SIGNAL(activated()), mailView, SLOT(stop())); | 30 | connect(stop, SIGNAL(activated()), mailView, SLOT(stop())); |
31 | 31 | ||
32 | connect(compose, SIGNAL(activated()), SLOT(slotCompose())); | 32 | connect(compose, SIGNAL(activated()), SLOT(slotCompose())); |
33 | connect(sendQueue, SIGNAL(activated()), SLOT(slotSendQueued())); | ||
33 | connect(findmails, SIGNAL(activated()), SLOT(slotSearch())); | 34 | connect(findmails, SIGNAL(activated()), SLOT(slotSearch())); |
34 | connect(configure, SIGNAL(activated()), SLOT(slotConfigure())); | 35 | connect(configure, SIGNAL(activated()), SLOT(slotConfigure())); |
35 | } | 36 | } |
36 | 37 | ||
37 | void MainWindow::slotCompose() | 38 | void MainWindow::slotCompose() |
38 | { | 39 | { |
39 | Composer composer(this, 0, true); | 40 | Composer composer(this, 0, true); |
40 | composer.showMaximized(); | 41 | composer.showMaximized(); |
41 | composer.exec(); | 42 | composer.exec(); |
42 | } | 43 | } |
43 | 44 | ||
45 | void MainWindow::slotSendQueued() | ||
46 | { | ||
47 | Composer composer(this, 0, true, true); | ||
48 | // composer.sendQueue(); | ||
49 | composer.showMaximized(); | ||
50 | composer.exec(); | ||
51 | //composer.close(); | ||
52 | } | ||
53 | |||
44 | void MainWindow::slotSearch() | 54 | void MainWindow::slotSearch() |
45 | { | 55 | { |
46 | SearchDiag searchDiag(this, 0, true); | 56 | SearchDiag searchDiag(this, 0, true); |
47 | searchDiag.showMaximized(); | 57 | searchDiag.showMaximized(); |
48 | searchDiag.exec(); | 58 | searchDiag.exec(); |
49 | } | 59 | } |
diff --git a/noncore/unsupported/mail2/mainwindow.h b/noncore/unsupported/mail2/mainwindow.h index 1edf10b..27b527d 100644 --- a/noncore/unsupported/mail2/mainwindow.h +++ b/noncore/unsupported/mail2/mainwindow.h | |||
@@ -12,12 +12,13 @@ class MainWindow : public MainWindowBase | |||
12 | 12 | ||
13 | public: | 13 | public: |
14 | MainWindow(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); | 14 | MainWindow(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); |
15 | 15 | ||
16 | protected slots: | 16 | protected slots: |
17 | void slotCompose(); | 17 | void slotCompose(); |
18 | void slotSendQueued(); | ||
18 | void slotSearch(); | 19 | void slotSearch(); |
19 | void slotConfigure(); | 20 | void slotConfigure(); |
20 | void mailClicked(IMAPResponseFETCH mail, IMAPHandler *handler); | 21 | void mailClicked(IMAPResponseFETCH mail, IMAPHandler *handler); |
21 | 22 | ||
22 | }; | 23 | }; |
23 | 24 | ||
diff --git a/noncore/unsupported/mail2/mainwindowbase.cpp b/noncore/unsupported/mail2/mainwindowbase.cpp index c55bd90..24f030f 100644 --- a/noncore/unsupported/mail2/mainwindowbase.cpp +++ b/noncore/unsupported/mail2/mainwindowbase.cpp | |||
@@ -23,12 +23,15 @@ MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl) | |||
23 | addToolBar(toolbar); | 23 | addToolBar(toolbar); |
24 | toolbar->setHorizontalStretchable(true); | 24 | toolbar->setHorizontalStretchable(true); |
25 | 25 | ||
26 | compose = new QAction(tr("Compose new mail"), QIconSet(Resource::loadPixmap("mail/newmail")), 0, 0, this); | 26 | compose = new QAction(tr("Compose new mail"), QIconSet(Resource::loadPixmap("mail/newmail")), 0, 0, this); |
27 | compose->addTo(toolbar); | 27 | compose->addTo(toolbar); |
28 | 28 | ||
29 | sendQueue = new QAction(tr("Send queued mails"), QIconSet(Resource::loadPixmap("mail/sendqueue")), 0, 0, this); | ||
30 | sendQueue->addTo(toolbar); | ||
31 | |||
29 | folders = new QAction(tr("Show/hide folders"), QIconSet(Resource::loadPixmap("mail/folder")), 0, 0, this, 0, true); | 32 | folders = new QAction(tr("Show/hide folders"), QIconSet(Resource::loadPixmap("mail/folder")), 0, 0, this, 0, true); |
30 | folders->addTo(toolbar); | 33 | folders->addTo(toolbar); |
31 | connect(folders, SIGNAL(toggled(bool)), SLOT(slotFoldersToggled(bool))); | 34 | connect(folders, SIGNAL(toggled(bool)), SLOT(slotFoldersToggled(bool))); |
32 | 35 | ||
33 | findmails = new QAction(tr("Search mails"), QIconSet(Resource::loadPixmap("mail/find")), 0, 0, this); | 36 | findmails = new QAction(tr("Search mails"), QIconSet(Resource::loadPixmap("mail/find")), 0, 0, this); |
34 | findmails->addTo(toolbar); | 37 | findmails->addTo(toolbar); |
diff --git a/noncore/unsupported/mail2/mainwindowbase.h b/noncore/unsupported/mail2/mainwindowbase.h index 0776f02..232d656 100644 --- a/noncore/unsupported/mail2/mainwindowbase.h +++ b/noncore/unsupported/mail2/mainwindowbase.h | |||
@@ -24,12 +24,12 @@ protected slots: | |||
24 | protected: | 24 | protected: |
25 | ServerConnection *serverConnection; | 25 | ServerConnection *serverConnection; |
26 | QProgressBar *statusProgress; | 26 | QProgressBar *statusProgress; |
27 | FolderWidget *folderView; | 27 | FolderWidget *folderView; |
28 | QPEToolBar *toolbar; | 28 | QPEToolBar *toolbar; |
29 | MailTable *mailView; | 29 | MailTable *mailView; |
30 | QAction *compose, *folders, *findmails, *configure, *stop; | 30 | QAction *compose, *sendQueue, *folders, *findmails, *configure, *stop; |
31 | QLabel *statusLabel; | 31 | QLabel *statusLabel; |
32 | 32 | ||
33 | }; | 33 | }; |
34 | 34 | ||
35 | #endif | 35 | #endif |