-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 @@ -14,4 +14,4 @@ #include <opie/ofiledialog.h> -//#include "attachdiag.h" +#include "mailstatusbar.h" #include "addresspicker.h" @@ -34,3 +34,3 @@ Composer::Composer(QWidget *parent, const char *name, WFlags fl, bool sendQueue) _sendQueued = sendQueue; - abort->setEnabled(false); + status->setStopEnabled(false); to->setFocus(); @@ -156,3 +156,3 @@ void Composer::slotSendMail() - abort->setEnabled(true); + status->setStopEnabled(true); @@ -161,3 +161,3 @@ void Composer::slotSendMail() connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendError(const QString &))); - connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); + connect(handler, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &))); } @@ -250,3 +250,3 @@ void Composer::slotSendQueued() connect(handler, SIGNAL(error(const QString &)), SLOT(slotSendQueuedError(const QString &))); - connect(handler, SIGNAL(status(const QString &)), status, SLOT(setText(const QString &))); + connect(handler, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &))); @@ -307,3 +307,3 @@ void Composer::slotSendError(const QString &error) { - status->setText(tr("<font color=#ff0000>Error occoured during sending.</font>")); + status->setStatusText(tr("<font color=#ff0000>Error occoured during sending.</font>")); QMessageBox::warning(this, tr("Error"), tr("<p>%1</p").arg(error), tr("Ok")); @@ -315,3 +315,3 @@ void Composer::slotSendQueuedError(const QString &error) qDebug("error send mail %i",_sendCount); - status->setText(tr("<font color=#ff0000>Error occoured during sending.</font>")); + status->setStatusText(tr("<font color=#ff0000>Error occoured during sending.</font>")); QMessageBox::warning(this, tr("Error"), tr("<p>%1</p").arg(error), tr("Ok")); @@ -323,4 +323,4 @@ void Composer::slotSendFinished() - status->setText(QString(0)); - abort->setEnabled(false); + status->setStatusText(QString(0)); + status->setStopEnabled(false); } 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 @@ -13,2 +13,3 @@ +#include "mailstatusbar.h" #include "listviewplus.h" @@ -23,5 +24,5 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) toolbar = new QPEToolBar(this); - menubar = new QPEMenuBar( toolbar ); - mailmenu = new QPopupMenu( menubar ); - menubar->insertItem( tr( "Mail" ), mailmenu ); + menubar = new QPEMenuBar( toolbar ); + mailmenu = new QPopupMenu( menubar ); + menubar->insertItem( tr( "Mail" ), mailmenu ); addToolBar(toolbar); @@ -50,6 +51,2 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) - abort = new QAction(tr("Abort sending"), QIconSet(Resource::loadPixmap("mail/abort")), 0, 0, this); - abort->addTo(toolbar); - abort->addTo(mailmenu); - QWidget *main = new QWidget(this); @@ -125,4 +122,4 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) attachWindow = new QMainWindow(view, 0, 0); - attachWindow->setMinimumHeight(100); - attachWindow->setMaximumHeight(100); + attachWindow->setMinimumHeight(80); + attachWindow->setMaximumHeight(80); attachWindow->setToolBarsMovable(false); @@ -158,6 +155,3 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) - status = new QLabel(view); - QFont tmpFont = status->font(); - tmpFont.setPixelSize(8); - status->setFont(tmpFont); + status = new MailStatusBar(view); } 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 @@ -6,2 +6,3 @@ class QMultiLineEdit; +class MailStatusBar; class ListViewPlus; @@ -39,2 +40,3 @@ protected: QMultiLineEdit *message; + MailStatusBar *status; ListViewPlus *attachView; @@ -44,3 +46,3 @@ protected: QPEMenuBar *menubar; - QPopupMenu *mailmenu; + QPopupMenu *mailmenu; QComboBox *fromBox, *from, *receiversBox, *subjectBox, *priority; @@ -48,3 +50,3 @@ protected: QAction *sendmail, *queuemail, *attachfile, *addressbook, *abort, *addattach, *delattach; - QLabel *fromLabel, *status; + QLabel *fromLabel; 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 @@ -10,2 +10,3 @@ HEADERS = accounteditor.h \ listviewplus.h \ + mailstatusbar.h \ mailtable.h \ @@ -25,2 +26,3 @@ SOURCES = accounteditor.cpp \ listviewplus.cpp \ + mailstatusbar.cpp \ mailtable.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 @@ +#include <qprogressbar.h> +#include <qtoolbutton.h> +#include <qlabel.h> + +#include "mailstatusbar.h" + +MailStatusBar::MailStatusBar(QWidget *parent, const char *name, WFlags fl) + : QHBox(parent, name, fl) +{ + label = new QLabel(this); + QFont tmpFont = label->font(); + tmpFont.setPixelSize(8); + label->setFont(tmpFont); + + stopButton = new QToolButton(this); + stopButton->setText(" X "); + stopButton->setMaximumHeight(15); + stopButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + connect(stopButton, SIGNAL(clicked()), SLOT(stopClicked())); + + progress = new QProgressBar(this); + progress->setCenterIndicator(true); + progress->setMinimumHeight(15); + progress->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + progress->setFrameShape(QFrame::Box); + progress->setFrameShadow(QFrame::Raised); +} + +void MailStatusBar::setStatusText(const QString &text) +{ + label->setText(text); +} + +void MailStatusBar::setStopEnabled(bool enabled) +{ + stopButton->setEnabled(enabled); +} + +void MailStatusBar::setProgressTotalSteps(int steps) +{ + progress->setTotalSteps(steps); +} + +void MailStatusBar::setProgress(int pg) +{ + progress->setProgress(pg); +} + +void MailStatusBar::resetProgress() +{ + progress->reset(); +} + +void MailStatusBar::stopClicked() +{ + emit stop(); +} + 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 @@ +#ifndef MAILSTATUSBAR_H +#define MAILSTATUSBAR_H + +#include <qhbox.h> + +class QLabel; +class QToolButton; +class QProgressBar; + +class MailStatusBar : public QHBox +{ + Q_OBJECT + +public: + MailStatusBar(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); + +public slots: + void setStatusText(const QString &text); + void setStopEnabled(bool enabled); + void setProgressTotalSteps(int steps); + void setProgress(int progress); + void resetProgress(); + +signals: + void stop(); + +protected slots: + void stopClicked(); + +private: + QLabel *label; + QToolButton *stopButton; + QProgressBar *progress; + +}; + +#endif + 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,7 +1,5 @@ -#include <qprogressbar.h> #include <qmessagebox.h> -#include <qtoolbutton.h> #include <qaction.h> -#include <qlabel.h> +#include "mailstatusbar.h" #include "folderwidget.h" @@ -18,5 +16,5 @@ MainWindow::MainWindow(QWidget *parent, const char *name, WFlags fl) { - stopButton->setEnabled(false); + status->setStopEnabled(false); - connect(folderView, SIGNAL(status(const QString &)), statusLabel, SLOT(setText(const QString &))); + connect(folderView, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &))); connect(folderView, SIGNAL(folderSelected(Folder)), mailView, SLOT(setFolder(Folder))); @@ -24,9 +22,9 @@ MainWindow::MainWindow(QWidget *parent, const char *name, WFlags fl) connect(mailView, SIGNAL(mailClicked(IMAPResponseFETCH, IMAPHandler *)), SLOT(mailClicked(IMAPResponseFETCH, IMAPHandler *))); - connect(mailView, SIGNAL(status(const QString &)), statusLabel, SLOT(setText(const QString &))); - connect(mailView, SIGNAL(totalSteps(int)), statusProgress, SLOT(setTotalSteps(int))); - connect(mailView, SIGNAL(progress(int)), statusProgress, SLOT(setProgress(int))); - connect(mailView, SIGNAL(resetProgress()), statusProgress, SLOT(reset())); - connect(mailView, SIGNAL(stopEnabled(bool)), stopButton, SLOT(setEnabled(bool))); + connect(mailView, SIGNAL(status(const QString &)), status, SLOT(setStatusText(const QString &))); + connect(mailView, SIGNAL(totalSteps(int)), status, SLOT(setProgressTotalSteps(int))); + connect(mailView, SIGNAL(progress(int)), status, SLOT(setProgress(int))); + connect(mailView, SIGNAL(resetProgress()), status, SLOT(resetProgress())); + connect(mailView, SIGNAL(stopEnabled(bool)), status, SLOT(setStopEnabled(bool))); - connect(stopButton, SIGNAL(clicked()), mailView, SLOT(stop())); + connect(status, SIGNAL(stop()), mailView, SLOT(stop())); 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,3 +1 @@ -#include <qprogressbar.h> -#include <qtoolbutton.h> #include <qpopupmenu.h> @@ -13,2 +11,3 @@ #include "mainwindowbase.h" +#include "mailstatusbar.h" #include "folderwidget.h" @@ -67,18 +66,3 @@ MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl) - QHBox *status = new QHBox(view); - - statusLabel = new QLabel(status); - QFont tmpFont = statusLabel->font(); - tmpFont.setPixelSize(8); - statusLabel->setFont(tmpFont); - - stopButton = new QToolButton(status); - stopButton->setText(" X "); - stopButton->setMaximumHeight(15); - stopButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); - - statusProgress = new QProgressBar(status); - statusProgress->setCenterIndicator(true); - statusProgress->setMaximumHeight(15); - statusProgress->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + status = new MailStatusBar(view); } 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 @@ -6,5 +6,4 @@ class ServerConnection; -class QProgressBar; +class MailStatusBar; class FolderWidget; -class QToolButton; class QPEToolBar; @@ -14,3 +13,2 @@ class MailTable; class QAction; -class QLabel; @@ -28,5 +26,4 @@ protected: ServerConnection *serverConnection; - QProgressBar *statusProgress; + MailStatusBar *status; FolderWidget *folderView; - QToolButton *stopButton; QPEToolBar *toolbar; @@ -36,3 +33,2 @@ protected: QAction *compose, *sendQueue, *folders, *findmails, *configure; - QLabel *statusLabel; |