summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/mail.pro4
-rw-r--r--noncore/net/mail/opie-mail.control2
-rw-r--r--noncore/net/mail/viewmail.cpp43
-rw-r--r--noncore/net/mail/viewmail.h20
4 files changed, 62 insertions, 7 deletions
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro
index 6969644..7b00c58 100644
--- a/noncore/net/mail/mail.pro
+++ b/noncore/net/mail/mail.pro
@@ -58,5 +58,5 @@ CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX )
58contains( CONFTEST, y ){ 58contains( CONFTEST, y ){
59 LIBS += -lqpe -lopieui2 -lopiecore2 -lopiepim2 -lmailwrapper -liconv 59 LIBS += -lqpe -lopieui2 -lopiecore2 -lopiepim2 -lmailwrapper -liconv -lopiemm2
60}else{ 60}else{
61 LIBS += -lqpe -lopieui2 -lopiecore2 -lopiepim2 -lmailwrapper 61 LIBS += -lqpe -lopieui2 -lopiecore2 -lopiepim2 -lmailwrapper -lopiemm2
62} 62}
diff --git a/noncore/net/mail/opie-mail.control b/noncore/net/mail/opie-mail.control
index 98cb3a4..1bb588a 100644
--- a/noncore/net/mail/opie-mail.control
+++ b/noncore/net/mail/opie-mail.control
@@ -7,3 +7,3 @@ Architecture: arm
7Version: 0.6-$SUB_VERSION 7Version: 0.6-$SUB_VERSION
8Depends: task-opie-minimal, libopiecore2, libopieui2, libmailwrapper (>= 0.6) 8Depends: task-opie-minimal, libopiecore2, libopieui2, libopiemm2, libmailwrapper (>= 0.6)
9Description: Opie's mail and news client (POP3, IMAP and NNTP) 9Description: Opie's mail and news client (POP3, IMAP and NNTP)
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index 7267bcb..ce694d5 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -3,3 +3,2 @@
3 3
4/* OPIE */
5#include <libmailwrapper/settings.h> 4#include <libmailwrapper/settings.h>
@@ -8,4 +7,6 @@
8 7
8/* OPIE */
9#include <opie2/odebug.h> 9#include <opie2/odebug.h>
10#include <opie2/ofiledialog.h> 10#include <opie2/ofiledialog.h>
11#include <opie2/oimagescrollview.h>
11#include <qpe/config.h> 12#include <qpe/config.h>
@@ -20,2 +21,3 @@
20#include <qfile.h> 21#include <qfile.h>
22#include <qlayout.h>
21 23
@@ -215,2 +217,5 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
215 } 217 }
218 if (item->text(0).left(6)=="image/") {
219 menu->insertItem(tr("Display image preview"),2);
220 }
216 menu->insertItem( tr( "Save Attachment" ), 0 ); 221 menu->insertItem( tr( "Save Attachment" ), 0 );
@@ -244,2 +249,19 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
244 249
250 case 2:
251 {
252 QString tmpfile = "/tmp/opiemail-image";
253 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
254 if (content) {
255 QFile output(tmpfile);
256 output.open(IO_WriteOnly);
257 output.writeBlock(content->Content(),content->Length());
258 output.close();
259 delete content;
260 MailImageDlg iview("");
261 iview.setName(tmpfile);
262 QPEApplication::execDialog(&iview);
263 output.remove();
264 }
265 }
266 break;
245 case 1: 267 case 1:
@@ -480 +502,20 @@ void ViewMail::slotDeleteMail( )
480} 502}
503
504MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, WFlags f)
505 : Opie::Ui::ODialog(parent,name,modal,f)
506{
507 QVBoxLayout*dlglayout = new QVBoxLayout(this);
508 dlglayout->setSpacing(2);
509 dlglayout->setMargin(1);
510 m_imageview = new Opie::MM::OImageScrollView(this);
511 dlglayout->addWidget(m_imageview);
512}
513
514MailImageDlg::~MailImageDlg()
515{
516}
517
518void MailImageDlg::setName(const QString&fname)
519{
520 m_imageview->setImage(fname);
521}
diff --git a/noncore/net/mail/viewmail.h b/noncore/net/mail/viewmail.h
index b60fb8e..297836b 100644
--- a/noncore/net/mail/viewmail.h
+++ b/noncore/net/mail/viewmail.h
@@ -3,2 +3,7 @@
3 3
4#include "viewmailbase.h"
5#include <libmailwrapper/mailtypes.h>
6
7#include <opie2/odialog.h>
8
4#include <qlistview.h> 9#include <qlistview.h>
@@ -8,5 +13,3 @@
8 13
9#include "viewmailbase.h" 14namespace Opie { namespace MM { class OImageScrollView; } }
10#include <libmailwrapper/mailtypes.h>
11
12 15
@@ -71,2 +74,13 @@ private:
71 74
75class MailImageDlg:public Opie::Ui::ODialog
76{
77 Q_OBJECT
78public:
79 MailImageDlg(const QString&,QWidget *parent = 0, const char *name = 0, bool modal = true, WFlags f = 0);
80 ~MailImageDlg();
81 void setName(const QString&);
82protected:
83 Opie::MM::OImageScrollView*m_imageview;
84};
85
72#endif 86#endif