-rw-r--r-- | noncore/unsupported/mail2/composer.cpp | 55 | ||||
-rw-r--r-- | noncore/unsupported/mail2/composer.h | 3 | ||||
-rw-r--r-- | noncore/unsupported/mail2/composerbase.cpp | 9 | ||||
-rw-r--r-- | noncore/unsupported/mail2/composerbase.h | 4 | ||||
-rw-r--r-- | noncore/unsupported/mail2/libmail/libmail.pro | 3 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mail.pro | 3 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mainwindowbase.cpp | 12 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mainwindowbase.h | 4 |
8 files changed, 74 insertions, 19 deletions
diff --git a/noncore/unsupported/mail2/composer.cpp b/noncore/unsupported/mail2/composer.cpp index 1d793ee..72a7242 100644 --- a/noncore/unsupported/mail2/composer.cpp +++ b/noncore/unsupported/mail2/composer.cpp | |||
@@ -68,3 +68,2 @@ void Composer::exec() | |||
68 | show(); | 68 | show(); |
69 | |||
70 | if (!_inLoop) { | 69 | if (!_inLoop) { |
@@ -96,7 +95,3 @@ void Composer::slotResizing() | |||
96 | from->resize(width() - fromBox->width(), y()); | 95 | from->resize(width() - fromBox->width(), y()); |
97 | if (_sendQueued) | 96 | if (_sendQueued) slotSendQueued(); |
98 | { | ||
99 | slotSendQueued(); | ||
100 | close(); | ||
101 | } | ||
102 | } | 97 | } |
@@ -173,11 +168,11 @@ void Composer::slotSendQueued() | |||
173 | cfg.setGroup( "Settings" ); | 168 | cfg.setGroup( "Settings" ); |
174 | int count = cfg.readNumEntry( "count", 0 ); | 169 | _sendCount = 0; |
175 | // tille: should not be here | 170 | _sendError = 0; |
176 | // but no error checking for the moment | 171 | _toSend = cfg.readNumEntry( "count", 0 ); |
177 | cfg.writeEntry( "count", 0 ); | ||
178 | 172 | ||
173 | if (_toSend == 0) close(); | ||
179 | 174 | ||
180 | qDebug("%i messages to send", count); | 175 | qDebug("%i messages to send", _toSend); |
181 | QString str; | 176 | QString str; |
182 | for (int i=1;i<=count;i++) | 177 | for (int i=1;i<=_toSend;i++) |
183 | { | 178 | { |
@@ -251,9 +246,6 @@ void Composer::slotSendQueued() | |||
251 | 246 | ||
252 | connect(handler, SIGNAL(finished()), SLOT(slotSendFinished())); | 247 | connect(handler, SIGNAL(finished()), SLOT(slotSendQueuedFinished())); |
253 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendError(const QString &))); | 248 | connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendQueuedError(const QString &))); |
254 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); | 249 | connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); |
255 | 250 | ||
256 | qDebug("remove mail %i", i); | ||
257 | cfg.clearGroup(); | ||
258 | cfg.removeEntry( "Mail_" + QString::number(i) ); | ||
259 | } | 251 | } |
@@ -312,2 +304,10 @@ void Composer::slotSendError(const QString &error) | |||
312 | 304 | ||
305 | void Composer::slotSendQueuedError(const QString &error) | ||
306 | { | ||
307 | _sendError++; | ||
308 | qDebug("error send mail %i",_sendCount); | ||
309 | status->setText(tr("<font color=#ff0000>Error occoured during sending.</font>")); | ||
310 | QMessageBox::warning(this, tr("Error"), tr("<p>%1</p").arg(error), tr("Ok")); | ||
311 | } | ||
312 | |||
313 | void Composer::slotSendFinished() | 313 | void Composer::slotSendFinished() |
@@ -320,2 +320,23 @@ void Composer::slotSendFinished() | |||
320 | 320 | ||
321 | void Composer::slotSendQueuedFinished() | ||
322 | { | ||
323 | |||
324 | _sendCount++; | ||
325 | qDebug("finished send mail %i of %i (error %i)",_sendCount,_toSend,_sendError); | ||
326 | if (_sendCount < _toSend) return; | ||
327 | if (_sendError == _toSend) close(); | ||
328 | QMessageBox::information(this, tr("Success"), tr("<p>The queued mails ")+QString::number(_toSend-_sendError)+tr(" of ")+QString::number(_toSend)+(" were sent successfully.</p>"), tr("Ok")); | ||
329 | Config cfg( "mailqueue", Config::User ); | ||
330 | cfg.setGroup( "Settings" ); | ||
331 | cfg.writeEntry( "count", 0 ); | ||
332 | for (int i=1;i<=_sendCount;i++) | ||
333 | { | ||
334 | cfg.setGroup( "Mail_" + QString::number(i) ); | ||
335 | qDebug("remove mail %i", i); | ||
336 | cfg.clearGroup(); | ||
337 | cfg.removeEntry( "Mail_" + QString::number(i) ); | ||
338 | } | ||
339 | close(); | ||
340 | } | ||
341 | |||
321 | void Composer::slotFillStuff() | 342 | void Composer::slotFillStuff() |
diff --git a/noncore/unsupported/mail2/composer.h b/noncore/unsupported/mail2/composer.h index 00235bf..0b2a54c 100644 --- a/noncore/unsupported/mail2/composer.h +++ b/noncore/unsupported/mail2/composer.h | |||
@@ -44,2 +44,4 @@ protected slots: | |||
44 | void slotSendFinished(); | 44 | void slotSendFinished(); |
45 | void slotSendQueuedError(const QString &); | ||
46 | void slotSendQueuedFinished(); | ||
45 | void slotResizing(); | 47 | void slotResizing(); |
@@ -56,2 +58,3 @@ private: | |||
56 | bool _sendQueued; | 58 | bool _sendQueued; |
59 | int _toSend, _sendCount, _sendError; | ||
57 | bool _inLoop; | 60 | bool _inLoop; |
diff --git a/noncore/unsupported/mail2/composerbase.cpp b/noncore/unsupported/mail2/composerbase.cpp index 6627701..ff00a73 100644 --- a/noncore/unsupported/mail2/composerbase.cpp +++ b/noncore/unsupported/mail2/composerbase.cpp | |||
@@ -10,2 +10,3 @@ | |||
10 | #include <qpe/qpetoolbar.h> | 10 | #include <qpe/qpetoolbar.h> |
11 | #include <qpe/qpemenubar.h> | ||
11 | #include <qpe/resource.h> | 12 | #include <qpe/resource.h> |
@@ -22,2 +23,5 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) | |||
22 | toolbar = new QPEToolBar(this); | 23 | toolbar = new QPEToolBar(this); |
24 | menubar = new QPEMenuBar( toolbar ); | ||
25 | mailmenu = new QPopupMenu( menubar ); | ||
26 | menubar->insertItem( tr( "Mail" ), mailmenu ); | ||
23 | addToolBar(toolbar); | 27 | addToolBar(toolbar); |
@@ -27,2 +31,3 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) | |||
27 | sendmail->addTo(toolbar); | 31 | sendmail->addTo(toolbar); |
32 | sendmail->addTo(mailmenu); | ||
28 | 33 | ||
@@ -30,2 +35,3 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) | |||
30 | queuemail->addTo(toolbar); | 35 | queuemail->addTo(toolbar); |
36 | queuemail->addTo(mailmenu); | ||
31 | 37 | ||
@@ -33,2 +39,3 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) | |||
33 | attachfile->addTo(toolbar); | 39 | attachfile->addTo(toolbar); |
40 | attachfile->addTo(mailmenu); | ||
34 | connect(attachfile, SIGNAL(toggled(bool)), SLOT(slotAttachfileChanged(bool))); | 41 | connect(attachfile, SIGNAL(toggled(bool)), SLOT(slotAttachfileChanged(bool))); |
@@ -37,2 +44,3 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) | |||
37 | addressbook->addTo(toolbar); | 44 | addressbook->addTo(toolbar); |
45 | addressbook->addTo(mailmenu); | ||
38 | 46 | ||
@@ -44,2 +52,3 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) | |||
44 | abort->addTo(toolbar); | 52 | abort->addTo(toolbar); |
53 | abort->addTo(mailmenu); | ||
45 | 54 | ||
diff --git a/noncore/unsupported/mail2/composerbase.h b/noncore/unsupported/mail2/composerbase.h index 9d3e4fc..d832623 100644 --- a/noncore/unsupported/mail2/composerbase.h +++ b/noncore/unsupported/mail2/composerbase.h | |||
@@ -9,2 +9,4 @@ class QPopupMenu; | |||
9 | class QPEToolBar; | 9 | class QPEToolBar; |
10 | class QPEMenuBar; | ||
11 | class QPopupMenu; | ||
10 | class QComboBox; | 12 | class QComboBox; |
@@ -41,2 +43,4 @@ protected: | |||
41 | QPEToolBar *toolbar, *attachToolbar; | 43 | QPEToolBar *toolbar, *attachToolbar; |
44 | QPEMenuBar *menubar; | ||
45 | QPopupMenu *mailmenu; | ||
42 | QComboBox *fromBox, *from, *receiversBox, *subjectBox, *priority; | 46 | QComboBox *fromBox, *from, *receiversBox, *subjectBox, *priority; |
diff --git a/noncore/unsupported/mail2/libmail/libmail.pro b/noncore/unsupported/mail2/libmail/libmail.pro index 662af90..ddabd07 100644 --- a/noncore/unsupported/mail2/libmail/libmail.pro +++ b/noncore/unsupported/mail2/libmail/libmail.pro | |||
@@ -1,3 +1,4 @@ | |||
1 | TEMPLATE =lib | 1 | TEMPLATE =lib |
2 | CONFIG =qt warn_on release | 2 | CONFIG =qt warn_on debug |
3 | #CONFIG =qt warn_on release | ||
3 | HEADERS =configfile.h \ | 4 | HEADERS =configfile.h \ |
diff --git a/noncore/unsupported/mail2/mail.pro b/noncore/unsupported/mail2/mail.pro index 50d7c68..76b7996 100644 --- a/noncore/unsupported/mail2/mail.pro +++ b/noncore/unsupported/mail2/mail.pro | |||
@@ -1,3 +1,4 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on debug |
3 | #CONFIG = qt warn_on release | ||
3 | HEADERS = accounteditor.h \ | 4 | HEADERS = accounteditor.h \ |
diff --git a/noncore/unsupported/mail2/mainwindowbase.cpp b/noncore/unsupported/mail2/mainwindowbase.cpp index 24f030f..9ffe6f0 100644 --- a/noncore/unsupported/mail2/mainwindowbase.cpp +++ b/noncore/unsupported/mail2/mainwindowbase.cpp | |||
@@ -9,2 +9,3 @@ | |||
9 | #include <qpe/qpetoolbar.h> | 9 | #include <qpe/qpetoolbar.h> |
10 | #include <qpe/qpemenubar.h> | ||
10 | #include <qpe/resource.h> | 11 | #include <qpe/resource.h> |
@@ -22,2 +23,8 @@ MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl) | |||
22 | toolbar = new QPEToolBar(this); | 23 | toolbar = new QPEToolBar(this); |
24 | menubar = new QPEMenuBar( toolbar ); | ||
25 | mailmenu = new QPopupMenu( menubar ); | ||
26 | servermenu = new QPopupMenu( menubar ); | ||
27 | menubar->insertItem( tr( "Mail" ), mailmenu ); | ||
28 | menubar->insertItem( tr( "Servers" ), servermenu ); | ||
29 | |||
23 | addToolBar(toolbar); | 30 | addToolBar(toolbar); |
@@ -27,2 +34,3 @@ MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl) | |||
27 | compose->addTo(toolbar); | 34 | compose->addTo(toolbar); |
35 | compose->addTo(mailmenu); | ||
28 | 36 | ||
@@ -30,2 +38,3 @@ MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl) | |||
30 | sendQueue->addTo(toolbar); | 38 | sendQueue->addTo(toolbar); |
39 | sendQueue->addTo(mailmenu); | ||
31 | 40 | ||
@@ -33,2 +42,3 @@ MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl) | |||
33 | folders->addTo(toolbar); | 42 | folders->addTo(toolbar); |
43 | folders->addTo(servermenu); | ||
34 | connect(folders, SIGNAL(toggled(bool)), SLOT(slotFoldersToggled(bool))); | 44 | connect(folders, SIGNAL(toggled(bool)), SLOT(slotFoldersToggled(bool))); |
@@ -37,2 +47,3 @@ MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl) | |||
37 | findmails->addTo(toolbar); | 47 | findmails->addTo(toolbar); |
48 | findmails->addTo(mailmenu); | ||
38 | 49 | ||
@@ -40,2 +51,3 @@ MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl) | |||
40 | configure->addTo(toolbar); | 51 | configure->addTo(toolbar); |
52 | configure->addTo(servermenu); | ||
41 | 53 | ||
diff --git a/noncore/unsupported/mail2/mainwindowbase.h b/noncore/unsupported/mail2/mainwindowbase.h index 232d656..d8faeba 100644 --- a/noncore/unsupported/mail2/mainwindowbase.h +++ b/noncore/unsupported/mail2/mainwindowbase.h | |||
@@ -9,2 +9,4 @@ class FolderWidget; | |||
9 | class QPEToolBar; | 9 | class QPEToolBar; |
10 | class QPEMenuBar; | ||
11 | class QPopupMenu; | ||
10 | class MailTable; | 12 | class MailTable; |
@@ -28,2 +30,4 @@ protected: | |||
28 | QPEToolBar *toolbar; | 30 | QPEToolBar *toolbar; |
31 | QPEMenuBar *menubar; | ||
32 | QPopupMenu *mailmenu, *servermenu; | ||
29 | MailTable *mailView; | 33 | MailTable *mailView; |