author | conber <conber> | 2002-08-06 16:32:49 (UTC) |
---|---|---|
committer | conber <conber> | 2002-08-06 16:32:49 (UTC) |
commit | 8084d002de5e310491eec7fac0713ef29d0cf30f (patch) (unidiff) | |
tree | fe74e3cf2ee2f7d87e74910fbf4bfa34b9a439a0 /noncore/unsupported | |
parent | e6a512dc2e0602298f8a745036d25eb171ced977 (diff) | |
download | opie-8084d002de5e310491eec7fac0713ef29d0cf30f.zip opie-8084d002de5e310491eec7fac0713ef29d0cf30f.tar.gz opie-8084d002de5e310491eec7fac0713ef29d0cf30f.tar.bz2 |
ui improvements
-rw-r--r-- | noncore/unsupported/mail2/composer.cpp | 18 | ||||
-rw-r--r-- | noncore/unsupported/mail2/composerbase.cpp | 20 | ||||
-rw-r--r-- | noncore/unsupported/mail2/composerbase.h | 6 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mail.pro | 2 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mailstatusbar.cpp | 58 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mailstatusbar.h | 38 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mainwindow.cpp | 20 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mainwindowbase.cpp | 20 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mainwindowbase.h | 8 |
9 files changed, 131 insertions, 59 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++; |
diff --git a/noncore/unsupported/mail2/composerbase.cpp b/noncore/unsupported/mail2/composerbase.cpp index c456ae5..6f6ab8e 100644 --- a/noncore/unsupported/mail2/composerbase.cpp +++ b/noncore/unsupported/mail2/composerbase.cpp | |||
@@ -8,25 +8,26 @@ | |||
8 | #include <qvbox.h> | 8 | #include <qvbox.h> |
9 | 9 | ||
10 | #include <qpe/qpetoolbar.h> | 10 | #include <qpe/qpetoolbar.h> |
11 | #include <qpe/qpemenubar.h> | 11 | #include <qpe/qpemenubar.h> |
12 | #include <qpe/resource.h> | 12 | #include <qpe/resource.h> |
13 | 13 | ||
14 | #include "mailstatusbar.h" | ||
14 | #include "listviewplus.h" | 15 | #include "listviewplus.h" |
15 | #include "composerbase.h" | 16 | #include "composerbase.h" |
16 | 17 | ||
17 | ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) | 18 | ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) |
18 | : QMainWindow(parent, name, fl) | 19 | : QMainWindow(parent, name, fl) |
19 | { | 20 | { |
20 | setCaption(tr("Compose Message")); | 21 | setCaption(tr("Compose Message")); |
21 | setToolBarsMovable(false); | 22 | setToolBarsMovable(false); |
22 | 23 | ||
23 | toolbar = new QPEToolBar(this); | 24 | toolbar = new QPEToolBar(this); |
24 | menubar = new QPEMenuBar( toolbar ); | 25 | menubar = new QPEMenuBar( toolbar ); |
25 | mailmenu = new QPopupMenu( menubar ); | 26 | mailmenu = new QPopupMenu( menubar ); |
26 | menubar->insertItem( tr( "Mail" ), mailmenu ); | 27 | menubar->insertItem( tr( "Mail" ), mailmenu ); |
27 | addToolBar(toolbar); | 28 | addToolBar(toolbar); |
28 | toolbar->setHorizontalStretchable(true); | 29 | toolbar->setHorizontalStretchable(true); |
29 | 30 | ||
30 | QLabel *spacer = new QLabel(toolbar); | 31 | QLabel *spacer = new QLabel(toolbar); |
31 | spacer->setBackgroundMode(QWidget::PaletteButton); | 32 | spacer->setBackgroundMode(QWidget::PaletteButton); |
32 | toolbar->setStretchableWidget(spacer); | 33 | toolbar->setStretchableWidget(spacer); |
@@ -45,16 +46,12 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) | |||
45 | connect(attachfile, SIGNAL(toggled(bool)), SLOT(slotAttachfileChanged(bool))); | 46 | connect(attachfile, SIGNAL(toggled(bool)), SLOT(slotAttachfileChanged(bool))); |
46 | 47 | ||
47 | addressbook = new QAction(tr("Addressbook"), QIconSet(Resource::loadPixmap("mail/addbook")), 0, 0, this); | 48 | addressbook = new QAction(tr("Addressbook"), QIconSet(Resource::loadPixmap("mail/addbook")), 0, 0, this); |
48 | addressbook->addTo(toolbar); | 49 | addressbook->addTo(toolbar); |
49 | addressbook->addTo(mailmenu); | 50 | addressbook->addTo(mailmenu); |
50 | 51 | ||
51 | abort = new QAction(tr("Abort sending"), QIconSet(Resource::loadPixmap("mail/abort")), 0, 0, this); | ||
52 | abort->addTo(toolbar); | ||
53 | abort->addTo(mailmenu); | ||
54 | |||
55 | QWidget *main = new QWidget(this); | 52 | QWidget *main = new QWidget(this); |
56 | setCentralWidget(main); | 53 | setCentralWidget(main); |
57 | 54 | ||
58 | QGridLayout *layout = new QGridLayout(main); | 55 | QGridLayout *layout = new QGridLayout(main); |
59 | 56 | ||
60 | fromBox = new QComboBox(main); | 57 | fromBox = new QComboBox(main); |
@@ -120,14 +117,14 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) | |||
120 | layout->addMultiCellWidget(view, 3, 3, 0, 1); | 117 | layout->addMultiCellWidget(view, 3, 3, 0, 1); |
121 | 118 | ||
122 | message = new QMultiLineEdit(view); | 119 | message = new QMultiLineEdit(view); |
123 | message->setMinimumHeight(30); | 120 | message->setMinimumHeight(30); |
124 | 121 | ||
125 | attachWindow = new QMainWindow(view, 0, 0); | 122 | attachWindow = new QMainWindow(view, 0, 0); |
126 | attachWindow->setMinimumHeight(100); | 123 | attachWindow->setMinimumHeight(80); |
127 | attachWindow->setMaximumHeight(100); | 124 | attachWindow->setMaximumHeight(80); |
128 | attachWindow->setToolBarsMovable(false); | 125 | attachWindow->setToolBarsMovable(false); |
129 | attachWindow->hide(); | 126 | attachWindow->hide(); |
130 | 127 | ||
131 | attachToolbar = new QPEToolBar(attachWindow); | 128 | attachToolbar = new QPEToolBar(attachWindow); |
132 | attachToolbar->setVerticalStretchable(true); | 129 | attachToolbar->setVerticalStretchable(true); |
133 | 130 | ||
@@ -153,16 +150,13 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) | |||
153 | attachPopup->insertItem(tr("Rename"), POPUP_ATTACH_RENAME); | 150 | attachPopup->insertItem(tr("Rename"), POPUP_ATTACH_RENAME); |
154 | attachPopup->insertItem(tr("Change Description"), POPUP_ATTACH_DESC); | 151 | attachPopup->insertItem(tr("Change Description"), POPUP_ATTACH_DESC); |
155 | attachPopup->insertSeparator(); | 152 | attachPopup->insertSeparator(); |
156 | attachPopup->insertItem(tr("Remove"), POPUP_ATTACH_REMOVE); | 153 | attachPopup->insertItem(tr("Remove"), POPUP_ATTACH_REMOVE); |
157 | attachView->setPopup(attachPopup); | 154 | attachView->setPopup(attachPopup); |
158 | 155 | ||
159 | status = new QLabel(view); | 156 | status = new MailStatusBar(view); |
160 | QFont tmpFont = status->font(); | ||
161 | tmpFont.setPixelSize(8); | ||
162 | status->setFont(tmpFont); | ||
163 | } | 157 | } |
164 | 158 | ||
165 | void ComposerBase::slotAttachfileChanged(bool toggled) | 159 | void ComposerBase::slotAttachfileChanged(bool toggled) |
166 | { | 160 | { |
167 | if (toggled) { | 161 | if (toggled) { |
168 | if (attachWindow->isHidden()) attachWindow->show(); | 162 | if (attachWindow->isHidden()) attachWindow->show(); |
diff --git a/noncore/unsupported/mail2/composerbase.h b/noncore/unsupported/mail2/composerbase.h index d832623..58f1157 100644 --- a/noncore/unsupported/mail2/composerbase.h +++ b/noncore/unsupported/mail2/composerbase.h | |||
@@ -1,12 +1,13 @@ | |||
1 | #ifndef COMPOSERBASE_H | 1 | #ifndef COMPOSERBASE_H |
2 | #define COMPOSERBASE_H | 2 | #define COMPOSERBASE_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | 5 | ||
6 | class QMultiLineEdit; | 6 | class QMultiLineEdit; |
7 | class MailStatusBar; | ||
7 | class ListViewPlus; | 8 | class ListViewPlus; |
8 | class QPopupMenu; | 9 | class QPopupMenu; |
9 | class QPEToolBar; | 10 | class QPEToolBar; |
10 | class QPEMenuBar; | 11 | class QPEMenuBar; |
11 | class QPopupMenu; | 12 | class QPopupMenu; |
12 | class QComboBox; | 13 | class QComboBox; |
@@ -34,22 +35,23 @@ protected: | |||
34 | static const int POPUP_PRIO_HIGH = 2; | 35 | static const int POPUP_PRIO_HIGH = 2; |
35 | static const int POPUP_ATTACH_RENAME = 0; | 36 | static const int POPUP_ATTACH_RENAME = 0; |
36 | static const int POPUP_ATTACH_DESC = 1; | 37 | static const int POPUP_ATTACH_DESC = 1; |
37 | static const int POPUP_ATTACH_REMOVE = 2; | 38 | static const int POPUP_ATTACH_REMOVE = 2; |
38 | 39 | ||
39 | QMultiLineEdit *message; | 40 | QMultiLineEdit *message; |
41 | MailStatusBar *status; | ||
40 | ListViewPlus *attachView; | 42 | ListViewPlus *attachView; |
41 | QMainWindow *attachWindow; | 43 | QMainWindow *attachWindow; |
42 | QPopupMenu *attachPopup; | 44 | QPopupMenu *attachPopup; |
43 | QPEToolBar *toolbar, *attachToolbar; | 45 | QPEToolBar *toolbar, *attachToolbar; |
44 | QPEMenuBar *menubar; | 46 | QPEMenuBar *menubar; |
45 | QPopupMenu *mailmenu; | 47 | QPopupMenu *mailmenu; |
46 | QComboBox *fromBox, *from, *receiversBox, *subjectBox, *priority; | 48 | QComboBox *fromBox, *from, *receiversBox, *subjectBox, *priority; |
47 | QLineEdit *replyto, *to, *cc, *bcc, *subject; | 49 | QLineEdit *replyto, *to, *cc, *bcc, *subject; |
48 | QAction *sendmail, *queuemail, *attachfile, *addressbook, *abort, *addattach, *delattach; | 50 | QAction *sendmail, *queuemail, *attachfile, *addressbook, *abort, *addattach, *delattach; |
49 | QLabel *fromLabel, *status; | 51 | QLabel *fromLabel; |
50 | 52 | ||
51 | protected slots: | 53 | protected slots: |
52 | void slotAttachfileChanged(bool toggled); | 54 | void slotAttachfileChanged(bool toggled); |
53 | void slotFromMenuChanged(int id); | 55 | void slotFromMenuChanged(int id); |
54 | void slotReceiverMenuChanged(int id); | 56 | void slotReceiverMenuChanged(int id); |
55 | void slotSubjectMenuChanged(int id); | 57 | void slotSubjectMenuChanged(int id); |
diff --git a/noncore/unsupported/mail2/mail.pro b/noncore/unsupported/mail2/mail.pro index 985a6fb..177509d 100644 --- a/noncore/unsupported/mail2/mail.pro +++ b/noncore/unsupported/mail2/mail.pro | |||
@@ -5,12 +5,13 @@ HEADERS = accounteditor.h \ | |||
5 | addresspicker.h \ | 5 | addresspicker.h \ |
6 | composer.h \ | 6 | composer.h \ |
7 | composerbase.h \ | 7 | composerbase.h \ |
8 | configdiag.h \ | 8 | configdiag.h \ |
9 | folderwidget.h \ | 9 | folderwidget.h \ |
10 | listviewplus.h \ | 10 | listviewplus.h \ |
11 | mailstatusbar.h \ | ||
11 | mailtable.h \ | 12 | mailtable.h \ |
12 | mainwindow.h \ | 13 | mainwindow.h \ |
13 | mainwindowbase.h \ | 14 | mainwindowbase.h \ |
14 | opendiag.h \ | 15 | opendiag.h \ |
15 | rename.h \ | 16 | rename.h \ |
16 | searchdiag.h \ | 17 | searchdiag.h \ |
@@ -20,12 +21,13 @@ SOURCES = accounteditor.cpp \ | |||
20 | addresspicker.cpp \ | 21 | addresspicker.cpp \ |
21 | composer.cpp \ | 22 | composer.cpp \ |
22 | composerbase.cpp \ | 23 | composerbase.cpp \ |
23 | configdiag.cpp \ | 24 | configdiag.cpp \ |
24 | folderwidget.cpp \ | 25 | folderwidget.cpp \ |
25 | listviewplus.cpp \ | 26 | listviewplus.cpp \ |
27 | mailstatusbar.cpp \ | ||
26 | mailtable.cpp \ | 28 | mailtable.cpp \ |
27 | main.cpp \ | 29 | main.cpp \ |
28 | mainwindow.cpp \ | 30 | mainwindow.cpp \ |
29 | mainwindowbase.cpp \ | 31 | mainwindowbase.cpp \ |
30 | opendiag.cpp \ | 32 | opendiag.cpp \ |
31 | rename.cpp \ | 33 | rename.cpp \ |
diff --git a/noncore/unsupported/mail2/mailstatusbar.cpp b/noncore/unsupported/mail2/mailstatusbar.cpp new file mode 100644 index 0000000..470ea4f --- a/dev/null +++ b/noncore/unsupported/mail2/mailstatusbar.cpp | |||
@@ -0,0 +1,58 @@ | |||
1 | #include <qprogressbar.h> | ||
2 | #include <qtoolbutton.h> | ||
3 | #include <qlabel.h> | ||
4 | |||
5 | #include "mailstatusbar.h" | ||
6 | |||
7 | MailStatusBar::MailStatusBar(QWidget *parent, const char *name, WFlags fl) | ||
8 | : QHBox(parent, name, fl) | ||
9 | { | ||
10 | label = new QLabel(this); | ||
11 | QFont tmpFont = label->font(); | ||
12 | tmpFont.setPixelSize(8); | ||
13 | label->setFont(tmpFont); | ||
14 | |||
15 | stopButton = new QToolButton(this); | ||
16 | stopButton->setText(" X "); | ||
17 | stopButton->setMaximumHeight(15); | ||
18 | stopButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
19 | connect(stopButton, SIGNAL(clicked()), SLOT(stopClicked())); | ||
20 | |||
21 | progress = new QProgressBar(this); | ||
22 | progress->setCenterIndicator(true); | ||
23 | progress->setMinimumHeight(15); | ||
24 | progress->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
25 | progress->setFrameShape(QFrame::Box); | ||
26 | progress->setFrameShadow(QFrame::Raised); | ||
27 | } | ||
28 | |||
29 | void MailStatusBar::setStatusText(const QString &text) | ||
30 | { | ||
31 | label->setText(text); | ||
32 | } | ||
33 | |||
34 | void MailStatusBar::setStopEnabled(bool enabled) | ||
35 | { | ||
36 | stopButton->setEnabled(enabled); | ||
37 | } | ||
38 | |||
39 | void MailStatusBar::setProgressTotalSteps(int steps) | ||
40 | { | ||
41 | progress->setTotalSteps(steps); | ||
42 | } | ||
43 | |||
44 | void MailStatusBar::setProgress(int pg) | ||
45 | { | ||
46 | progress->setProgress(pg); | ||
47 | } | ||
48 | |||
49 | void MailStatusBar::resetProgress() | ||
50 | { | ||
51 | progress->reset(); | ||
52 | } | ||
53 | |||
54 | void MailStatusBar::stopClicked() | ||
55 | { | ||
56 | emit stop(); | ||
57 | } | ||
58 | |||
diff --git a/noncore/unsupported/mail2/mailstatusbar.h b/noncore/unsupported/mail2/mailstatusbar.h new file mode 100644 index 0000000..11cd538 --- a/dev/null +++ b/noncore/unsupported/mail2/mailstatusbar.h | |||
@@ -0,0 +1,38 @@ | |||
1 | #ifndef MAILSTATUSBAR_H | ||
2 | #define MAILSTATUSBAR_H | ||
3 | |||
4 | #include <qhbox.h> | ||
5 | |||
6 | class QLabel; | ||
7 | class QToolButton; | ||
8 | class QProgressBar; | ||
9 | |||
10 | class MailStatusBar : public QHBox | ||
11 | { | ||
12 | Q_OBJECT | ||
13 | |||
14 | public: | ||
15 | MailStatusBar(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); | ||
16 | |||
17 | public slots: | ||
18 | void setStatusText(const QString &text); | ||
19 | void setStopEnabled(bool enabled); | ||
20 | void setProgressTotalSteps(int steps); | ||
21 | void setProgress(int progress); | ||
22 | void resetProgress(); | ||
23 | |||
24 | signals: | ||
25 | void stop(); | ||
26 | |||
27 | protected slots: | ||
28 | void stopClicked(); | ||
29 | |||
30 | private: | ||
31 | QLabel *label; | ||
32 | QToolButton *stopButton; | ||
33 | QProgressBar *progress; | ||
34 | |||
35 | }; | ||
36 | |||
37 | #endif | ||
38 | |||
diff --git a/noncore/unsupported/mail2/mainwindow.cpp b/noncore/unsupported/mail2/mainwindow.cpp index 0044693..047c54b 100644 --- a/noncore/unsupported/mail2/mainwindow.cpp +++ b/noncore/unsupported/mail2/mainwindow.cpp | |||
@@ -1,37 +1,35 @@ | |||
1 | #include <qprogressbar.h> | ||
2 | #include <qmessagebox.h> | 1 | #include <qmessagebox.h> |
3 | #include <qtoolbutton.h> | ||
4 | #include <qaction.h> | 2 | #include <qaction.h> |
5 | #include <qlabel.h> | ||
6 | 3 | ||
4 | #include "mailstatusbar.h" | ||
7 | #include "folderwidget.h" | 5 | #include "folderwidget.h" |
8 | #include "mainwindow.h" | 6 | #include "mainwindow.h" |
9 | #include "configdiag.h" | 7 | #include "configdiag.h" |
10 | #include "configfile.h" | 8 | #include "configfile.h" |
11 | #include "searchdiag.h" | 9 | #include "searchdiag.h" |
12 | #include "mailtable.h" | 10 | #include "mailtable.h" |
13 | #include "composer.h" | 11 | #include "composer.h" |
14 | #include "viewmail.h" | 12 | #include "viewmail.h" |
15 | 13 | ||
16 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags fl) | 14 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags fl) |
17 | : MainWindowBase(parent, name, fl) | 15 | : MainWindowBase(parent, name, fl) |
18 | { | 16 | { |
19 | stopButton->setEnabled(false); | 17 | status->setStopEnabled(false); |
20 | 18 | ||
21 | connect(folderView, SIGNAL(status(const QString &)), statusLabel, SLOT(setText(const QString &))); | 19 | connect(folderView, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &))); |
22 | connect(folderView, SIGNAL(folderSelected(Folder)), mailView, SLOT(setFolder(Folder))); | 20 | connect(folderView, SIGNAL(folderSelected(Folder)), mailView, SLOT(setFolder(Folder))); |
23 | 21 | ||
24 | connect(mailView, SIGNAL(mailClicked(IMAPResponseFETCH, IMAPHandler *)), SLOT(mailClicked(IMAPResponseFETCH, IMAPHandler *))); | 22 | connect(mailView, SIGNAL(mailClicked(IMAPResponseFETCH, IMAPHandler *)), SLOT(mailClicked(IMAPResponseFETCH, IMAPHandler *))); |
25 | connect(mailView, SIGNAL(status(const QString &)), statusLabel, SLOT(setText(const QString &))); | 23 | connect(mailView, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &))); |
26 | connect(mailView, SIGNAL(totalSteps(int)), statusProgress, SLOT(setTotalSteps(int))); | 24 | connect(mailView, SIGNAL(totalSteps(int)), status, SLOT(setProgressTotalSteps(int))); |
27 | connect(mailView, SIGNAL(progress(int)), statusProgress, SLOT(setProgress(int))); | 25 | connect(mailView, SIGNAL(progress(int)), status, SLOT(setProgress(int))); |
28 | connect(mailView, SIGNAL(resetProgress()), statusProgress, SLOT(reset())); | 26 | connect(mailView, SIGNAL(resetProgress()), status, SLOT(resetProgress())); |
29 | connect(mailView, SIGNAL(stopEnabled(bool)), stopButton, SLOT(setEnabled(bool))); | 27 | connect(mailView, SIGNAL(stopEnabled(bool)), status, SLOT(setStopEnabled(bool))); |
30 | 28 | ||
31 | connect(stopButton, SIGNAL(clicked()), mailView, SLOT(stop())); | 29 | connect(status, SIGNAL(stop()), mailView, SLOT(stop())); |
32 | 30 | ||
33 | connect(compose, SIGNAL(activated()), SLOT(slotCompose())); | 31 | connect(compose, SIGNAL(activated()), SLOT(slotCompose())); |
34 | connect(sendQueue, SIGNAL(activated()), SLOT(slotSendQueued())); | 32 | connect(sendQueue, SIGNAL(activated()), SLOT(slotSendQueued())); |
35 | connect(findmails, SIGNAL(activated()), SLOT(slotSearch())); | 33 | connect(findmails, SIGNAL(activated()), SLOT(slotSearch())); |
36 | connect(configure, SIGNAL(activated()), SLOT(slotConfigure())); | 34 | connect(configure, SIGNAL(activated()), SLOT(slotConfigure())); |
37 | } | 35 | } |
diff --git a/noncore/unsupported/mail2/mainwindowbase.cpp b/noncore/unsupported/mail2/mainwindowbase.cpp index bffe8b3..e35d489 100644 --- a/noncore/unsupported/mail2/mainwindowbase.cpp +++ b/noncore/unsupported/mail2/mainwindowbase.cpp | |||
@@ -1,19 +1,18 @@ | |||
1 | #include <qprogressbar.h> | ||
2 | #include <qtoolbutton.h> | ||
3 | #include <qpopupmenu.h> | 1 | #include <qpopupmenu.h> |
4 | #include <qaction.h> | 2 | #include <qaction.h> |
5 | #include <qheader.h> | 3 | #include <qheader.h> |
6 | #include <qlabel.h> | 4 | #include <qlabel.h> |
7 | #include <qvbox.h> | 5 | #include <qvbox.h> |
8 | 6 | ||
9 | #include <qpe/qpetoolbar.h> | 7 | #include <qpe/qpetoolbar.h> |
10 | #include <qpe/qpemenubar.h> | 8 | #include <qpe/qpemenubar.h> |
11 | #include <qpe/resource.h> | 9 | #include <qpe/resource.h> |
12 | 10 | ||
13 | #include "mainwindowbase.h" | 11 | #include "mainwindowbase.h" |
12 | #include "mailstatusbar.h" | ||
14 | #include "folderwidget.h" | 13 | #include "folderwidget.h" |
15 | #include "mailtable.h" | 14 | #include "mailtable.h" |
16 | 15 | ||
17 | MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl) | 16 | MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl) |
18 | : QMainWindow(parent, name, fl) | 17 | : QMainWindow(parent, name, fl) |
19 | { | 18 | { |
@@ -62,28 +61,13 @@ MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl) | |||
62 | folderView->setMaximumHeight(90); | 61 | folderView->setMaximumHeight(90); |
63 | folderView->hide(); | 62 | folderView->hide(); |
64 | 63 | ||
65 | mailView = new MailTable(view); | 64 | mailView = new MailTable(view); |
66 | mailView->setMinimumHeight(50); | 65 | mailView->setMinimumHeight(50); |
67 | 66 | ||
68 | QHBox *status = new QHBox(view); | 67 | status = new MailStatusBar(view); |
69 | |||
70 | statusLabel = new QLabel(status); | ||
71 | QFont tmpFont = statusLabel->font(); | ||
72 | tmpFont.setPixelSize(8); | ||
73 | statusLabel->setFont(tmpFont); | ||
74 | |||
75 | stopButton = new QToolButton(status); | ||
76 | stopButton->setText(" X "); | ||
77 | stopButton->setMaximumHeight(15); | ||
78 | stopButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
79 | |||
80 | statusProgress = new QProgressBar(status); | ||
81 | statusProgress->setCenterIndicator(true); | ||
82 | statusProgress->setMaximumHeight(15); | ||
83 | statusProgress->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
84 | } | 68 | } |
85 | 69 | ||
86 | void MainWindowBase::slotFoldersToggled(bool toggled) | 70 | void MainWindowBase::slotFoldersToggled(bool toggled) |
87 | { | 71 | { |
88 | if (folderView->isHidden() && toggled) folderView->show(); | 72 | if (folderView->isHidden() && toggled) folderView->show(); |
89 | if (!folderView->isHidden() && !toggled) folderView->hide(); | 73 | if (!folderView->isHidden() && !toggled) folderView->hide(); |
diff --git a/noncore/unsupported/mail2/mainwindowbase.h b/noncore/unsupported/mail2/mainwindowbase.h index 702933a..11c5ea0 100644 --- a/noncore/unsupported/mail2/mainwindowbase.h +++ b/noncore/unsupported/mail2/mainwindowbase.h | |||
@@ -1,21 +1,19 @@ | |||
1 | #ifndef MAINWINDOWBASE_H | 1 | #ifndef MAINWINDOWBASE_H |
2 | #define MAINWINDOWBASE_H | 2 | #define MAINWINDOWBASE_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | 5 | ||
6 | class ServerConnection; | 6 | class ServerConnection; |
7 | class QProgressBar; | 7 | class MailStatusBar; |
8 | class FolderWidget; | 8 | class FolderWidget; |
9 | class QToolButton; | ||
10 | class QPEToolBar; | 9 | class QPEToolBar; |
11 | class QPEMenuBar; | 10 | class QPEMenuBar; |
12 | class QPopupMenu; | 11 | class QPopupMenu; |
13 | class MailTable; | 12 | class MailTable; |
14 | class QAction; | 13 | class QAction; |
15 | class QLabel; | ||
16 | 14 | ||
17 | class MainWindowBase : public QMainWindow | 15 | class MainWindowBase : public QMainWindow |
18 | { | 16 | { |
19 | Q_OBJECT | 17 | Q_OBJECT |
20 | 18 | ||
21 | public: | 19 | public: |
@@ -23,19 +21,17 @@ public: | |||
23 | 21 | ||
24 | protected slots: | 22 | protected slots: |
25 | void slotFoldersToggled(bool toggled); | 23 | void slotFoldersToggled(bool toggled); |
26 | 24 | ||
27 | protected: | 25 | protected: |
28 | ServerConnection *serverConnection; | 26 | ServerConnection *serverConnection; |
29 | QProgressBar *statusProgress; | 27 | MailStatusBar *status; |
30 | FolderWidget *folderView; | 28 | FolderWidget *folderView; |
31 | QToolButton *stopButton; | ||
32 | QPEToolBar *toolbar; | 29 | QPEToolBar *toolbar; |
33 | QPEMenuBar *menubar; | 30 | QPEMenuBar *menubar; |
34 | QPopupMenu *mailmenu, *servermenu; | 31 | QPopupMenu *mailmenu, *servermenu; |
35 | MailTable *mailView; | 32 | MailTable *mailView; |
36 | QAction *compose, *sendQueue, *folders, *findmails, *configure; | 33 | QAction *compose, *sendQueue, *folders, *findmails, *configure; |
37 | QLabel *statusLabel; | ||
38 | 34 | ||
39 | }; | 35 | }; |
40 | 36 | ||
41 | #endif | 37 | #endif |