summaryrefslogtreecommitdiffabout
path: root/kmicromail/viewmailbase.cpp
Unidiff
Diffstat (limited to 'kmicromail/viewmailbase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/viewmailbase.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/kmicromail/viewmailbase.cpp b/kmicromail/viewmailbase.cpp
index 9365c23..3a41ba0 100644
--- a/kmicromail/viewmailbase.cpp
+++ b/kmicromail/viewmailbase.cpp
@@ -1,112 +1,106 @@
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 viewSource = new QAction(i18n("View Source"), 0, 0, this); 31 viewSource = new QAction(i18n("View Source"), 0, 0, this);
32 viewSource->addTo(mailmenu); 32 viewSource->addTo(mailmenu);
33 33
34 downloadMail= new QAction(i18n("Download Mail"),SmallIcon("add"), 0, 0, this); 34 downloadMail= new QAction(i18n("Download Mail"),SmallIcon("add"), 0, 0, this);
35 downloadMail->addTo(toolbar); 35 downloadMail->addTo(toolbar);
36 downloadMail->addTo(mailmenu); 36 downloadMail->addTo(mailmenu);
37 37
38 38
39 reply = new QAction(i18n("Reply"),SmallIcon("reply"), 0, 0, this); 39 reply = new QAction(i18n("Reply"),SmallIcon("reply"), 0, 0, this);
40 reply->addTo(toolbar); 40 reply->addTo(toolbar);
41 reply->addTo(mailmenu); 41 reply->addTo(mailmenu);
42 42
43 forward = new QAction(i18n("Forward"),SmallIcon("forward"), 0, 0, this); 43 forward = new QAction(i18n("Forward"),SmallIcon("forward"), 0, 0, this);
44 forward->addTo(toolbar); 44 forward->addTo(toolbar);
45 forward->addTo(mailmenu); 45 forward->addTo(mailmenu);
46 46
47 attachbutton = new QAction(i18n("Attachments"),SmallIcon("attach"), 0, 0, this, 0, true); 47 attachbutton = new QAction(i18n("Attachments"),SmallIcon("attach"), 0, 0, this, 0, true);
48 attachbutton->addTo(toolbar); 48 attachbutton->addTo(toolbar);
49 attachbutton->addTo(mailmenu); 49 attachbutton->addTo(mailmenu);
50 connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool))); 50 connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool)));
51 51
52 52 showHtml = new QAction( i18n( "Show Html" ), SmallIcon( "html" ), 0, 0, this, 0, true );
53 showHtml = new QAction( i18n( "Show Html" ), SmallIcon( "html" ), 0, 0, this, 0, true ); 53 showHtml->addTo( toolbar );
54 showHtml->addTo( toolbar ); 54 showHtml->addTo( mailmenu );
55 showHtml->addTo( mailmenu );
56 55
57 deleteMail = new QAction(i18n("Delete Mail"),SmallIcon("trash"), 0, 0, this); 56 deleteMail = new QAction(i18n("Delete Mail"),SmallIcon("trash"), 0, 0, this);
58 deleteMail->addTo(toolbar); 57 deleteMail->addTo(toolbar);
59 deleteMail->addTo(mailmenu); 58 deleteMail->addTo(mailmenu);
60 59
61
62
63 nextMail = new QAction(i18n("Show next mail"),SmallIcon("enter"), 0, 0, this); 60 nextMail = new QAction(i18n("Show next mail"),SmallIcon("enter"), 0, 0, this);
64 QLabel *spacer = new QLabel(toolbar); 61 QLabel *spacer = new QLabel(toolbar);
65 nextMail->addTo(toolbar); 62 nextMail->addTo(toolbar);
66 nextMail->addTo(mailmenu); 63 nextMail->addTo(mailmenu);
67 64
68
69
70
71 closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); 65 closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this);
72 //QLabel *spacer = new QLabel(toolbar); 66 //QLabel *spacer = new QLabel(toolbar);
73 spacer->setBackgroundMode(QWidget::PaletteButton); 67 spacer->setBackgroundMode(QWidget::PaletteButton);
74 toolbar->setStretchableWidget(spacer); 68 toolbar->setStretchableWidget(spacer);
75 closeMail->addTo(toolbar); 69 closeMail->addTo(toolbar);
76 closeMail->addTo(mailmenu); 70 closeMail->addTo(mailmenu);
77 QVBox *view = new QVBox(this); 71 QVBox *view = new QVBox(this);
78 setCentralWidget(view); 72 setCentralWidget(view);
79 73
80 attachments = new QListView(view); 74 attachments = new QListView(view);
81 attachments->setMinimumHeight(90); 75 attachments->setMinimumHeight(90);
82 attachments->setMaximumHeight(90); 76 attachments->setMaximumHeight(90);
83 attachments->setAllColumnsShowFocus(true); 77 attachments->setAllColumnsShowFocus(true);
84 attachments->addColumn("Mime Type", 60); 78 attachments->addColumn("Mime Type", 60);
85 attachments->addColumn(i18n("Description"), 100); 79 attachments->addColumn(i18n("Description"), 100);
86 attachments->addColumn(i18n("Filename"), 80); 80 attachments->addColumn(i18n("Filename"), 80);
87 attachments->addColumn(i18n("Size"), 80); 81 attachments->addColumn(i18n("Size"), 80);
88 attachments->setSorting(-1); 82 attachments->setSorting(-1);
89 attachments->hide(); 83 attachments->hide();
90 84
91 browser = new QTextBrowser(view); 85 browser = new QTextBrowser(view);
92 86
93 //openDiag = new OpenDiag(view); 87 //openDiag = new OpenDiag(view);
94 //openDiag->hide(); 88 //openDiag->hide();
95 89
96} 90}
97 91
98void ViewMailBase::slotChangeAttachview(bool state) 92void ViewMailBase::slotChangeAttachview(bool state)
99{ 93{
100 if (state) attachments->show(); 94 if (state) attachments->show();
101 else attachments->hide(); 95 else attachments->hide();
102} 96}
103 97
104void ViewMailBase::keyPressEvent ( QKeyEvent * e ) 98void ViewMailBase::keyPressEvent ( QKeyEvent * e )
105{ 99{
106 if( e->key()==Qt::Key_Escape ) { 100 if( e->key()==Qt::Key_Escape ) {
107 close(); 101 close();
108 e->accept(); 102 e->accept();
109 return; 103 return;
110 } 104 }
111 QWidget::keyPressEvent(e); 105 QWidget::keyPressEvent(e);
112} 106}