summaryrefslogtreecommitdiffabout
path: root/kmicromail/viewmail.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/viewmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/viewmail.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index 6d88cad..767a369 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -204,4 +204,22 @@ void ViewMail::setBody(const RecBodyP&body )
+void ViewMail::slotViewSource()
+{
+
+ if ( !sourceOn ) {
+ sourceOn = true;
+ viewSource->setText(i18n("View Body Text"));
+ encodedString*st = 0;
+ st = m_recMail->Wrapper()->fetchRawBody(m_recMail);
+ if ( st ) {
+ QString source = QString::fromUtf8( st->Content(), st->Length());
+ browser->setText( source );
+ delete st;
+ }
+ } else
+ setText();
+
+
+}
void ViewMail::slotShowHtml( bool state )
{
@@ -321,5 +339,5 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
m_gotBody = false;
deleted = false;
-
+ sourceOn = false;
connect( reply, SIGNAL(activated()), SLOT(slotReply()));
connect( forward, SIGNAL(activated()), SLOT(slotForward()));
@@ -328,4 +346,6 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
connect( closeMail, SIGNAL( activated() ), SLOT( close() ) );
connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) );
+ connect( viewSource, SIGNAL( activated() ), SLOT( slotViewSource() ) );
+ connect( downloadMail, SIGNAL( activated() ), SIGNAL( signalDownloadMail() ) );
attachments->setEnabled(m_gotBody);
@@ -347,4 +367,6 @@ void ViewMail::setText()
{
+ viewSource->setText(i18n("View Source"));
+ sourceOn = false;
QString toString;
QString ccString;
@@ -533,2 +555,3 @@ void MailImageDlg::setName(const QString&fname)
// m_imageview->setImage(fname);
}
+