summaryrefslogtreecommitdiff
authorconber <conber>2002-08-06 16:32:49 (UTC)
committer conber <conber>2002-08-06 16:32:49 (UTC)
commit8084d002de5e310491eec7fac0713ef29d0cf30f (patch) (side-by-side diff)
treefe74e3cf2ee2f7d87e74910fbf4bfa34b9a439a0
parente6a512dc2e0602298f8a745036d25eb171ced977 (diff)
downloadopie-8084d002de5e310491eec7fac0713ef29d0cf30f.zip
opie-8084d002de5e310491eec7fac0713ef29d0cf30f.tar.gz
opie-8084d002de5e310491eec7fac0713ef29d0cf30f.tar.bz2
ui improvements
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mail2/composer.cpp18
-rw-r--r--noncore/unsupported/mail2/composerbase.cpp20
-rw-r--r--noncore/unsupported/mail2/composerbase.h6
-rw-r--r--noncore/unsupported/mail2/mail.pro2
-rw-r--r--noncore/unsupported/mail2/mailstatusbar.cpp58
-rw-r--r--noncore/unsupported/mail2/mailstatusbar.h38
-rw-r--r--noncore/unsupported/mail2/mainwindow.cpp20
-rw-r--r--noncore/unsupported/mail2/mainwindowbase.cpp20
-rw-r--r--noncore/unsupported/mail2/mainwindowbase.h8
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
@@ -1,51 +1,51 @@
#include <qmultilineedit.h>
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <qaction.h>
#include <qtimer.h>
#include <qlabel.h>
#include <qapplication.h>
#include <qpe/resource.h>
#include <qpe/config.h>
#include <opie/ofiledialog.h>
-//#include "attachdiag.h"
+#include "mailstatusbar.h"
#include "addresspicker.h"
#include "listviewplus.h"
#include "smtphandler.h"
#include "composer.h"
#include "rename.h"
AttachViewItem::AttachViewItem(QListView *parent, Attachment &attachment)
: QListViewItem(parent), _attachment(attachment)
{
setPixmap(0, _attachment.docLnk().pixmap().isNull() ? Resource::loadPixmap("UnknownDocument-14") : _attachment.docLnk().pixmap());
setText(0, _attachment.newName().isEmpty() ? _attachment.fileName() : _attachment.newName());
setText(1, _attachment.description());
}
Composer::Composer(QWidget *parent, const char *name, WFlags fl, bool sendQueue)
: ComposerBase(parent, name, fl), _inLoop(false)
{
_sendQueued = sendQueue;
- abort->setEnabled(false);
+ status->setStopEnabled(false);
to->setFocus();
connect(sendmail, SIGNAL(activated()), SLOT(slotSendMail()));
connect(queuemail, SIGNAL(activated()), SLOT(slotQueueMail()));
connect(addressbook, SIGNAL(activated()), SLOT(slotOpenAddressPicker()));
connect(addattach, SIGNAL(activated()), SLOT(slotAddAttach()));
connect(delattach, SIGNAL(activated()), SLOT(slotDelAttach()));
connect(from, SIGNAL(activated(int)), SLOT(slotFromChanged(int)));
connect(attachPopup, SIGNAL(activated(int)), SLOT(slotPopupHandler(int)));
QTimer::singleShot(0, this, SLOT(slotFillStuff()));
QTimer::singleShot(0, this, SLOT(slotResizing()));
}
@@ -141,38 +141,38 @@ void Composer::slotSendMail()
} else if (priority->currentItem() == POPUP_PRIO_HIGH) {
smail.setPriority("High"); // No i18n on purpose
}
QValueList<Attachment> attachments;
QListViewItem *item;
for (item = attachView->firstChild(); item != 0; item = item->itemBelow()) {
attachments.append(((AttachViewItem *)item)->attachment());
}
smail.setAttachments(attachments);
QString header, message;
MailFactory::genMail(header, message, smail, this);
if (header.isNull() || message.isNull()) return; // Aborted.
- abort->setEnabled(true);
+ status->setStopEnabled(true);
SmtpHandler *handler = new SmtpHandler(header, message, accountsLoaded[from->currentItem()], to->text());
connect(handler, SIGNAL(finished()), SLOT(slotSendFinished()));
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 &)));
}
void Composer::slotSendQueued()
{
int effSendCount = 0;
qDebug("Sending queued messages");
Config cfg( "mailqueue", Config::User );
cfg.setGroup( "Settings" );
_sendCount = 0;
_sendError = 0;
_toSend = cfg.readNumEntry( "count", 0 );
if (_toSend == 0) close();
qDebug("%i messages to send", _toSend);
QString str;
@@ -235,33 +235,33 @@ void Composer::slotSendQueued()
smail.setAttachments(attachments);
qDebug("putting mail together");
QString header, message;
MailFactory::genMail(header, message, smail, this);
if (header.isNull() || message.isNull()) continue;//return; // Aborted.
// abort->setEnabled(true);
qDebug("Sending to %s",toAdr.latin1());
SmtpHandler *handler = new SmtpHandler(header, message, accnt ,toAdr);
effSendCount++;
connect(handler, SIGNAL(finished()), SLOT(slotSendQueuedFinished()));
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 &)));
}
if (effSendCount < _toSend)
{
_toSend = effSendCount;
QMessageBox::information(this, tr("Error"), tr("<p>There was a problem sending some of the queued mails.</p>"), tr("Ok"));
}
}
void Composer::slotQueueMail()
{
if (to->text().find(QRegExp(".*\\@.*\\..*")) == -1) {
QMessageBox::information(this, tr("Error"), tr("<p>You have to specify a recipient.<br>(eg: foo@bar.org)</p>"), tr("Ok"));
return;
}
@@ -292,50 +292,50 @@ void Composer::slotQueueMail()
int i = 0;
for (item = attachView->firstChild(); item != 0; item = item->itemBelow()) {
a = ((AttachViewItem *)item)->attachment();
an = "Attachment_" + QString::number( i++ );
cfg.writeEntry( an + "fileName", a.fileName() );
cfg.writeEntry( an + "newName", a.newName() );
cfg.writeEntry( an + "description", a.description() );
cfg.writeEntry( an + "docLnk", a.docLnk().file() );
}
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"));
}
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"));
}
void Composer::slotSendQueuedError(const QString &error)
{
_sendError++;
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"));
}
void Composer::slotSendFinished()
{
QMessageBox::information(this, tr("Success"), tr("<p>The mail was sent successfully.</p>"), tr("Ok"));
- status->setText(QString(0));
- abort->setEnabled(false);
+ status->setStatusText(QString(0));
+ status->setStopEnabled(false);
}
void Composer::slotSendQueuedFinished()
{
_sendCount++;
qDebug("finished send mail %i of %i (error %i)",_sendCount,_toSend,_sendError);
if (_sendCount < _toSend) return;
if (_sendError == _toSend) close();
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"));
Config cfg( "mailqueue", Config::User );
cfg.setGroup( "Settings" );
cfg.writeEntry( "count", 0 );
for (int i=1;i<=_sendCount;i++)
{
cfg.setGroup( "Mail_" + QString::number(i) );
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
@@ -1,70 +1,67 @@
#include <qmultilineedit.h>
#include <qpopupmenu.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <qlayout.h>
#include <qaction.h>
#include <qlabel.h>
#include <qvbox.h>
#include <qpe/qpetoolbar.h>
#include <qpe/qpemenubar.h>
#include <qpe/resource.h>
+#include "mailstatusbar.h"
#include "listviewplus.h"
#include "composerbase.h"
ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl)
: QMainWindow(parent, name, fl)
{
setCaption(tr("Compose Message"));
setToolBarsMovable(false);
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);
toolbar->setHorizontalStretchable(true);
QLabel *spacer = new QLabel(toolbar);
spacer->setBackgroundMode(QWidget::PaletteButton);
toolbar->setStretchableWidget(spacer);
sendmail = new QAction(tr("Send the mail"), QIconSet(Resource::loadPixmap("mail/sendmail")), 0, 0, this);
sendmail->addTo(toolbar);
sendmail->addTo(mailmenu);
queuemail = new QAction(tr("Queue the mail"), QIconSet(Resource::loadPixmap("mail/sendall")), 0, 0, this);
queuemail->addTo(toolbar);
queuemail->addTo(mailmenu);
attachfile = new QAction(tr("Attach a file"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true);
attachfile->addTo(toolbar);
attachfile->addTo(mailmenu);
connect(attachfile, SIGNAL(toggled(bool)), SLOT(slotAttachfileChanged(bool)));
addressbook = new QAction(tr("Addressbook"), QIconSet(Resource::loadPixmap("mail/addbook")), 0, 0, this);
addressbook->addTo(toolbar);
addressbook->addTo(mailmenu);
- 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);
setCentralWidget(main);
QGridLayout *layout = new QGridLayout(main);
fromBox = new QComboBox(main);
fromBox->insertItem(tr("From"), POPUP_FROM_FROM);
fromBox->insertItem(tr("Reply"), POPUP_FROM_REPLYTO);
layout->addWidget(fromBox, 0, 0);
connect(fromBox, SIGNAL(activated(int)), SLOT(slotFromMenuChanged(int)));
QHBoxLayout *fromLayout = new QHBoxLayout();
layout->addLayout(fromLayout, 0, 1);
from = new QComboBox(main);
@@ -110,69 +107,66 @@ ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl)
priority = new QComboBox(main);
priority->insertItem(tr("Low"), POPUP_PRIO_LOW);
priority->insertItem(tr("Normal"), POPUP_PRIO_NORMAL);
priority->insertItem(tr("High"), POPUP_PRIO_HIGH);
priority->setCurrentItem(POPUP_PRIO_NORMAL);
priority->hide();
subjectLayout->addWidget(priority);
QVBox *view = new QVBox(main);
layout->addMultiCellWidget(view, 3, 3, 0, 1);
message = new QMultiLineEdit(view);
message->setMinimumHeight(30);
attachWindow = new QMainWindow(view, 0, 0);
- attachWindow->setMinimumHeight(100);
- attachWindow->setMaximumHeight(100);
+ attachWindow->setMinimumHeight(80);
+ attachWindow->setMaximumHeight(80);
attachWindow->setToolBarsMovable(false);
attachWindow->hide();
attachToolbar = new QPEToolBar(attachWindow);
attachToolbar->setVerticalStretchable(true);
addattach = new QAction(tr("Add an Attachement"), QIconSet(Resource::loadPixmap("mail/newmail")), 0, 0, this);
addattach->addTo(attachToolbar);
delattach = new QAction(tr("Remove Attachement"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this);
delattach->addTo(attachToolbar);
QLabel *attachSpacer = new QLabel(attachToolbar);
attachSpacer->setBackgroundMode(QWidget::PaletteButton);
attachToolbar->setStretchableWidget(attachSpacer);
attachWindow->addToolBar(attachToolbar, QMainWindow::Left);
attachView = new ListViewPlus(attachWindow);
attachView->addColumn(tr("Name"), 80);
attachView->addColumn(tr("Description"), 110);
attachView->setAllColumnsShowFocus(true);
attachWindow->setCentralWidget(attachView);
attachPopup = new QPopupMenu(attachView);
attachPopup->insertItem(tr("Rename"), POPUP_ATTACH_RENAME);
attachPopup->insertItem(tr("Change Description"), POPUP_ATTACH_DESC);
attachPopup->insertSeparator();
attachPopup->insertItem(tr("Remove"), POPUP_ATTACH_REMOVE);
attachView->setPopup(attachPopup);
- status = new QLabel(view);
- QFont tmpFont = status->font();
- tmpFont.setPixelSize(8);
- status->setFont(tmpFont);
+ status = new MailStatusBar(view);
}
void ComposerBase::slotAttachfileChanged(bool toggled)
{
if (toggled) {
if (attachWindow->isHidden()) attachWindow->show();
} else {
if (!attachWindow->isHidden()) attachWindow->hide();
}
}
void ComposerBase::slotFromMenuChanged(int id)
{
if (POPUP_FROM_FROM == id) {
if (from->isHidden()) from->show();
if (!replyto->isHidden()) replyto->hide();
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,22 +1,23 @@
#ifndef COMPOSERBASE_H
#define COMPOSERBASE_H
#include <qmainwindow.h>
class QMultiLineEdit;
+class MailStatusBar;
class ListViewPlus;
class QPopupMenu;
class QPEToolBar;
class QPEMenuBar;
class QPopupMenu;
class QComboBox;
class QLineEdit;
class QAction;
class QLabel;
class ComposerBase : public QMainWindow
{
Q_OBJECT
public:
ComposerBase(QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
@@ -24,36 +25,37 @@ public:
protected:
static const int POPUP_FROM_FROM = 0;
static const int POPUP_FROM_REPLYTO = 1;
static const int POPUP_RECV_TO = 0;
static const int POPUP_RECV_CC = 1;
static const int POPUP_RECV_BCC = 2;
static const int POPUP_SUBJ_SUBJECT = 0;
static const int POPUP_SUBJ_PRIORITY = 1;
static const int POPUP_PRIO_LOW = 0;
static const int POPUP_PRIO_NORMAL = 1;
static const int POPUP_PRIO_HIGH = 2;
static const int POPUP_ATTACH_RENAME = 0;
static const int POPUP_ATTACH_DESC = 1;
static const int POPUP_ATTACH_REMOVE = 2;
QMultiLineEdit *message;
+ MailStatusBar *status;
ListViewPlus *attachView;
QMainWindow *attachWindow;
QPopupMenu *attachPopup;
QPEToolBar *toolbar, *attachToolbar;
QPEMenuBar *menubar;
- QPopupMenu *mailmenu;
+ QPopupMenu *mailmenu;
QComboBox *fromBox, *from, *receiversBox, *subjectBox, *priority;
QLineEdit *replyto, *to, *cc, *bcc, *subject;
QAction *sendmail, *queuemail, *attachfile, *addressbook, *abort, *addattach, *delattach;
- QLabel *fromLabel, *status;
+ QLabel *fromLabel;
protected slots:
void slotAttachfileChanged(bool toggled);
void slotFromMenuChanged(int id);
void slotReceiverMenuChanged(int id);
void slotSubjectMenuChanged(int id);
};
#endif
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
@@ -1,41 +1,43 @@
TEMPLATE = app
CONFIG = qt warn_on debug
#CONFIG = qt warn_on release
HEADERS = accounteditor.h \
addresspicker.h \
composer.h \
composerbase.h \
configdiag.h \
folderwidget.h \
listviewplus.h \
+ mailstatusbar.h \
mailtable.h \
mainwindow.h \
mainwindowbase.h \
opendiag.h \
rename.h \
searchdiag.h \
viewmail.h \
viewmailbase.h
SOURCES = accounteditor.cpp \
addresspicker.cpp \
composer.cpp \
composerbase.cpp \
configdiag.cpp \
folderwidget.cpp \
listviewplus.cpp \
+ mailstatusbar.cpp \
mailtable.cpp \
main.cpp \
mainwindow.cpp \
mainwindowbase.cpp \
opendiag.cpp \
rename.cpp \
searchdiag.cpp \
viewmail.cpp \
viewmailbase.cpp
INTERFACES = accounteditorbase.ui \
addresspickerbase.ui \
configdiagbase.ui \
opendiagbase.ui \
renamebase.ui \
searchdiagbase.ui
INCLUDEPATH += $(OPIEDIR)/include libmail
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,47 +1,45 @@
-#include <qprogressbar.h>
#include <qmessagebox.h>
-#include <qtoolbutton.h>
#include <qaction.h>
-#include <qlabel.h>
+#include "mailstatusbar.h"
#include "folderwidget.h"
#include "mainwindow.h"
#include "configdiag.h"
#include "configfile.h"
#include "searchdiag.h"
#include "mailtable.h"
#include "composer.h"
#include "viewmail.h"
MainWindow::MainWindow(QWidget *parent, const char *name, WFlags fl)
: MainWindowBase(parent, name, 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)));
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()));
connect(compose, SIGNAL(activated()), SLOT(slotCompose()));
connect(sendQueue, SIGNAL(activated()), SLOT(slotSendQueued()));
connect(findmails, SIGNAL(activated()), SLOT(slotSearch()));
connect(configure, SIGNAL(activated()), SLOT(slotConfigure()));
}
void MainWindow::slotCompose()
{
Composer composer(this, 0, true);
composer.showMaximized();
composer.exec();
}
void MainWindow::slotSendQueued()
{
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,29 +1,28 @@
-#include <qprogressbar.h>
-#include <qtoolbutton.h>
#include <qpopupmenu.h>
#include <qaction.h>
#include <qheader.h>
#include <qlabel.h>
#include <qvbox.h>
#include <qpe/qpetoolbar.h>
#include <qpe/qpemenubar.h>
#include <qpe/resource.h>
#include "mainwindowbase.h"
+#include "mailstatusbar.h"
#include "folderwidget.h"
#include "mailtable.h"
MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl)
: QMainWindow(parent, name, fl)
{
setCaption(tr("E-Mail"));
setToolBarsMovable(false);
toolbar = new QPEToolBar(this);
menubar = new QPEMenuBar( toolbar );
mailmenu = new QPopupMenu( menubar );
servermenu = new QPopupMenu( menubar );
menubar->insertItem( tr( "Mail" ), mailmenu );
menubar->insertItem( tr( "Servers" ), servermenu );
@@ -52,40 +51,25 @@ MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl)
findmails->addTo(mailmenu);
configure = new QAction(tr("Configuration"), QIconSet(Resource::loadPixmap("mail/configure")), 0, 0, this);
configure->addTo(servermenu);
QVBox *view = new QVBox(this);
setCentralWidget(view);
folderView = new FolderWidget(view);
folderView->setMinimumHeight(90);
folderView->setMaximumHeight(90);
folderView->hide();
mailView = new MailTable(view);
mailView->setMinimumHeight(50);
- 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);
}
void MainWindowBase::slotFoldersToggled(bool toggled)
{
if (folderView->isHidden() && toggled) folderView->show();
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,41 +1,37 @@
#ifndef MAINWINDOWBASE_H
#define MAINWINDOWBASE_H
#include <qmainwindow.h>
class ServerConnection;
-class QProgressBar;
+class MailStatusBar;
class FolderWidget;
-class QToolButton;
class QPEToolBar;
class QPEMenuBar;
class QPopupMenu;
class MailTable;
class QAction;
-class QLabel;
class MainWindowBase : public QMainWindow
{
Q_OBJECT
public:
MainWindowBase(QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
protected slots:
void slotFoldersToggled(bool toggled);
protected:
ServerConnection *serverConnection;
- QProgressBar *statusProgress;
+ MailStatusBar *status;
FolderWidget *folderView;
- QToolButton *stopButton;
QPEToolBar *toolbar;
QPEMenuBar *menubar;
QPopupMenu *mailmenu, *servermenu;
MailTable *mailView;
QAction *compose, *sendQueue, *folders, *findmails, *configure;
- QLabel *statusLabel;
};
#endif