summaryrefslogtreecommitdiff
authoralwin <alwin>2004-04-14 22:36:20 (UTC)
committer alwin <alwin>2004-04-14 22:36:20 (UTC)
commit6439d07d42e10b0804a3a31fdfd6645b36d2fad5 (patch) (side-by-side diff)
tree07ff558875de1ebe8235badaa3cab4205fa82089
parent1b8fac62de40773977e9b3e800cf22cc42603ced (diff)
downloadopie-6439d07d42e10b0804a3a31fdfd6645b36d2fad5.zip
opie-6439d07d42e10b0804a3a31fdfd6645b36d2fad5.tar.gz
opie-6439d07d42e10b0804a3a31fdfd6645b36d2fad5.tar.bz2
opiemail now displays images send with mail
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 )
contains( CONFTEST, y ){
- LIBS += -lqpe -lopieui2 -lopiecore2 -lopiepim2 -lmailwrapper -liconv
+ LIBS += -lqpe -lopieui2 -lopiecore2 -lopiepim2 -lmailwrapper -liconv -lopiemm2
}else{
- LIBS += -lqpe -lopieui2 -lopiecore2 -lopiepim2 -lmailwrapper
+ LIBS += -lqpe -lopieui2 -lopiecore2 -lopiepim2 -lmailwrapper -lopiemm2
}
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
Version: 0.6-$SUB_VERSION
-Depends: task-opie-minimal, libopiecore2, libopieui2, libmailwrapper (>= 0.6)
+Depends: task-opie-minimal, libopiecore2, libopieui2, libopiemm2, libmailwrapper (>= 0.6)
Description: 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 @@
-/* OPIE */
#include <libmailwrapper/settings.h>
@@ -8,4 +7,6 @@
+/* OPIE */
#include <opie2/odebug.h>
#include <opie2/ofiledialog.h>
+#include <opie2/oimagescrollview.h>
#include <qpe/config.h>
@@ -20,2 +21,3 @@
#include <qfile.h>
+#include <qlayout.h>
@@ -215,2 +217,5 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
}
+ if (item->text(0).left(6)=="image/") {
+ menu->insertItem(tr("Display image preview"),2);
+ }
menu->insertItem( tr( "Save Attachment" ), 0 );
@@ -244,2 +249,19 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
+ case 2:
+ {
+ QString tmpfile = "/tmp/opiemail-image";
+ encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
+ if (content) {
+ QFile output(tmpfile);
+ output.open(IO_WriteOnly);
+ output.writeBlock(content->Content(),content->Length());
+ output.close();
+ delete content;
+ MailImageDlg iview("");
+ iview.setName(tmpfile);
+ QPEApplication::execDialog(&iview);
+ output.remove();
+ }
+ }
+ break;
case 1:
@@ -480 +502,20 @@ void ViewMail::slotDeleteMail( )
}
+
+MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, WFlags f)
+ : Opie::Ui::ODialog(parent,name,modal,f)
+{
+ QVBoxLayout*dlglayout = new QVBoxLayout(this);
+ dlglayout->setSpacing(2);
+ dlglayout->setMargin(1);
+ m_imageview = new Opie::MM::OImageScrollView(this);
+ dlglayout->addWidget(m_imageview);
+}
+
+MailImageDlg::~MailImageDlg()
+{
+}
+
+void MailImageDlg::setName(const QString&fname)
+{
+ m_imageview->setImage(fname);
+}
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 @@
+#include "viewmailbase.h"
+#include <libmailwrapper/mailtypes.h>
+
+#include <opie2/odialog.h>
+
#include <qlistview.h>
@@ -8,5 +13,3 @@
-#include "viewmailbase.h"
-#include <libmailwrapper/mailtypes.h>
-
+namespace Opie { namespace MM { class OImageScrollView; } }
@@ -71,2 +74,13 @@ private:
+class MailImageDlg:public Opie::Ui::ODialog
+{
+ Q_OBJECT
+public:
+ MailImageDlg(const QString&,QWidget *parent = 0, const char *name = 0, bool modal = true, WFlags f = 0);
+ ~MailImageDlg();
+ void setName(const QString&);
+protected:
+ Opie::MM::OImageScrollView*m_imageview;
+};
+
#endif