author | alwin <alwin> | 2005-03-06 00:09:33 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-06 00:09:33 (UTC) |
commit | 7e44f77d3749db2f43a1313d835a06684ecc1cd6 (patch) (unidiff) | |
tree | 13499da9a407e9b384db0f3abdd381fe3bb9b6f4 /noncore/net/mail/viewmailbase.cpp | |
parent | 0baadaef5a3da4fda08df75394475f577af58828 (diff) | |
download | opie-7e44f77d3749db2f43a1313d835a06684ecc1cd6.zip opie-7e44f77d3749db2f43a1313d835a06684ecc1cd6.tar.gz opie-7e44f77d3749db2f43a1313d835a06684ecc1cd6.tar.bz2 |
attached images may views inside the mailview and not as extra dialog
Diffstat (limited to 'noncore/net/mail/viewmailbase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/viewmailbase.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/noncore/net/mail/viewmailbase.cpp b/noncore/net/mail/viewmailbase.cpp index 49a0e6a..65ad0d6 100644 --- a/noncore/net/mail/viewmailbase.cpp +++ b/noncore/net/mail/viewmailbase.cpp | |||
@@ -1,85 +1,87 @@ | |||
1 | #include <qtextbrowser.h> | 1 | #include <qtextbrowser.h> |
2 | #include <qlistview.h> | 2 | #include <qlistview.h> |
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 <qlayout.h> | ||
8 | #include <qmenubar.h> | 9 | #include <qmenubar.h> |
9 | #include <qpe/resource.h> | 10 | #include <qpe/resource.h> |
10 | 11 | ||
11 | #include "viewmailbase.h" | 12 | #include "viewmailbase.h" |
12 | //#include "opendiag.h" | 13 | //#include "opendiag.h" |
13 | 14 | ||
14 | ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) | 15 | ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) |
15 | : QMainWindow(parent, name, fl) | 16 | : QMainWindow(parent, name, fl) |
16 | { | 17 | { |
17 | setCaption(tr("E-Mail view")); | 18 | setCaption(tr("E-Mail view")); |
18 | setToolBarsMovable(false); | 19 | setToolBarsMovable(false); |
19 | 20 | ||
20 | toolbar = new QToolBar(this); | 21 | toolbar = new QToolBar(this); |
21 | menubar = new QMenuBar( toolbar ); | 22 | menubar = new QMenuBar( toolbar ); |
22 | mailmenu = new QPopupMenu( menubar ); | 23 | mailmenu = new QPopupMenu( menubar ); |
23 | menubar->insertItem( tr( "Mail" ), mailmenu ); | 24 | menubar->insertItem( tr( "Mail" ), mailmenu ); |
24 | |||
25 | toolbar->setHorizontalStretchable(true); | 25 | toolbar->setHorizontalStretchable(true); |
26 | addToolBar(toolbar); | 26 | addToolBar(toolbar); |
27 | |||
28 | QLabel *spacer = new QLabel(toolbar); | 27 | QLabel *spacer = new QLabel(toolbar); |
29 | spacer->setBackgroundMode(QWidget::PaletteButton); | 28 | spacer->setBackgroundMode(QWidget::PaletteButton); |
30 | toolbar->setStretchableWidget(spacer); | 29 | toolbar->setStretchableWidget(spacer); |
31 | 30 | ||
32 | reply = new QAction(tr("Reply"), QIconSet(Resource::loadPixmap("mail/reply")), 0, 0, this); | 31 | reply = new QAction(tr("Reply"), QIconSet(Resource::loadPixmap("mail/reply")), 0, 0, this); |
33 | reply->addTo(toolbar); | 32 | reply->addTo(toolbar); |
34 | reply->addTo(mailmenu); | 33 | reply->addTo(mailmenu); |
35 | 34 | ||
36 | forward = new QAction(tr("Forward"), QIconSet(Resource::loadPixmap("mail/forward")), 0, 0, this); | 35 | forward = new QAction(tr("Forward"), QIconSet(Resource::loadPixmap("mail/forward")), 0, 0, this); |
37 | forward->addTo(toolbar); | 36 | forward->addTo(toolbar); |
38 | forward->addTo(mailmenu); | 37 | forward->addTo(mailmenu); |
39 | 38 | ||
40 | attachbutton = new QAction(tr("Attachments"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true); | 39 | attachbutton = new QAction(tr("Attachments"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true); |
41 | attachbutton->addTo(toolbar); | 40 | attachbutton->addTo(toolbar); |
42 | attachbutton->addTo(mailmenu); | 41 | attachbutton->addTo(mailmenu); |
43 | connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool))); | 42 | connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool))); |
44 | 43 | ||
45 | 44 | ||
46 | showHtml = new QAction( tr( "Show Html" ), QIconSet( Resource::loadPixmap( "mail/html" ) ), 0, 0, this, 0, true ); | 45 | showHtml = new QAction( tr( "Show Html" ), QIconSet( Resource::loadPixmap( "mail/html" ) ), 0, 0, this, 0, true ); |
47 | showHtml->addTo( toolbar ); | 46 | showHtml->addTo( toolbar ); |
48 | showHtml->addTo( mailmenu ); | 47 | showHtml->addTo( mailmenu ); |
48 | |||
49 | showPicsInline= new QAction(tr("Show image preview inline"), QIconSet(Resource::loadPixmap("pixmap")), 0, 0, this); | ||
50 | showPicsInline->setToggleAction(true); | ||
51 | showPicsInline->addTo(toolbar); | ||
52 | showPicsInline->addTo(mailmenu); | ||
49 | 53 | ||
50 | deleteMail = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("trash")), 0, 0, this); | 54 | deleteMail = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("trash")), 0, 0, this); |
51 | deleteMail->addTo(toolbar); | 55 | deleteMail->addTo(toolbar); |
52 | deleteMail->addTo(mailmenu); | 56 | deleteMail->addTo(mailmenu); |
53 | 57 | ||
54 | QVBox *view = new QVBox(this); | 58 | QVBox * view = new QVBox(this); |
59 | view->setSpacing(1); | ||
60 | view->setMargin(0); | ||
55 | setCentralWidget(view); | 61 | setCentralWidget(view); |
56 | 62 | ||
57 | attachments = new QListView(view); | 63 | attachments = new QListView(view); |
58 | attachments->setMinimumHeight(90); | 64 | attachments->setMinimumHeight(90); |
59 | attachments->setMaximumHeight(90); | 65 | attachments->setMaximumHeight(90); |
60 | attachments->setAllColumnsShowFocus(true); | 66 | attachments->setAllColumnsShowFocus(true); |
61 | attachments->addColumn("Mime Type", 60); | 67 | attachments->addColumn("Mime Type", 60); |
62 | attachments->addColumn(tr("Description"), 100); | 68 | attachments->addColumn(tr("Description"), 100); |
63 | attachments->addColumn(tr("Filename"), 80); | 69 | attachments->addColumn(tr("Filename"), 80); |
64 | attachments->addColumn(tr("Size"), 80); | 70 | attachments->addColumn(tr("Size"), 80); |
65 | attachments->setSorting(-1); | 71 | attachments->setSorting(-1); |
66 | attachments->hide(); | ||
67 | 72 | ||
68 | //header = new QTextBrowser(view); | ||
69 | browser = new QTextBrowser(view); | 73 | browser = new QTextBrowser(view); |
70 | 74 | adjustSize(); | |
71 | // openDiag = new OpenDiag(view); | 75 | attachments->hide(); |
72 | // openDiag->hide(); | ||
73 | |||
74 | } | 76 | } |
75 | 77 | ||
76 | void ViewMailBase::slotChangeAttachview(bool state) | 78 | void ViewMailBase::slotChangeAttachview(bool state) |
77 | { | 79 | { |
78 | if (state) attachments->show(); | 80 | if (state) attachments->show(); |
79 | else attachments->hide(); | 81 | else attachments->hide(); |
80 | } | 82 | } |
81 | 83 | ||
82 | void ViewMailBase::keyPressEvent ( QKeyEvent * e ) | 84 | void ViewMailBase::keyPressEvent ( QKeyEvent * e ) |
83 | { | 85 | { |
84 | if( e->key()==Qt::Key_Escape ) { | 86 | if( e->key()==Qt::Key_Escape ) { |
85 | close(); | 87 | close(); |