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