summaryrefslogtreecommitdiffabout
path: root/kmicromail
Side-by-side diff
Diffstat (limited to 'kmicromail') (more/less context) (ignore whitespace changes)
-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
11 files changed, 66 insertions, 52 deletions
diff --git a/kmicromail/koprefs.cpp b/kmicromail/koprefs.cpp
index 342bbf3..2bae5f6 100644
--- a/kmicromail/koprefs.cpp
+++ b/kmicromail/koprefs.cpp
@@ -63,4 +63,5 @@ KOPrefs::KOPrefs() :
addItemBool("ViewMailAsHtml",&mViewAsHtml,false);
addItemBool("SendMailLater",&mSendLater,true);
+ addItemBool("ShowToField",&mShowToField,false);
addItemBool("UseKapi",&mUseKapi,false);
addItemInt("CurrentCodec",&mCurrentCodec,0);
diff --git a/kmicromail/koprefs.h b/kmicromail/koprefs.h
index 91f3fa3..f2c4fbb 100644
--- a/kmicromail/koprefs.h
+++ b/kmicromail/koprefs.h
@@ -73,5 +73,5 @@ class KOPrefs : public KPimPrefs
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
@@ -148,4 +148,7 @@ void KOPrefsDialog::setupMailTab()
&(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);
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp
index 484a635..ffb835c 100644
--- a/kmicromail/mailistviewitem.cpp
+++ b/kmicromail/mailistviewitem.cpp
@@ -4,4 +4,5 @@
#include <qtextstream.h>
#include <kiconloader.h>
+#include "koprefs.h"
//#include <qpe/resource.h>
@@ -58,52 +59,8 @@ void MailListViewItem::showEntry()
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]);
}
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index 1dc374b..875ab77 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -134,4 +134,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
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);
@@ -304,4 +306,6 @@ void MainWindow::slotAdjustColumns()
mailView->setColumnWidth( 3, 50 );
mailView->setColumnWidth( 4, 120 );
+ if ( KOPrefs::instance()->mShowToField )
+ mailView->setColumnWidth( 5, 100 );
}
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 915b3e8..6e54bf4 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -2,4 +2,8 @@
// CHANGED 2004-08-06 Lutz Rogowski
+
+#define protected public
+#include <qwidget.h>
+#undef protected
#include "koprefsdialog.h"
#include <kapplication.h>
@@ -23,4 +27,5 @@
#include <qtimer.h>
#include <qcursor.h>
+#include <qtextbrowser.h>
#include <qregexp.h>
#include <qpe/global.h>
@@ -42,5 +47,5 @@ OpieMail::OpieMail( QWidget *parent, const char *name )
{
settings = new Settings();
-
+ tb = 0;
setIcon(SmallIcon( "kmicromail" ) );
folderView->populate( settings->getAccounts() );
@@ -51,4 +56,6 @@ OpieMail::~OpieMail()
{
if (settings) delete settings;
+ if ( tb )
+ delete tb;
}
@@ -304,4 +311,11 @@ void OpieMail::closeViewMail(ViewMail * vm)
vm->hide();
}
+
+void OpieMail::slotDownloadMail( )
+{
+ qDebug("slotDownloadMail( ) ");
+}
+
+
void OpieMail::deleteAndDisplayNextMail(ViewMail * vm)
{
@@ -356,4 +370,5 @@ void OpieMail::displayMail()
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();
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h
index a81a34c..b8a527f 100644
--- a/kmicromail/opiemail.h
+++ b/kmicromail/opiemail.h
@@ -47,5 +47,5 @@ protected slots:
virtual void reEditMail();
void clearSelection();
-
+ void slotDownloadMail();
private:
void closeViewMail(ViewMail * vm);
@@ -55,4 +55,5 @@ private:
QCString mPendingMessage;
Settings *settings;
+ QTextBrowser * tb;
};
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);
}
+
diff --git a/kmicromail/viewmail.h b/kmicromail/viewmail.h
index d85b8b2..561989e 100644
--- a/kmicromail/viewmail.h
+++ b/kmicromail/viewmail.h
@@ -46,4 +46,5 @@ public:
void showNextMail(ViewMail*);
void deleteAndDisplayNextMail(ViewMail *);
+ void signalDownloadMail();
protected:
QString deHtml(const QString &string);
@@ -59,8 +60,9 @@ protected slots:
void slotDeleteMail( );
void slotShowHtml( bool );
+ void slotViewSource();
private:
void readConfig();
-
+ bool sourceOn;;
bool _inLoop;
QString m_mailHtml;
diff --git a/kmicromail/viewmailbase.cpp b/kmicromail/viewmailbase.cpp
index d21696a..9365c23 100644
--- a/kmicromail/viewmailbase.cpp
+++ b/kmicromail/viewmailbase.cpp
@@ -29,4 +29,12 @@ ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl)
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);
diff --git a/kmicromail/viewmailbase.h b/kmicromail/viewmailbase.h
index c97e9e3..7ad1eec 100644
--- a/kmicromail/viewmailbase.h
+++ b/kmicromail/viewmailbase.h
@@ -21,5 +21,5 @@ public:
protected:
- QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail, *nextMail;
+ QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail, *nextMail, *downloadMail, *viewSource;
QListView *attachments;
QToolBar *toolbar;