summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt2
-rw-r--r--kmicromail/koprefs.cpp1
-rw-r--r--kmicromail/koprefs.h2
-rw-r--r--kmicromail/koprefsdialog.cpp3
-rw-r--r--kmicromail/mailistviewitem.cpp49
-rw-r--r--kmicromail/mainwindow.cpp4
-rw-r--r--kmicromail/opiemail.cpp17
-rw-r--r--kmicromail/opiemail.h3
-rw-r--r--kmicromail/viewmail.cpp25
-rw-r--r--kmicromail/viewmail.h4
-rw-r--r--kmicromail/viewmailbase.cpp8
-rw-r--r--kmicromail/viewmailbase.h2
12 files changed, 68 insertions, 52 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index cbed872..2516b2a 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -21,8 +21,10 @@ Fixed the problem, that the state flag of imap mails was ignored.
Now mails with "FLAG_SEEN" on the imap server get no icon in the list view
to idecate that they are already seen.
Fixed the problem that the body of some mails was not displayed in the
mail viewer when fetching them from the imap server directly to read them.
+Made it (configurable) possible to show the "To:" field in the list view.
+Added to the mail viewer the option "View Source" to make it possible to see the raw mail data.
********** VERSION 1.9.19 ************
diff --git a/kmicromail/koprefs.cpp b/kmicromail/koprefs.cpp
index 342bbf3..2bae5f6 100644
--- a/kmicromail/koprefs.cpp
+++ b/kmicromail/koprefs.cpp
@@ -61,8 +61,9 @@ KOPrefs::KOPrefs() :
addItemString("SenderName",&mName,i18n ("Please set at") );
addItemString("SenderEmail",&mEmail,i18n ("Settings@General TAB") );
addItemBool("ViewMailAsHtml",&mViewAsHtml,false);
addItemBool("SendMailLater",&mSendLater,true);
+ addItemBool("ShowToField",&mShowToField,false);
addItemBool("UseKapi",&mUseKapi,false);
addItemInt("CurrentCodec",&mCurrentCodec,0);
KPrefs::setCurrentGroup("Fonts");
diff --git a/kmicromail/koprefs.h b/kmicromail/koprefs.h
index 91f3fa3..f2c4fbb 100644
--- a/kmicromail/koprefs.h
+++ b/kmicromail/koprefs.h
@@ -71,9 +71,9 @@ class KOPrefs : public KPimPrefs
QString mSendCodec;
QString mEmail;
QString mCurrentCodeName;
int mCurrentCodec;
- bool mSendLater, mViewAsHtml, mUseKapi, isDirty;
+ bool mSendLater, mViewAsHtml, mUseKapi, isDirty, mShowToField;
private:
};
diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp
index 13d6681..5c8a5a9 100644
--- a/kmicromail/koprefsdialog.cpp
+++ b/kmicromail/koprefsdialog.cpp
@@ -146,8 +146,11 @@ void KOPrefsDialog::setupMailTab()
ttt = addWidBool(i18n("Send mails later"),
&(KOPrefs::instance()->mSendLater),topFrame);
topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1);
+ ttt = addWidBool(i18n("Show \"To\" field in list view"),
+ &(KOPrefs::instance()->mShowToField),topFrame);
+ topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1);
/*
mCodecEdit = new QLineEdit(topFrame);
topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1);
topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1);
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp
index 484a635..ffb835c 100644
--- a/kmicromail/mailistviewitem.cpp
+++ b/kmicromail/mailistviewitem.cpp
@@ -2,8 +2,9 @@
#include "mailistviewitem.h"
#include <libmailwrapper/abstractmail.h>
#include <qtextstream.h>
#include <kiconloader.h>
+#include "koprefs.h"
//#include <qpe/resource.h>
MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item )
:QListViewItem(parent,item),mail_data()
@@ -56,56 +57,12 @@ void MailListViewItem::showEntry()
mKeyMap.insert(3, "M" +fsort );
}
setText(1,mail_data->getSubject());
setText(2,mail_data->getFrom());
-#if 0
- QString date = mail_data->getDate();
-
- int kom = date.find( ",")+2;
- if ( kom == 1 )
- kom = 0;
- if ( date.mid(kom,1) == " ")
- ++kom;
- if ( date.mid(kom+1,1) == " " )
- date = "0" + date.mid( kom );
- else if ( kom )
- date = date.mid( kom );
- if ( kom || date.mid(2,1 ) == " ") {
- QString mon = date.mid(3,3);
- QString so = 00;
- if ( mon == "Jan" )
- so = "01";
- else if ( mon == "Feb" )
- so = "02";
- else if ( mon == "Mar" )
- so = "03";
- else if ( mon == "Apr" )
- so = "04";
- else if ( mon == "May" )
- so = "05";
- else if ( mon == "Jun" )
- so = "06";
- else if ( mon == "Jul" )
- so = "07";
- else if ( mon == "Aug" )
- so = "08";
- else if ( mon == "Sep" )
- so = "09";
- else if ( mon == "Oct" )
- so = "10";
- else if ( mon == "Nov" )
- so = "11";
- else if ( mon == "Dec" )
- so = "12";
- date = date.mid(7,4)+so+date.left(2)+date.mid(12,14);
- }
- //qDebug("insert Date %s ", date.latin1());
- // if ( date.left(1) != "1" || date.left(1) != "2" )
- // date = date.mid(5);
- mKeyMap.insert(4,date);
-#endif
mKeyMap.insert(4,mail_data->getIsoDate());
setText(4,mail_data->getDate());
+ if ( KOPrefs::instance()->mShowToField )
+ setText(5,mail_data->To()[0]);
}
void MailListViewItem::storeData(const RecMailP&data)
{
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index 1dc374b..875ab77 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -132,8 +132,10 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
mailView->addColumn( i18n( "Subject" ),QListView::Manual );
mailView->addColumn( i18n( "Sender" ),QListView::Manual );
mailView->addColumn( i18n( "Size" ),QListView::Manual);
mailView->addColumn( i18n( "Date" ),QListView::Manual);
+ if ( KOPrefs::instance()->mShowToField )
+ mailView->addColumn( i18n( "To" ),QListView::Manual);
mailView->setAllColumnsShowFocus(true);
//mailView->setSorting(-1);
mailView->setRootIsDecorated( false );
statusWidget = new StatusWidget( wrapperBox );
@@ -302,8 +304,10 @@ void MainWindow::slotAdjustColumns()
mailView->setColumnWidth( 1, 100 );
mailView->setColumnWidth( 2, 100 );
mailView->setColumnWidth( 3, 50 );
mailView->setColumnWidth( 4, 120 );
+ if ( KOPrefs::instance()->mShowToField )
+ mailView->setColumnWidth( 5, 100 );
}
void MainWindow::slotEditSettings()
{
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 915b3e8..6e54bf4 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -1,7 +1,11 @@
// CHANGED 2004-09-31 Lutz Rogowski
// CHANGED 2004-08-06 Lutz Rogowski
+
+#define protected public
+#include <qwidget.h>
+#undef protected
#include "koprefsdialog.h"
#include <kapplication.h>
#include <libkdepim/externalapphandler.h>
#include <libkdepim/kpimglobalprefs.h>
@@ -21,8 +25,9 @@
#include <qmessagebox.h>
#include <qtimer.h>
#include <qcursor.h>
+#include <qtextbrowser.h>
#include <qregexp.h>
#include <qpe/global.h>
#ifdef DESKTOP_VERSION
@@ -40,17 +45,19 @@
OpieMail::OpieMail( QWidget *parent, const char *name )
: MainWindow( parent, name) //, WStyle_ContextHelp )
{
settings = new Settings();
-
+ tb = 0;
setIcon(SmallIcon( "kmicromail" ) );
folderView->populate( settings->getAccounts() );
}
OpieMail::~OpieMail()
{
if (settings) delete settings;
+ if ( tb )
+ delete tb;
}
void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
{
@@ -302,8 +309,15 @@ void OpieMail::replyMail()
void OpieMail::closeViewMail(ViewMail * vm)
{
vm->hide();
}
+
+void OpieMail::slotDownloadMail( )
+{
+ qDebug("slotDownloadMail( ) ");
+}
+
+
void OpieMail::deleteAndDisplayNextMail(ViewMail * vm)
{
QListViewItem*item = mailView->currentItem();
if (!item ) {
@@ -354,8 +368,9 @@ void OpieMail::displayMail()
readMail.resize( 640, 480);
#endif
connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) );
connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) );
+ connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) );
readMail.exec();
if ( readMail.deleted )
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h
index a81a34c..b8a527f 100644
--- a/kmicromail/opiemail.h
+++ b/kmicromail/opiemail.h
@@ -45,16 +45,17 @@ protected slots:
virtual void slotMoveCopyMail();
virtual void slotMoveCopyAllMail();
virtual void reEditMail();
void clearSelection();
-
+ void slotDownloadMail();
private:
void closeViewMail(ViewMail * vm);
QString mPendingEmail;
QString mPendingName;
QByteArray mPendingData;
QCString mPendingMessage;
Settings *settings;
+ QTextBrowser * tb;
};
#endif
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 )
}
}
+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 )
{
m_showHtml = state;
setText();
@@ -319,15 +337,17 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
: ViewMailBase(parent, name, fl), _inLoop(false)
{
m_gotBody = false;
deleted = false;
-
+ sourceOn = false;
connect( reply, SIGNAL(activated()), SLOT(slotReply()));
connect( forward, SIGNAL(activated()), SLOT(slotForward()));
connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) );
connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) );
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);
connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) );
@@ -345,8 +365,10 @@ void ViewMail::readConfig()
void ViewMail::setText()
{
+ viewSource->setText(i18n("View Source"));
+ sourceOn = false;
QString toString;
QString ccString;
QString bccString;
@@ -531,4 +553,5 @@ void MailImageDlg::setName(const QString&fname)
{
qDebug("viewmail.cpp: MailImageDlg::setName Pending");
// m_imageview->setImage(fname);
}
+
diff --git a/kmicromail/viewmail.h b/kmicromail/viewmail.h
index d85b8b2..561989e 100644
--- a/kmicromail/viewmail.h
+++ b/kmicromail/viewmail.h
@@ -44,8 +44,9 @@ public:
bool deleted;
signals:
void showNextMail(ViewMail*);
void deleteAndDisplayNextMail(ViewMail *);
+ void signalDownloadMail();
protected:
QString deHtml(const QString &string);
AttachItem* searchParent(const QValueList<int>&path);
AttachItem* lastChild(AttachItem*parent);
@@ -57,12 +58,13 @@ protected slots:
void setText();
void slotItemClicked( QListViewItem * item , const QPoint & point, int c );
void slotDeleteMail( );
void slotShowHtml( bool );
+ void slotViewSource();
private:
void readConfig();
-
+ bool sourceOn;;
bool _inLoop;
QString m_mailHtml;
bool m_gotBody;
RecBodyP m_body;
diff --git a/kmicromail/viewmailbase.cpp b/kmicromail/viewmailbase.cpp
index d21696a..9365c23 100644
--- a/kmicromail/viewmailbase.cpp
+++ b/kmicromail/viewmailbase.cpp
@@ -27,8 +27,16 @@ ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl)
toolbar->setHorizontalStretchable(true);
addToolBar(toolbar);
+ viewSource = new QAction(i18n("View Source"), 0, 0, this);
+ viewSource->addTo(mailmenu);
+
+ downloadMail= new QAction(i18n("Download Mail"),SmallIcon("add"), 0, 0, this);
+ downloadMail->addTo(toolbar);
+ downloadMail->addTo(mailmenu);
+
+
reply = new QAction(i18n("Reply"),SmallIcon("reply"), 0, 0, this);
reply->addTo(toolbar);
reply->addTo(mailmenu);
diff --git a/kmicromail/viewmailbase.h b/kmicromail/viewmailbase.h
index c97e9e3..7ad1eec 100644
--- a/kmicromail/viewmailbase.h
+++ b/kmicromail/viewmailbase.h
@@ -19,9 +19,9 @@ class ViewMailBase : public QMainWindow
public:
ViewMailBase(QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
protected:
- QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail, *nextMail;
+ QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail, *nextMail, *downloadMail, *viewSource;
QListView *attachments;
QToolBar *toolbar;
QTextBrowser *browser;
OpenDiag *openDiag;