Diffstat (limited to 'noncore/unsupported/mail2/composer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mail2/composer.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/noncore/unsupported/mail2/composer.cpp b/noncore/unsupported/mail2/composer.cpp index 52ebbdd..cb80299 100644 --- a/noncore/unsupported/mail2/composer.cpp +++ b/noncore/unsupported/mail2/composer.cpp | |||
@@ -9,14 +9,14 @@ | |||
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 | #include <qpe/config.h> |
13 | 13 | ||
14 | #include <opie/ofiledialog.h> | 14 | #include <opie/ofiledialog.h> |
15 | //#include "attachdiag.h" | ||
16 | 15 | ||
16 | #include "mailstatusbar.h" | ||
17 | #include "addresspicker.h" | 17 | #include "addresspicker.h" |
18 | #include "listviewplus.h" | 18 | #include "listviewplus.h" |
19 | #include "smtphandler.h" | 19 | #include "smtphandler.h" |
20 | #include "composer.h" | 20 | #include "composer.h" |
21 | #include "rename.h" | 21 | #include "rename.h" |
22 | 22 | ||
@@ -29,13 +29,13 @@ AttachViewItem::AttachViewItem(QListView *parent, Attachment &attachment) | |||
29 | } | 29 | } |
30 | 30 | ||
31 | Composer::Composer(QWidget *parent, const char *name, WFlags fl, bool sendQueue) | 31 | Composer::Composer(QWidget *parent, const char *name, WFlags fl, bool sendQueue) |
32 | : ComposerBase(parent, name, fl), _inLoop(false) | 32 | : ComposerBase(parent, name, fl), _inLoop(false) |
33 | { | 33 | { |
34 | _sendQueued = sendQueue; | 34 | _sendQueued = sendQueue; |
35 | abort->setEnabled(false); | 35 | status->setStopEnabled(false); |
36 | to->setFocus(); | 36 | to->setFocus(); |
37 | 37 | ||
38 | connect(sendmail, SIGNAL(activated()), SLOT(slotSendMail())); | 38 | connect(sendmail, SIGNAL(activated()), SLOT(slotSendMail())); |
39 | connect(queuemail, SIGNAL(activated()), SLOT(slotQueueMail())); | 39 | connect(queuemail, SIGNAL(activated()), SLOT(slotQueueMail())); |
40 | connect(addressbook, SIGNAL(activated()), SLOT(slotOpenAddressPicker())); | 40 | connect(addressbook, SIGNAL(activated()), SLOT(slotOpenAddressPicker())); |
41 | connect(addattach, SIGNAL(activated()), SLOT(slotAddAttach())); | 41 | connect(addattach, SIGNAL(activated()), SLOT(slotAddAttach())); |
@@ -151,18 +151,18 @@ void Composer::slotSendMail() | |||
151 | smail.setAttachments(attachments); | 151 | smail.setAttachments(attachments); |
152 | 152 | ||
153 | QString header, message; | 153 | QString header, message; |
154 | MailFactory::genMail(header, message, smail, this); | 154 | MailFactory::genMail(header, message, smail, this); |
155 | if (header.isNull() || message.isNull()) return;// Aborted. | 155 | if (header.isNull() || message.isNull()) return;// Aborted. |
156 | 156 | ||
157 | abort->setEnabled(true); | 157 | status->setStopEnabled(true); |
158 | 158 | ||
159 | SmtpHandler *handler = new SmtpHandler(header, message, accountsLoaded[from->currentItem()], to->text()); | 159 | SmtpHandler *handler = new SmtpHandler(header, message, accountsLoaded[from->currentItem()], to->text()); |
160 | connect(handler, SIGNAL(finished()), SLOT(slotSendFinished())); | 160 | connect(handler, SIGNAL(finished()), SLOT(slotSendFinished())); |
161 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendError(const QString &))); | 161 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendError(const QString &))); |
162 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); | 162 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &))); |
163 | } | 163 | } |
164 | 164 | ||
165 | void Composer::slotSendQueued() | 165 | void Composer::slotSendQueued() |
166 | { | 166 | { |
167 | int effSendCount = 0; | 167 | int effSendCount = 0; |
168 | qDebug("Sending queued messages"); | 168 | qDebug("Sending queued messages"); |
@@ -245,13 +245,13 @@ void Composer::slotSendQueued() | |||
245 | 245 | ||
246 | qDebug("Sending to %s",toAdr.latin1()); | 246 | qDebug("Sending to %s",toAdr.latin1()); |
247 | SmtpHandler *handler = new SmtpHandler(header, message, accnt ,toAdr); | 247 | SmtpHandler *handler = new SmtpHandler(header, message, accnt ,toAdr); |
248 | effSendCount++; | 248 | effSendCount++; |
249 | connect(handler, SIGNAL(finished()), SLOT(slotSendQueuedFinished())); | 249 | connect(handler, SIGNAL(finished()), SLOT(slotSendQueuedFinished())); |
250 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendQueuedError(const QString &))); | 250 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendQueuedError(const QString &))); |
251 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); | 251 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &))); |
252 | 252 | ||
253 | } | 253 | } |
254 | if (effSendCount < _toSend) | 254 | if (effSendCount < _toSend) |
255 | { | 255 | { |
256 | _toSend = effSendCount; | 256 | _toSend = effSendCount; |
257 | QMessageBox::information(this, tr("Error"), tr("<p>There was a problem sending some of the queued mails.</p>"), tr("Ok")); | 257 | QMessageBox::information(this, tr("Error"), tr("<p>There was a problem sending some of the queued mails.</p>"), tr("Ok")); |
@@ -302,30 +302,30 @@ void Composer::slotQueueMail() | |||
302 | QMessageBox::information(this, tr("Success"), tr("<p>The mail was queued successfully.</p><p>The queue contains ")+QString::number(count)+tr(" mails.</p>"), tr("Ok")); | 302 | QMessageBox::information(this, tr("Success"), tr("<p>The mail was queued successfully.</p><p>The queue contains ")+QString::number(count)+tr(" mails.</p>"), tr("Ok")); |
303 | 303 | ||
304 | } | 304 | } |
305 | 305 | ||
306 | void Composer::slotSendError(const QString &error) | 306 | void Composer::slotSendError(const QString &error) |
307 | { | 307 | { |
308 | status->setText(tr("<font color=#ff0000>Error occoured during sending.</font>")); | 308 | status->setStatusText(tr("<font color=#ff0000>Error occoured during sending.</font>")); |
309 | 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")); |
310 | } | 310 | } |
311 | 311 | ||
312 | void Composer::slotSendQueuedError(const QString &error) | 312 | void Composer::slotSendQueuedError(const QString &error) |
313 | { | 313 | { |
314 | _sendError++; | 314 | _sendError++; |
315 | qDebug("error send mail %i",_sendCount); | 315 | qDebug("error send mail %i",_sendCount); |
316 | status->setText(tr("<font color=#ff0000>Error occoured during sending.</font>")); | 316 | status->setStatusText(tr("<font color=#ff0000>Error occoured during sending.</font>")); |
317 | QMessageBox::warning(this, tr("Error"), tr("<p>%1</p").arg(error), tr("Ok")); | 317 | QMessageBox::warning(this, tr("Error"), tr("<p>%1</p").arg(error), tr("Ok")); |
318 | } | 318 | } |
319 | 319 | ||
320 | void Composer::slotSendFinished() | 320 | void Composer::slotSendFinished() |
321 | { | 321 | { |
322 | QMessageBox::information(this, tr("Success"), tr("<p>The mail was sent successfully.</p>"), tr("Ok")); | 322 | QMessageBox::information(this, tr("Success"), tr("<p>The mail was sent successfully.</p>"), tr("Ok")); |
323 | 323 | ||
324 | status->setText(QString(0)); | 324 | status->setStatusText(QString(0)); |
325 | abort->setEnabled(false); | 325 | status->setStopEnabled(false); |
326 | } | 326 | } |
327 | 327 | ||
328 | void Composer::slotSendQueuedFinished() | 328 | void Composer::slotSendQueuedFinished() |
329 | { | 329 | { |
330 | 330 | ||
331 | _sendCount++; | 331 | _sendCount++; |