-rw-r--r-- | kmicromail/viewmail.cpp | 25 |
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 | |||
@@ -202,8 +202,26 @@ void ViewMail::setBody(const RecBodyP&body ) | |||
202 | } | 202 | } |
203 | } | 203 | } |
204 | 204 | ||
205 | 205 | ||
206 | void ViewMail::slotViewSource() | ||
207 | { | ||
208 | |||
209 | if ( !sourceOn ) { | ||
210 | sourceOn = true; | ||
211 | viewSource->setText(i18n("View Body Text")); | ||
212 | encodedString*st = 0; | ||
213 | st = m_recMail->Wrapper()->fetchRawBody(m_recMail); | ||
214 | if ( st ) { | ||
215 | QString source = QString::fromUtf8( st->Content(), st->Length()); | ||
216 | browser->setText( source ); | ||
217 | delete st; | ||
218 | } | ||
219 | } else | ||
220 | setText(); | ||
221 | |||
222 | |||
223 | } | ||
206 | void ViewMail::slotShowHtml( bool state ) | 224 | void ViewMail::slotShowHtml( bool state ) |
207 | { | 225 | { |
208 | m_showHtml = state; | 226 | m_showHtml = state; |
209 | setText(); | 227 | setText(); |
@@ -319,15 +337,17 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | |||
319 | : ViewMailBase(parent, name, fl), _inLoop(false) | 337 | : ViewMailBase(parent, name, fl), _inLoop(false) |
320 | { | 338 | { |
321 | m_gotBody = false; | 339 | m_gotBody = false; |
322 | deleted = false; | 340 | deleted = false; |
323 | 341 | sourceOn = false; | |
324 | connect( reply, SIGNAL(activated()), SLOT(slotReply())); | 342 | connect( reply, SIGNAL(activated()), SLOT(slotReply())); |
325 | connect( forward, SIGNAL(activated()), SLOT(slotForward())); | 343 | connect( forward, SIGNAL(activated()), SLOT(slotForward())); |
326 | connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) ); | 344 | connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) ); |
327 | connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); | 345 | connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); |
328 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); | 346 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); |
329 | connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) ); | 347 | connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) ); |
348 | connect( viewSource, SIGNAL( activated() ), SLOT( slotViewSource() ) ); | ||
349 | connect( downloadMail, SIGNAL( activated() ), SIGNAL( signalDownloadMail() ) ); | ||
330 | 350 | ||
331 | attachments->setEnabled(m_gotBody); | 351 | attachments->setEnabled(m_gotBody); |
332 | connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); | 352 | connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); |
333 | 353 | ||
@@ -345,8 +365,10 @@ void ViewMail::readConfig() | |||
345 | 365 | ||
346 | void ViewMail::setText() | 366 | void ViewMail::setText() |
347 | { | 367 | { |
348 | 368 | ||
369 | viewSource->setText(i18n("View Source")); | ||
370 | sourceOn = false; | ||
349 | QString toString; | 371 | QString toString; |
350 | QString ccString; | 372 | QString ccString; |
351 | QString bccString; | 373 | QString bccString; |
352 | 374 | ||
@@ -531,4 +553,5 @@ void MailImageDlg::setName(const QString&fname) | |||
531 | { | 553 | { |
532 | qDebug("viewmail.cpp: MailImageDlg::setName Pending"); | 554 | qDebug("viewmail.cpp: MailImageDlg::setName Pending"); |
533 | // m_imageview->setImage(fname); | 555 | // m_imageview->setImage(fname); |
534 | } | 556 | } |
557 | |||