-rw-r--r-- | noncore/unsupported/mail2/mainwindow.cpp | 7 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mainwindowbase.cpp | 23 | ||||
-rw-r--r-- | noncore/unsupported/mail2/mainwindowbase.h | 6 |
3 files changed, 20 insertions, 16 deletions
diff --git a/noncore/unsupported/mail2/mainwindow.cpp b/noncore/unsupported/mail2/mainwindow.cpp index 652db94..0044693 100644 --- a/noncore/unsupported/mail2/mainwindow.cpp +++ b/noncore/unsupported/mail2/mainwindow.cpp | |||
@@ -1,42 +1,43 @@ | |||
1 | #include <qprogressbar.h> | 1 | #include <qprogressbar.h> |
2 | #include <qmessagebox.h> | 2 | #include <qmessagebox.h> |
3 | #include <qtoolbutton.h> | ||
3 | #include <qaction.h> | 4 | #include <qaction.h> |
4 | #include <qlabel.h> | 5 | #include <qlabel.h> |
5 | 6 | ||
6 | #include "folderwidget.h" | 7 | #include "folderwidget.h" |
7 | #include "mainwindow.h" | 8 | #include "mainwindow.h" |
8 | #include "configdiag.h" | 9 | #include "configdiag.h" |
9 | #include "configfile.h" | 10 | #include "configfile.h" |
10 | #include "searchdiag.h" | 11 | #include "searchdiag.h" |
11 | #include "mailtable.h" | 12 | #include "mailtable.h" |
12 | #include "composer.h" | 13 | #include "composer.h" |
13 | #include "viewmail.h" | 14 | #include "viewmail.h" |
14 | 15 | ||
15 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags fl) | 16 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags fl) |
16 | : MainWindowBase(parent, name, fl) | 17 | : MainWindowBase(parent, name, fl) |
17 | { | 18 | { |
18 | stop->setEnabled(false); | 19 | stopButton->setEnabled(false); |
19 | 20 | ||
20 | connect(folderView, SIGNAL(status(const QString &)), statusLabel, SLOT(setText(const QString &))); | 21 | connect(folderView, SIGNAL(status(const QString &)), statusLabel, SLOT(setText(const QString &))); |
21 | connect(folderView, SIGNAL(folderSelected(Folder)), mailView, SLOT(setFolder(Folder))); | 22 | connect(folderView, SIGNAL(folderSelected(Folder)), mailView, SLOT(setFolder(Folder))); |
22 | 23 | ||
23 | connect(mailView, SIGNAL(mailClicked(IMAPResponseFETCH, IMAPHandler *)), SLOT(mailClicked(IMAPResponseFETCH, IMAPHandler *))); | 24 | connect(mailView, SIGNAL(mailClicked(IMAPResponseFETCH, IMAPHandler *)), SLOT(mailClicked(IMAPResponseFETCH, IMAPHandler *))); |
24 | connect(mailView, SIGNAL(status(const QString &)), statusLabel, SLOT(setText(const QString &))); | 25 | connect(mailView, SIGNAL(status(const QString &)), statusLabel, SLOT(setText(const QString &))); |
25 | connect(mailView, SIGNAL(totalSteps(int)), statusProgress, SLOT(setTotalSteps(int))); | 26 | connect(mailView, SIGNAL(totalSteps(int)), statusProgress, SLOT(setTotalSteps(int))); |
26 | connect(mailView, SIGNAL(progress(int)), statusProgress, SLOT(setProgress(int))); | 27 | connect(mailView, SIGNAL(progress(int)), statusProgress, SLOT(setProgress(int))); |
27 | connect(mailView, SIGNAL(resetProgress()), statusProgress, SLOT(reset())); | 28 | connect(mailView, SIGNAL(resetProgress()), statusProgress, SLOT(reset())); |
28 | connect(mailView, SIGNAL(stopEnabled(bool)), stop, SLOT(setEnabled(bool))); | 29 | connect(mailView, SIGNAL(stopEnabled(bool)), stopButton, SLOT(setEnabled(bool))); |
29 | 30 | ||
30 | connect(stop, SIGNAL(activated()), mailView, SLOT(stop())); | 31 | connect(stopButton, SIGNAL(clicked()), mailView, SLOT(stop())); |
31 | 32 | ||
32 | connect(compose, SIGNAL(activated()), SLOT(slotCompose())); | 33 | connect(compose, SIGNAL(activated()), SLOT(slotCompose())); |
33 | connect(sendQueue, SIGNAL(activated()), SLOT(slotSendQueued())); | 34 | connect(sendQueue, SIGNAL(activated()), SLOT(slotSendQueued())); |
34 | connect(findmails, SIGNAL(activated()), SLOT(slotSearch())); | 35 | connect(findmails, SIGNAL(activated()), SLOT(slotSearch())); |
35 | connect(configure, SIGNAL(activated()), SLOT(slotConfigure())); | 36 | connect(configure, SIGNAL(activated()), SLOT(slotConfigure())); |
36 | } | 37 | } |
37 | 38 | ||
38 | void MainWindow::slotCompose() | 39 | void MainWindow::slotCompose() |
39 | { | 40 | { |
40 | Composer composer(this, 0, true); | 41 | Composer composer(this, 0, true); |
41 | composer.showMaximized(); | 42 | composer.showMaximized(); |
42 | composer.exec(); | 43 | composer.exec(); |
diff --git a/noncore/unsupported/mail2/mainwindowbase.cpp b/noncore/unsupported/mail2/mainwindowbase.cpp index d61899b..bffe8b3 100644 --- a/noncore/unsupported/mail2/mainwindowbase.cpp +++ b/noncore/unsupported/mail2/mainwindowbase.cpp | |||
@@ -12,79 +12,80 @@ | |||
12 | 12 | ||
13 | #include "mainwindowbase.h" | 13 | #include "mainwindowbase.h" |
14 | #include "folderwidget.h" | 14 | #include "folderwidget.h" |
15 | #include "mailtable.h" | 15 | #include "mailtable.h" |
16 | 16 | ||
17 | MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl) | 17 | MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl) |
18 | : QMainWindow(parent, name, fl) | 18 | : QMainWindow(parent, name, fl) |
19 | { | 19 | { |
20 | setCaption(tr("E-Mail")); | 20 | setCaption(tr("E-Mail")); |
21 | setToolBarsMovable(false); | 21 | setToolBarsMovable(false); |
22 | 22 | ||
23 | toolbar = new QPEToolBar(this); | 23 | toolbar = new QPEToolBar(this); |
24 | menubar = new QPEMenuBar( toolbar ); | 24 | menubar = new QPEMenuBar( toolbar ); |
25 | mailmenu = new QPopupMenu( menubar ); | 25 | mailmenu = new QPopupMenu( menubar ); |
26 | servermenu = new QPopupMenu( menubar ); | 26 | servermenu = new QPopupMenu( menubar ); |
27 | menubar->insertItem( tr( "Mail" ), mailmenu ); | 27 | menubar->insertItem( tr( "Mail" ), mailmenu ); |
28 | menubar->insertItem( tr( "Servers" ), servermenu ); | 28 | menubar->insertItem( tr( "Servers" ), servermenu ); |
29 | 29 | ||
30 | addToolBar(toolbar); | 30 | addToolBar(toolbar); |
31 | toolbar->setHorizontalStretchable(true); | 31 | toolbar->setHorizontalStretchable(true); |
32 | 32 | ||
33 | QLabel *spacer = new QLabel(toolbar); | 33 | QLabel *spacer = new QLabel(toolbar); |
34 | spacer->setBackgroundMode(QWidget::PaletteButton); | 34 | spacer->setBackgroundMode(QWidget::PaletteButton); |
35 | toolbar->setStretchableWidget(spacer); | 35 | toolbar->setStretchableWidget(spacer); |
36 | 36 | ||
37 | compose = new QAction(tr("Compose new mail"), QIconSet(Resource::loadPixmap("mail/newmail")), 0, 0, this); | 37 | compose = new QAction(tr("Compose new mail"), QIconSet(Resource::loadPixmap("mail/newmail")), 0, 0, this); |
38 | compose->addTo(toolbar); | 38 | compose->addTo(toolbar); |
39 | compose->addTo(mailmenu); | 39 | compose->addTo(mailmenu); |
40 | 40 | ||
41 | sendQueue = new QAction(tr("Send queued mails"), QIconSet(Resource::loadPixmap("mail/sendqueue")), 0, 0, this); | 41 | sendQueue = new QAction(tr("Send queued mails"), QIconSet(Resource::loadPixmap("mail/sendqueue")), 0, 0, this); |
42 | sendQueue->addTo(toolbar); | 42 | sendQueue->addTo(toolbar); |
43 | sendQueue->addTo(mailmenu); | 43 | sendQueue->addTo(mailmenu); |
44 | 44 | ||
45 | folders = new QAction(tr("Show/hide folders"), QIconSet(Resource::loadPixmap("mail/folder")), 0, 0, this, 0, true); | 45 | folders = new QAction(tr("Show/hide folders"), QIconSet(Resource::loadPixmap("mail/folder")), 0, 0, this, 0, true); |
46 | folders->addTo(toolbar); | 46 | folders->addTo(toolbar); |
47 | folders->addTo(servermenu); | 47 | folders->addTo(servermenu); |
48 | connect(folders, SIGNAL(toggled(bool)), SLOT(slotFoldersToggled(bool))); | 48 | connect(folders, SIGNAL(toggled(bool)), SLOT(slotFoldersToggled(bool))); |
49 | 49 | ||
50 | findmails = new QAction(tr("Search mails"), QIconSet(Resource::loadPixmap("mail/find")), 0, 0, this); | 50 | findmails = new QAction(tr("Search mails"), QIconSet(Resource::loadPixmap("mail/find")), 0, 0, this); |
51 | findmails->addTo(toolbar); | 51 | findmails->addTo(toolbar); |
52 | findmails->addTo(mailmenu); | 52 | findmails->addTo(mailmenu); |
53 | 53 | ||
54 | configure = new QAction(tr("Configuration"), QIconSet(Resource::loadPixmap("mail/configure")), 0, 0, this); | 54 | configure = new QAction(tr("Configuration"), QIconSet(Resource::loadPixmap("mail/configure")), 0, 0, this); |
55 | configure->addTo(toolbar); | ||
56 | configure->addTo(servermenu); | 55 | configure->addTo(servermenu); |
57 | 56 | ||
58 | stop = new QAction(tr("Abort"), QIconSet(Resource::loadPixmap("mail/abort")), 0, 0, this); | ||
59 | stop->addTo(toolbar); | ||
60 | |||
61 | QVBox *view = new QVBox(this); | 57 | QVBox *view = new QVBox(this); |
62 | setCentralWidget(view); | 58 | setCentralWidget(view); |
63 | 59 | ||
64 | folderView = new FolderWidget(view); | 60 | folderView = new FolderWidget(view); |
65 | folderView->setMinimumHeight(90); | 61 | folderView->setMinimumHeight(90); |
66 | folderView->setMaximumHeight(90); | 62 | folderView->setMaximumHeight(90); |
67 | folderView->hide(); | 63 | folderView->hide(); |
68 | 64 | ||
69 | mailView = new MailTable(view); | 65 | mailView = new MailTable(view); |
70 | mailView->setMinimumHeight(50); | 66 | mailView->setMinimumHeight(50); |
71 | 67 | ||
72 | QHBox *status = new QHBox(view); | 68 | QHBox *status = new QHBox(view); |
73 | 69 | ||
74 | statusLabel = new QLabel(status); | 70 | statusLabel = new QLabel(status); |
75 | QFont tmpFont = statusLabel->font(); | 71 | QFont tmpFont = statusLabel->font(); |
76 | tmpFont.setPixelSize(8); | 72 | tmpFont.setPixelSize(8); |
77 | statusLabel->setFont(tmpFont); | 73 | statusLabel->setFont(tmpFont); |
78 | 74 | ||
75 | stopButton = new QToolButton(status); | ||
76 | stopButton->setText(" X "); | ||
77 | stopButton->setMaximumHeight(15); | ||
78 | stopButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
79 | |||
79 | statusProgress = new QProgressBar(status); | 80 | statusProgress = new QProgressBar(status); |
80 | statusProgress->setCenterIndicator(true); | 81 | statusProgress->setCenterIndicator(true); |
81 | statusProgress->setMaximumHeight(15); | 82 | statusProgress->setMaximumHeight(15); |
82 | statusProgress->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | 83 | statusProgress->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); |
83 | } | 84 | } |
84 | 85 | ||
85 | void MainWindowBase::slotFoldersToggled(bool toggled) | 86 | void MainWindowBase::slotFoldersToggled(bool toggled) |
86 | { | 87 | { |
87 | if (folderView->isHidden() && toggled) folderView->show(); | 88 | if (folderView->isHidden() && toggled) folderView->show(); |
88 | if (!folderView->isHidden() && !toggled) folderView->hide(); | 89 | if (!folderView->isHidden() && !toggled) folderView->hide(); |
89 | } | 90 | } |
90 | 91 | ||
diff --git a/noncore/unsupported/mail2/mainwindowbase.h b/noncore/unsupported/mail2/mainwindowbase.h index d8faeba..702933a 100644 --- a/noncore/unsupported/mail2/mainwindowbase.h +++ b/noncore/unsupported/mail2/mainwindowbase.h | |||
@@ -1,39 +1,41 @@ | |||
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 QProgressBar; |
8 | class FolderWidget; | 8 | class FolderWidget; |
9 | class QToolButton; | ||
9 | class QPEToolBar; | 10 | class QPEToolBar; |
10 | class QPEMenuBar; | 11 | class QPEMenuBar; |
11 | class QPopupMenu; | 12 | class QPopupMenu; |
12 | class MailTable; | 13 | class MailTable; |
13 | class QAction; | 14 | class QAction; |
14 | class QLabel; | 15 | class QLabel; |
15 | 16 | ||
16 | class MainWindowBase : public QMainWindow | 17 | class MainWindowBase : public QMainWindow |
17 | { | 18 | { |
18 | Q_OBJECT | 19 | Q_OBJECT |
19 | 20 | ||
20 | public: | 21 | public: |
21 | MainWindowBase(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); | 22 | MainWindowBase(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); |
22 | 23 | ||
23 | protected slots: | 24 | protected slots: |
24 | void slotFoldersToggled(bool toggled); | 25 | void slotFoldersToggled(bool toggled); |
25 | 26 | ||
26 | protected: | 27 | protected: |
27 | ServerConnection *serverConnection; | 28 | ServerConnection *serverConnection; |
28 | QProgressBar *statusProgress; | 29 | QProgressBar *statusProgress; |
29 | FolderWidget *folderView; | 30 | FolderWidget *folderView; |
31 | QToolButton *stopButton; | ||
30 | QPEToolBar *toolbar; | 32 | QPEToolBar *toolbar; |
31 | QPEMenuBar *menubar; | 33 | QPEMenuBar *menubar; |
32 | QPopupMenu *mailmenu, *servermenu; | 34 | QPopupMenu *mailmenu, *servermenu; |
33 | MailTable *mailView; | 35 | MailTable *mailView; |
34 | QAction *compose, *sendQueue, *folders, *findmails, *configure, *stop; | 36 | QAction *compose, *sendQueue, *folders, *findmails, *configure; |
35 | QLabel *statusLabel; | 37 | QLabel *statusLabel; |
36 | 38 | ||
37 | }; | 39 | }; |
38 | 40 | ||
39 | #endif | 41 | #endif |