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) (side-by-side diff)
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) (ignore 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 @@
+#include <qprogressbar.h>
+#include <qtoolbutton.h>
+#include <qpopupmenu.h>
+#include <qtoolbar.h>
+#include <qaction.h>
+#include <qheader.h>
+#include <qlabel.h>
+#include <qvbox.h>
+
+#include <qpe/resource.h>
+
+#include "mainwindowbase.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 QToolBar(this);
+ addToolBar(toolbar);
+ toolbar->setHorizontalStretchable(true);
+
+ compose = new QAction(tr("Compose new mail"), QIconSet(Resource::loadPixmap("mail/newmail")), 0, 0, this);
+ compose->addTo(toolbar);
+
+ folders = new QAction(tr("Show/hide folders"), QIconSet(Resource::loadPixmap("mail/folder")), 0, 0, this, 0, true);
+ folders->addTo(toolbar);
+ connect(folders, SIGNAL(toggled(bool)), SLOT(slotFoldersToggled(bool)));
+
+ findmails = new QAction(tr("Search mails"), QIconSet(Resource::loadPixmap("mail/find")), 0, 0, this);
+ findmails->addTo(toolbar);
+
+ configure = new QAction(tr("Configuration"), QIconSet(Resource::loadPixmap("mail/configure")), 0, 0, this);
+ configure->addTo(toolbar);
+
+ QLabel *spacer = new QLabel(toolbar);
+ spacer->setBackgroundMode(QWidget::PaletteButton);
+ toolbar->setStretchableWidget(spacer);
+
+ stop = new QAction(tr("Abort"), QIconSet(Resource::loadPixmap("mail/abort")), 0, 0, this);
+ stop->addTo(toolbar);
+
+ 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);
+
+ statusProgress = new QProgressBar(status);
+ statusProgress->setCenterIndicator(true);
+ statusProgress->setMaximumHeight(15);
+ statusProgress->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
+}
+
+void MainWindowBase::slotFoldersToggled(bool toggled)
+{
+ if (folderView->isHidden() && toggled) folderView->show();
+ if (!folderView->isHidden() && !toggled) folderView->hide();
+}
+