author | zautrix <zautrix> | 2005-01-24 16:32:44 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-24 16:32:44 (UTC) |
commit | 6c89efd80c1e94a0c070025d07c7a4c656f2a81e (patch) (unidiff) | |
tree | 44e8cac0fe7b117be19ec8c1f14c9c888838fdb3 | |
parent | d4f5ce1bedd03191da5ecef2dc68381c10ef1fba (diff) | |
download | kdepimpi-6c89efd80c1e94a0c070025d07c7a4c656f2a81e.zip kdepimpi-6c89efd80c1e94a0c070025d07c7a4c656f2a81e.tar.gz kdepimpi-6c89efd80c1e94a0c070025d07c7a4c656f2a81e.tar.bz2 |
view source
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | kmicromail/koprefs.cpp | 1 | ||||
-rw-r--r-- | kmicromail/koprefs.h | 2 | ||||
-rw-r--r-- | kmicromail/koprefsdialog.cpp | 3 | ||||
-rw-r--r-- | kmicromail/mailistviewitem.cpp | 49 | ||||
-rw-r--r-- | kmicromail/mainwindow.cpp | 4 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 17 | ||||
-rw-r--r-- | kmicromail/opiemail.h | 3 | ||||
-rw-r--r-- | kmicromail/viewmail.cpp | 25 | ||||
-rw-r--r-- | kmicromail/viewmail.h | 4 | ||||
-rw-r--r-- | kmicromail/viewmailbase.cpp | 8 | ||||
-rw-r--r-- | kmicromail/viewmailbase.h | 2 |
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 | |||
@@ -23,4 +23,6 @@ to idecate that they are already seen. | |||
23 | Fixed the problem that the body of some mails was not displayed in the | 23 | Fixed the problem that the body of some mails was not displayed in the |
24 | mail viewer when fetching them from the imap server directly to read them. | 24 | mail viewer when fetching them from the imap server directly to read them. |
25 | Made it (configurable) possible to show the "To:" field in the list view. | ||
26 | Added to the mail viewer the option "View Source" to make it possible to see the raw mail data. | ||
25 | 27 | ||
26 | 28 | ||
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() : | |||
63 | addItemBool("ViewMailAsHtml",&mViewAsHtml,false); | 63 | addItemBool("ViewMailAsHtml",&mViewAsHtml,false); |
64 | addItemBool("SendMailLater",&mSendLater,true); | 64 | addItemBool("SendMailLater",&mSendLater,true); |
65 | addItemBool("ShowToField",&mShowToField,false); | ||
65 | addItemBool("UseKapi",&mUseKapi,false); | 66 | addItemBool("UseKapi",&mUseKapi,false); |
66 | addItemInt("CurrentCodec",&mCurrentCodec,0); | 67 | 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 | |||
73 | QString mCurrentCodeName; | 73 | QString mCurrentCodeName; |
74 | int mCurrentCodec; | 74 | int mCurrentCodec; |
75 | bool mSendLater, mViewAsHtml, mUseKapi, isDirty; | 75 | bool mSendLater, mViewAsHtml, mUseKapi, isDirty, mShowToField; |
76 | private: | 76 | private: |
77 | 77 | ||
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() | |||
148 | &(KOPrefs::instance()->mSendLater),topFrame); | 148 | &(KOPrefs::instance()->mSendLater),topFrame); |
149 | topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); | 149 | topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); |
150 | ttt = addWidBool(i18n("Show \"To\" field in list view"), | ||
151 | &(KOPrefs::instance()->mShowToField),topFrame); | ||
152 | topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1); | ||
150 | /* | 153 | /* |
151 | mCodecEdit = new QLineEdit(topFrame); | 154 | 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 @@ | |||
4 | #include <qtextstream.h> | 4 | #include <qtextstream.h> |
5 | #include <kiconloader.h> | 5 | #include <kiconloader.h> |
6 | #include "koprefs.h" | ||
6 | //#include <qpe/resource.h> | 7 | //#include <qpe/resource.h> |
7 | 8 | ||
@@ -58,52 +59,8 @@ void MailListViewItem::showEntry() | |||
58 | setText(1,mail_data->getSubject()); | 59 | setText(1,mail_data->getSubject()); |
59 | setText(2,mail_data->getFrom()); | 60 | setText(2,mail_data->getFrom()); |
60 | #if 0 | ||
61 | QString date = mail_data->getDate(); | ||
62 | |||
63 | int kom = date.find( ",")+2; | ||
64 | if ( kom == 1 ) | ||
65 | kom = 0; | ||
66 | if ( date.mid(kom,1) == " ") | ||
67 | ++kom; | ||
68 | if ( date.mid(kom+1,1) == " " ) | ||
69 | date = "0" + date.mid( kom ); | ||
70 | else if ( kom ) | ||
71 | date = date.mid( kom ); | ||
72 | if ( kom || date.mid(2,1 ) == " ") { | ||
73 | QString mon = date.mid(3,3); | ||
74 | QString so = 00; | ||
75 | if ( mon == "Jan" ) | ||
76 | so = "01"; | ||
77 | else if ( mon == "Feb" ) | ||
78 | so = "02"; | ||
79 | else if ( mon == "Mar" ) | ||
80 | so = "03"; | ||
81 | else if ( mon == "Apr" ) | ||
82 | so = "04"; | ||
83 | else if ( mon == "May" ) | ||
84 | so = "05"; | ||
85 | else if ( mon == "Jun" ) | ||
86 | so = "06"; | ||
87 | else if ( mon == "Jul" ) | ||
88 | so = "07"; | ||
89 | else if ( mon == "Aug" ) | ||
90 | so = "08"; | ||
91 | else if ( mon == "Sep" ) | ||
92 | so = "09"; | ||
93 | else if ( mon == "Oct" ) | ||
94 | so = "10"; | ||
95 | else if ( mon == "Nov" ) | ||
96 | so = "11"; | ||
97 | else if ( mon == "Dec" ) | ||
98 | so = "12"; | ||
99 | date = date.mid(7,4)+so+date.left(2)+date.mid(12,14); | ||
100 | } | ||
101 | //qDebug("insert Date %s ", date.latin1()); | ||
102 | // if ( date.left(1) != "1" || date.left(1) != "2" ) | ||
103 | // date = date.mid(5); | ||
104 | mKeyMap.insert(4,date); | ||
105 | #endif | ||
106 | mKeyMap.insert(4,mail_data->getIsoDate()); | 61 | mKeyMap.insert(4,mail_data->getIsoDate()); |
107 | setText(4,mail_data->getDate()); | 62 | setText(4,mail_data->getDate()); |
63 | if ( KOPrefs::instance()->mShowToField ) | ||
64 | setText(5,mail_data->To()[0]); | ||
108 | } | 65 | } |
109 | 66 | ||
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 ) | |||
134 | mailView->addColumn( i18n( "Size" ),QListView::Manual); | 134 | mailView->addColumn( i18n( "Size" ),QListView::Manual); |
135 | mailView->addColumn( i18n( "Date" ),QListView::Manual); | 135 | mailView->addColumn( i18n( "Date" ),QListView::Manual); |
136 | if ( KOPrefs::instance()->mShowToField ) | ||
137 | mailView->addColumn( i18n( "To" ),QListView::Manual); | ||
136 | mailView->setAllColumnsShowFocus(true); | 138 | mailView->setAllColumnsShowFocus(true); |
137 | //mailView->setSorting(-1); | 139 | //mailView->setSorting(-1); |
@@ -304,4 +306,6 @@ void MainWindow::slotAdjustColumns() | |||
304 | mailView->setColumnWidth( 3, 50 ); | 306 | mailView->setColumnWidth( 3, 50 ); |
305 | mailView->setColumnWidth( 4, 120 ); | 307 | mailView->setColumnWidth( 4, 120 ); |
308 | if ( KOPrefs::instance()->mShowToField ) | ||
309 | mailView->setColumnWidth( 5, 100 ); | ||
306 | } | 310 | } |
307 | 311 | ||
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 @@ | |||
2 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
3 | 3 | ||
4 | |||
5 | #define protected public | ||
6 | #include <qwidget.h> | ||
7 | #undef protected | ||
4 | #include "koprefsdialog.h" | 8 | #include "koprefsdialog.h" |
5 | #include <kapplication.h> | 9 | #include <kapplication.h> |
@@ -23,4 +27,5 @@ | |||
23 | #include <qtimer.h> | 27 | #include <qtimer.h> |
24 | #include <qcursor.h> | 28 | #include <qcursor.h> |
29 | #include <qtextbrowser.h> | ||
25 | #include <qregexp.h> | 30 | #include <qregexp.h> |
26 | #include <qpe/global.h> | 31 | #include <qpe/global.h> |
@@ -42,5 +47,5 @@ OpieMail::OpieMail( QWidget *parent, const char *name ) | |||
42 | { | 47 | { |
43 | settings = new Settings(); | 48 | settings = new Settings(); |
44 | 49 | tb = 0; | |
45 | setIcon(SmallIcon( "kmicromail" ) ); | 50 | setIcon(SmallIcon( "kmicromail" ) ); |
46 | folderView->populate( settings->getAccounts() ); | 51 | folderView->populate( settings->getAccounts() ); |
@@ -51,4 +56,6 @@ OpieMail::~OpieMail() | |||
51 | { | 56 | { |
52 | if (settings) delete settings; | 57 | if (settings) delete settings; |
58 | if ( tb ) | ||
59 | delete tb; | ||
53 | } | 60 | } |
54 | 61 | ||
@@ -304,4 +311,11 @@ void OpieMail::closeViewMail(ViewMail * vm) | |||
304 | vm->hide(); | 311 | vm->hide(); |
305 | } | 312 | } |
313 | |||
314 | void OpieMail::slotDownloadMail( ) | ||
315 | { | ||
316 | qDebug("slotDownloadMail( ) "); | ||
317 | } | ||
318 | |||
319 | |||
306 | void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) | 320 | void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) |
307 | { | 321 | { |
@@ -356,4 +370,5 @@ void OpieMail::displayMail() | |||
356 | connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); | 370 | connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); |
357 | connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); | 371 | connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); |
372 | connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) ); | ||
358 | 373 | ||
359 | readMail.exec(); | 374 | 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: | |||
47 | virtual void reEditMail(); | 47 | virtual void reEditMail(); |
48 | void clearSelection(); | 48 | void clearSelection(); |
49 | 49 | void slotDownloadMail(); | |
50 | private: | 50 | private: |
51 | void closeViewMail(ViewMail * vm); | 51 | void closeViewMail(ViewMail * vm); |
@@ -55,4 +55,5 @@ private: | |||
55 | QCString mPendingMessage; | 55 | QCString mPendingMessage; |
56 | Settings *settings; | 56 | Settings *settings; |
57 | QTextBrowser * tb; | ||
57 | 58 | ||
58 | }; | 59 | }; |
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 ) | |||
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 | { |
@@ -321,5 +339,5 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | |||
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())); |
@@ -328,4 +346,6 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | |||
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); |
@@ -347,4 +367,6 @@ 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; |
@@ -533,2 +555,3 @@ void MailImageDlg::setName(const QString&fname) | |||
533 | // m_imageview->setImage(fname); | 555 | // m_imageview->setImage(fname); |
534 | } | 556 | } |
557 | |||
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: | |||
46 | void showNextMail(ViewMail*); | 46 | void showNextMail(ViewMail*); |
47 | void deleteAndDisplayNextMail(ViewMail *); | 47 | void deleteAndDisplayNextMail(ViewMail *); |
48 | void signalDownloadMail(); | ||
48 | protected: | 49 | protected: |
49 | QString deHtml(const QString &string); | 50 | QString deHtml(const QString &string); |
@@ -59,8 +60,9 @@ protected slots: | |||
59 | void slotDeleteMail( ); | 60 | void slotDeleteMail( ); |
60 | void slotShowHtml( bool ); | 61 | void slotShowHtml( bool ); |
62 | void slotViewSource(); | ||
61 | 63 | ||
62 | private: | 64 | private: |
63 | void readConfig(); | 65 | void readConfig(); |
64 | 66 | bool sourceOn;; | |
65 | bool _inLoop; | 67 | bool _inLoop; |
66 | QString m_mailHtml; | 68 | 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) | |||
29 | addToolBar(toolbar); | 29 | addToolBar(toolbar); |
30 | 30 | ||
31 | viewSource = new QAction(i18n("View Source"), 0, 0, this); | ||
32 | viewSource->addTo(mailmenu); | ||
33 | |||
34 | downloadMail= new QAction(i18n("Download Mail"),SmallIcon("add"), 0, 0, this); | ||
35 | downloadMail->addTo(toolbar); | ||
36 | downloadMail->addTo(mailmenu); | ||
37 | |||
38 | |||
31 | reply = new QAction(i18n("Reply"),SmallIcon("reply"), 0, 0, this); | 39 | reply = new QAction(i18n("Reply"),SmallIcon("reply"), 0, 0, this); |
32 | reply->addTo(toolbar); | 40 | 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: | |||
21 | 21 | ||
22 | protected: | 22 | protected: |
23 | QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail, *nextMail; | 23 | QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail, *nextMail, *downloadMail, *viewSource; |
24 | QListView *attachments; | 24 | QListView *attachments; |
25 | QToolBar *toolbar; | 25 | QToolBar *toolbar; |