summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mail2/viewmailbase.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/mail2/viewmailbase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mail2/viewmailbase.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/noncore/unsupported/mail2/viewmailbase.cpp b/noncore/unsupported/mail2/viewmailbase.cpp
new file mode 100644
index 0000000..134e5cb
--- a/dev/null
+++ b/noncore/unsupported/mail2/viewmailbase.cpp
@@ -0,0 +1,65 @@
1#include <qtextbrowser.h>
2#include <qlistview.h>
3#include <qtoolbar.h>
4#include <qaction.h>
5#include <qlabel.h>
6#include <qvbox.h>
7
8#include <qpe/resource.h>
9
10#include "viewmailbase.h"
11#include "opendiag.h"
12
13ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl)
14 : QMainWindow(parent, name, fl)
15{
16 setCaption(tr("E-Mail by %1"));
17 setToolBarsMovable(false);
18
19 toolbar = new QToolBar(this);
20 toolbar->setHorizontalStretchable(true);
21 addToolBar(toolbar);
22
23 reply = new QAction(tr("Reply"), QIconSet(Resource::loadPixmap("mail/reply")), 0, 0, this);
24 reply->addTo(toolbar);
25
26 forward = new QAction(tr("Forward"), QIconSet(Resource::loadPixmap("mail/forward")), 0, 0, this);
27 forward->addTo(toolbar);
28
29 attachbutton = new QAction(tr("Attachments"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true);
30 attachbutton->addTo(toolbar);
31 connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool)));
32
33 deleteMail = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this);
34 deleteMail->addTo(toolbar);
35
36 QLabel *spacer = new QLabel(toolbar);
37 spacer->setBackgroundMode(QWidget::PaletteButton);
38 toolbar->setStretchableWidget(spacer);
39
40 QVBox *view = new QVBox(this);
41 setCentralWidget(view);
42
43 attachments = new QListView(view);
44 attachments->setMinimumHeight(90);
45 attachments->setMaximumHeight(90);
46 attachments->setAllColumnsShowFocus(true);
47 attachments->addColumn("Mime Type", 100);
48 attachments->addColumn("Filename", 100);
49 attachments->addColumn("Description", 100);
50 attachments->hide();
51
52 browser = new QTextBrowser(view);
53
54 openDiag = new OpenDiag(view);
55 openDiag->hide();
56
57}
58
59void ViewMailBase::slotChangeAttachview(bool state)
60{
61 if (state) attachments->show();
62 else attachments->hide();
63}
64
65