summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mail2/mainwindowbase.cpp
authorconber <conber>2002-06-15 09:46:14 (UTC)
committer conber <conber>2002-06-15 09:46:14 (UTC)
commit7f2eef29708380844922f34f59ba4e9beefbf7c3 (patch) (unidiff)
treef57125fbaabddecc35d6677f1b9e48a4594165d5 /noncore/unsupported/mail2/mainwindowbase.cpp
parent0acbdd392814589df303b6e50c79d9822e3db27a (diff)
downloadopie-7f2eef29708380844922f34f59ba4e9beefbf7c3.zip
opie-7f2eef29708380844922f34f59ba4e9beefbf7c3.tar.gz
opie-7f2eef29708380844922f34f59ba4e9beefbf7c3.tar.bz2
initial checkin
Diffstat (limited to 'noncore/unsupported/mail2/mainwindowbase.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/mail2/mainwindowbase.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/noncore/unsupported/mail2/mainwindowbase.cpp b/noncore/unsupported/mail2/mainwindowbase.cpp
new file mode 100644
index 0000000..4054af6
--- a/dev/null
+++ b/noncore/unsupported/mail2/mainwindowbase.cpp
@@ -0,0 +1,75 @@
1#include <qprogressbar.h>
2#include <qtoolbutton.h>
3#include <qpopupmenu.h>
4#include <qtoolbar.h>
5#include <qaction.h>
6#include <qheader.h>
7#include <qlabel.h>
8#include <qvbox.h>
9
10#include <qpe/resource.h>
11
12#include "mainwindowbase.h"
13#include "folderwidget.h"
14#include "mailtable.h"
15
16MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl)
17 : QMainWindow(parent, name, fl)
18{
19 setCaption(tr("E-Mail"));
20 setToolBarsMovable(false);
21
22 toolbar = new QToolBar(this);
23 addToolBar(toolbar);
24 toolbar->setHorizontalStretchable(true);
25
26 compose = new QAction(tr("Compose new mail"), QIconSet(Resource::loadPixmap("mail/newmail")), 0, 0, this);
27 compose->addTo(toolbar);
28
29 folders = new QAction(tr("Show/hide folders"), QIconSet(Resource::loadPixmap("mail/folder")), 0, 0, this, 0, true);
30 folders->addTo(toolbar);
31 connect(folders, SIGNAL(toggled(bool)), SLOT(slotFoldersToggled(bool)));
32
33 findmails = new QAction(tr("Search mails"), QIconSet(Resource::loadPixmap("mail/find")), 0, 0, this);
34 findmails->addTo(toolbar);
35
36 configure = new QAction(tr("Configuration"), QIconSet(Resource::loadPixmap("mail/configure")), 0, 0, this);
37 configure->addTo(toolbar);
38
39 QLabel *spacer = new QLabel(toolbar);
40 spacer->setBackgroundMode(QWidget::PaletteButton);
41 toolbar->setStretchableWidget(spacer);
42
43 stop = new QAction(tr("Abort"), QIconSet(Resource::loadPixmap("mail/abort")), 0, 0, this);
44 stop->addTo(toolbar);
45
46 QVBox *view = new QVBox(this);
47 setCentralWidget(view);
48
49 folderView = new FolderWidget(view);
50 folderView->setMinimumHeight(90);
51 folderView->setMaximumHeight(90);
52 folderView->hide();
53
54 mailView = new MailTable(view);
55 mailView->setMinimumHeight(50);
56
57 QHBox *status = new QHBox(view);
58
59 statusLabel = new QLabel(status);
60 QFont tmpFont = statusLabel->font();
61 tmpFont.setPixelSize(8);
62 statusLabel->setFont(tmpFont);
63
64 statusProgress = new QProgressBar(status);
65 statusProgress->setCenterIndicator(true);
66 statusProgress->setMaximumHeight(15);
67 statusProgress->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
68}
69
70void MainWindowBase::slotFoldersToggled(bool toggled)
71{
72 if (folderView->isHidden() && toggled) folderView->show();
73 if (!folderView->isHidden() && !toggled) folderView->hide();
74}
75