Diffstat (limited to 'noncore/net/mail/viewmailbase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/viewmailbase.cpp | 81 |
1 files changed, 41 insertions, 40 deletions
diff --git a/noncore/net/mail/viewmailbase.cpp b/noncore/net/mail/viewmailbase.cpp index cbb98cc..49a0e6a 100644 --- a/noncore/net/mail/viewmailbase.cpp +++ b/noncore/net/mail/viewmailbase.cpp | |||
@@ -3,87 +3,88 @@ | |||
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qlabel.h> | 4 | #include <qlabel.h> |
5 | #include <qvbox.h> | 5 | #include <qvbox.h> |
6 | 6 | ||
7 | #include <qtoolbar.h> | 7 | #include <qtoolbar.h> |
8 | #include <qmenubar.h> | 8 | #include <qmenubar.h> |
9 | #include <qpe/resource.h> | 9 | #include <qpe/resource.h> |
10 | 10 | ||
11 | #include "viewmailbase.h" | 11 | #include "viewmailbase.h" |
12 | //#include "opendiag.h" | 12 | //#include "opendiag.h" |
13 | 13 | ||
14 | ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) | 14 | ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) |
15 | : QMainWindow(parent, name, fl) | 15 | : QMainWindow(parent, name, fl) |
16 | { | 16 | { |
17 | setCaption(tr("E-Mail by %1")); | 17 | setCaption(tr("E-Mail view")); |
18 | setToolBarsMovable(false); | 18 | setToolBarsMovable(false); |
19 | 19 | ||
20 | toolbar = new QToolBar(this); | 20 | toolbar = new QToolBar(this); |
21 | menubar = new QMenuBar( toolbar ); | 21 | menubar = new QMenuBar( toolbar ); |
22 | mailmenu = new QPopupMenu( menubar ); | 22 | mailmenu = new QPopupMenu( menubar ); |
23 | menubar->insertItem( tr( "Mail" ), mailmenu ); | 23 | menubar->insertItem( tr( "Mail" ), mailmenu ); |
24 | 24 | ||
25 | toolbar->setHorizontalStretchable(true); | 25 | toolbar->setHorizontalStretchable(true); |
26 | addToolBar(toolbar); | 26 | addToolBar(toolbar); |
27 | 27 | ||
28 | QLabel *spacer = new QLabel(toolbar); | 28 | QLabel *spacer = new QLabel(toolbar); |
29 | spacer->setBackgroundMode(QWidget::PaletteButton); | 29 | spacer->setBackgroundMode(QWidget::PaletteButton); |
30 | toolbar->setStretchableWidget(spacer); | 30 | toolbar->setStretchableWidget(spacer); |
31 | 31 | ||
32 | reply = new QAction(tr("Reply"), QIconSet(Resource::loadPixmap("mail/reply")), 0, 0, this); | 32 | reply = new QAction(tr("Reply"), QIconSet(Resource::loadPixmap("mail/reply")), 0, 0, this); |
33 | reply->addTo(toolbar); | 33 | reply->addTo(toolbar); |
34 | reply->addTo(mailmenu); | 34 | reply->addTo(mailmenu); |
35 | 35 | ||
36 | forward = new QAction(tr("Forward"), QIconSet(Resource::loadPixmap("mail/forward")), 0, 0, this); | 36 | forward = new QAction(tr("Forward"), QIconSet(Resource::loadPixmap("mail/forward")), 0, 0, this); |
37 | forward->addTo(toolbar); | 37 | forward->addTo(toolbar); |
38 | forward->addTo(mailmenu); | 38 | forward->addTo(mailmenu); |
39 | 39 | ||
40 | attachbutton = new QAction(tr("Attachments"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true); | 40 | attachbutton = new QAction(tr("Attachments"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true); |
41 | attachbutton->addTo(toolbar); | 41 | attachbutton->addTo(toolbar); |
42 | attachbutton->addTo(mailmenu); | 42 | attachbutton->addTo(mailmenu); |
43 | connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool))); | 43 | connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool))); |
44 | 44 | ||
45 | 45 | ||
46 | showHtml = new QAction( tr( "Show Html" ), QIconSet( Resource::loadPixmap( "mail/html" ) ), 0, 0, this, 0, true ); | 46 | showHtml = new QAction( tr( "Show Html" ), QIconSet( Resource::loadPixmap( "mail/html" ) ), 0, 0, this, 0, true ); |
47 | showHtml->addTo( toolbar ); | 47 | showHtml->addTo( toolbar ); |
48 | showHtml->addTo( mailmenu ); | 48 | showHtml->addTo( mailmenu ); |
49 | 49 | ||
50 | deleteMail = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("trash")), 0, 0, this); | 50 | deleteMail = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("trash")), 0, 0, this); |
51 | deleteMail->addTo(toolbar); | 51 | deleteMail->addTo(toolbar); |
52 | deleteMail->addTo(mailmenu); | 52 | deleteMail->addTo(mailmenu); |
53 | 53 | ||
54 | QVBox *view = new QVBox(this); | 54 | QVBox *view = new QVBox(this); |
55 | setCentralWidget(view); | 55 | setCentralWidget(view); |
56 | 56 | ||
57 | attachments = new QListView(view); | 57 | attachments = new QListView(view); |
58 | attachments->setMinimumHeight(90); | 58 | attachments->setMinimumHeight(90); |
59 | attachments->setMaximumHeight(90); | 59 | attachments->setMaximumHeight(90); |
60 | attachments->setAllColumnsShowFocus(true); | 60 | attachments->setAllColumnsShowFocus(true); |
61 | attachments->addColumn("Mime Type", 60); | 61 | attachments->addColumn("Mime Type", 60); |
62 | attachments->addColumn(tr("Description"), 100); | 62 | attachments->addColumn(tr("Description"), 100); |
63 | attachments->addColumn(tr("Filename"), 80); | 63 | attachments->addColumn(tr("Filename"), 80); |
64 | attachments->addColumn(tr("Size"), 80); | 64 | attachments->addColumn(tr("Size"), 80); |
65 | attachments->setSorting(-1); | 65 | attachments->setSorting(-1); |
66 | attachments->hide(); | 66 | attachments->hide(); |
67 | 67 | ||
68 | browser = new QTextBrowser(view); | 68 | //header = new QTextBrowser(view); |
69 | browser = new QTextBrowser(view); | ||
69 | 70 | ||
70 | //openDiag = new OpenDiag(view); | 71 | // openDiag = new OpenDiag(view); |
71 | //openDiag->hide(); | 72 | // openDiag->hide(); |
72 | 73 | ||
73 | } | 74 | } |
74 | 75 | ||
75 | void ViewMailBase::slotChangeAttachview(bool state) | 76 | void ViewMailBase::slotChangeAttachview(bool state) |
76 | { | 77 | { |
77 | if (state) attachments->show(); | 78 | if (state) attachments->show(); |
78 | else attachments->hide(); | 79 | else attachments->hide(); |
79 | } | 80 | } |
80 | 81 | ||
81 | void ViewMailBase::keyPressEvent ( QKeyEvent * e ) | 82 | void ViewMailBase::keyPressEvent ( QKeyEvent * e ) |
82 | { | 83 | { |
83 | if( e->key()==Qt::Key_Escape ) { | 84 | if( e->key()==Qt::Key_Escape ) { |
84 | close(); | 85 | close(); |
85 | e->accept(); | 86 | e->accept(); |
86 | return; | 87 | return; |
87 | } | 88 | } |
88 | QWidget::keyPressEvent(e); | 89 | QWidget::keyPressEvent(e); |
89 | } | 90 | } |