summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mail2/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/mail2/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/mail2/mainwindow.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/noncore/unsupported/mail2/mainwindow.cpp b/noncore/unsupported/mail2/mainwindow.cpp
new file mode 100644
index 0000000..4d15e23
--- a/dev/null
+++ b/noncore/unsupported/mail2/mainwindow.cpp
@@ -0,0 +1,65 @@
1#include <qprogressbar.h>
2#include <qmessagebox.h>
3#include <qaction.h>
4#include <qlabel.h>
5
6#include "folderwidget.h"
7#include "mainwindow.h"
8#include "configdiag.h"
9#include "configfile.h"
10#include "searchdiag.h"
11#include "mailtable.h"
12#include "composer.h"
13#include "viewmail.h"
14
15MainWindow::MainWindow(QWidget *parent, const char *name, WFlags fl)
16 : MainWindowBase(parent, name, fl)
17{
18 stop->setEnabled(false);
19
20 connect(folderView, SIGNAL(status(const QString &)), statusLabel, SLOT(setText(const QString &)));
21 connect(folderView, SIGNAL(folderSelected(Folder)), mailView, SLOT(setFolder(Folder)));
22
23 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(totalSteps(int)), statusProgress, SLOT(setTotalSteps(int)));
26 connect(mailView, SIGNAL(progress(int)), statusProgress, SLOT(setProgress(int)));
27 connect(mailView, SIGNAL(resetProgress()), statusProgress, SLOT(reset()));
28 connect(mailView, SIGNAL(stopEnabled(bool)), stop, SLOT(setEnabled(bool)));
29
30 connect(stop, SIGNAL(activated()), mailView, SLOT(stop()));
31
32 connect(compose, SIGNAL(activated()), SLOT(slotCompose()));
33 connect(findmails, SIGNAL(activated()), SLOT(slotSearch()));
34 connect(configure, SIGNAL(activated()), SLOT(slotConfigure()));
35}
36
37void MainWindow::slotCompose()
38{
39 Composer *composer = new Composer();
40 composer->showMaximized();
41 composer->show();
42}
43
44void MainWindow::slotSearch()
45{
46 SearchDiag *searchDiag = new SearchDiag(this, 0, true);
47 searchDiag->showMaximized();
48 searchDiag->show();
49}
50
51void MainWindow::slotConfigure()
52{
53 ConfigDiag *configDiag = new ConfigDiag(this, 0, true);
54 configDiag->showMaximized();
55 configDiag->show();
56
57 connect(configDiag, SIGNAL(changed()), folderView, SLOT(update()));
58}
59
60void MainWindow::mailClicked(IMAPResponseFETCH mail, IMAPHandler *handler)
61{
62 ViewMail *viewMail = new ViewMail(mail, handler);
63 viewMail->showMaximized();
64 viewMail->show();
65}