summaryrefslogtreecommitdiffabout
path: root/kmicromail/viewmail.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/viewmail.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/viewmail.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index 60c764c..6d88cad 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -413,121 +413,122 @@ void ViewMail::exec()
}
QString ViewMail::deHtml(const QString &string)
{
QString string_ = string;
string_.replace(QRegExp("&"), "&");
string_.replace(QRegExp("<"), "&lt;");
string_.replace(QRegExp(">"), "&gt;");
string_.replace(QRegExp("\\n"), "<br>");
return string_;
}
void ViewMail::slotReply()
{
if (!m_gotBody)
{
QMessageBox::information(this, i18n("Error"), i18n("<p>The mail body is not yet downloaded, so you cannot reply yet."), i18n("Ok"));
return;
}
QString rtext;
rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
.arg( m_mail[0] )
.arg( m_mail[3] );
QString text = m_mail[2];
QStringList lines = QStringList::split(QRegExp("\\n"), text);
QStringList::Iterator it;
for (it = lines.begin(); it != lines.end(); it++)
{
rtext += "> " + *it + "\n";
}
rtext += "\n";
QString prefix;
if ( m_mail[1].find(QRegExp("^Re: .*$")) != -1) prefix = "";
else prefix = "Re: "; // no i18n on purpose
Settings *settings = new Settings();
ComposeMail composer( settings ,this, 0, true);
if (m_recMail->Replyto().isEmpty()) {
composer.setTo(m_recMail->getFrom());
} else {
composer.setTo(m_recMail->Replyto());
}
composer.setSubject( prefix + m_mail[1] );
composer.setMessage( rtext );
composer.setInReplyTo(m_recMail->Msgid());
composer.setCharset( m_body->getCharset() );
if ( QDialog::Accepted == KApplication::execDialog( &composer ) )
{
m_recMail->Wrapper()->answeredMail(m_recMail);
}
delete settings;
}
void ViewMail::slotForward()
{
if (!m_gotBody)
{
QMessageBox::information(this, i18n("Error"), i18n("<p>The mail body is not yet downloaded, so you cannot forward yet."), i18n("Ok"));
return;
}
QString ftext;
ftext += QString("\n----- Forwarded message from %1 -----\n\n")
.arg( m_mail[0] );
if (!m_mail[3].isNull())
ftext += QString("Date: %1\n")
.arg( m_mail[3] );
if (!m_mail[0].isNull())
ftext += QString("From: %1\n")
.arg( m_mail[0] );
if (!m_mail[1].isNull())
ftext += QString("Subject: %1\n")
.arg( m_mail[1] );
ftext += QString("\n%1\n")
.arg( m_mail[2]);
ftext += QString("----- End forwarded message -----\n");
Settings *settings = new Settings();
ComposeMail composer( settings ,this, 0, true);
composer.setSubject( "Fwd: " + m_mail[1] );
composer.setMessage( ftext );
if ( QDialog::Accepted == KApplication::execDialog( &composer ))
{
}
}
void ViewMail::slotDeleteMail( )
{
if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
{
- m_recMail->Wrapper()->deleteMail( m_recMail );
- hide();
+ emit deleteAndDisplayNextMail( this);
+ //m_recMail->Wrapper()->deleteMail( m_recMail );
+ //hide();
deleted = true;
}
}
MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, WFlags f)
: QDialog(parent,name,modal)
{
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)
{
qDebug("viewmail.cpp: MailImageDlg::setName Pending");
// m_imageview->setImage(fname);
}