summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-12-20 00:05:37 (UTC)
committer harlekin <harlekin>2003-12-20 00:05:37 (UTC)
commitdc088ad432189b4883f7654ef6b2c1e2f69112cc (patch) (unidiff)
tree090f6afd960e644d7da1fae3b8c8ffa97b669b59
parent00a0c8cf03fe746c1e3ba608bf298c8e66d065f9 (diff)
downloadopie-dc088ad432189b4883f7654ef6b2c1e2f69112cc.zip
opie-dc088ad432189b4883f7654ef6b2c1e2f69112cc.tar.gz
opie-dc088ad432189b4883f7654ef6b2c1e2f69112cc.tar.bz2
- beginning of a settings dialog
- button for switching between html and plain text view of the mail - hide some unused icons - completed alwins idea about status icons ( alwin you missed the one that sets the read icon .-) ) - beginning of a status widget -
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/mail.pro12
-rw-r--r--noncore/net/mail/mainwindow.cpp24
-rw-r--r--noncore/net/mail/mainwindow.h3
-rw-r--r--noncore/net/mail/opiemail.cpp2
-rw-r--r--noncore/net/mail/viewmail.cpp91
-rw-r--r--noncore/net/mail/viewmail.h5
-rw-r--r--noncore/net/mail/viewmailbase.cpp5
-rw-r--r--noncore/net/mail/viewmailbase.h3
8 files changed, 101 insertions, 44 deletions
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro
index d058db7..49be889 100644
--- a/noncore/net/mail/mail.pro
+++ b/noncore/net/mail/mail.pro
@@ -17,3 +17,5 @@ HEADERS = defines.h \
17 pop3wrapper.h \ 17 pop3wrapper.h \
18 abstractmail.h 18 abstractmail.h \
19 settingsdialog.h \
20 statuswidget.h
19 21
@@ -34,3 +36,5 @@ SOURCES = main.cpp \
34 pop3wrapper.cpp \ 36 pop3wrapper.cpp \
35 abstractmail.cpp 37 abstractmail.cpp \
38 settingsdialog.cpp \
39 statuswidget.cpp
36 40
@@ -44,3 +48,5 @@ INTERFACES = editaccountsui.ui \
44 logindialogui.ui \ 48 logindialogui.ui \
45 composemailui.ui 49 composemailui.ui \
50 settingsdialogui.ui \
51 statuswidgetui.ui
46 52
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index 9a37510..d3b9c34 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -13,2 +13,3 @@
13#include "mainwindow.h" 13#include "mainwindow.h"
14#include "settingsdialog.h"
14#include "viewmail.h" 15#include "viewmail.h"
@@ -17,2 +18,3 @@
17 18
19
18MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) 20MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
@@ -47,2 +49,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
47 49
50 /*
48 syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, 51 syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC,
@@ -51,2 +54,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
51 syncFolders->addTo( mailMenu ); 54 syncFolders->addTo( mailMenu );
55 */
52 56
@@ -60,3 +64,4 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
60 64
61 searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS, 65 /*
66 searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS,
62 0, 0, this ); 67 0, 0, this );
@@ -64,2 +69,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
64 searchMails->addTo( mailMenu ); 69 searchMails->addTo( mailMenu );
70 */
65 71
@@ -74,2 +80,4 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
74 editSettings->addTo( settingsMenu ); 80 editSettings->addTo( settingsMenu );
81 connect( editSettings, SIGNAL( activated() ),
82 SLOT( slotEditSettings() ) );
75 83
@@ -79,3 +87,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
79 87
80 QWidget *view = new QWidget( this ); 88 QWidget *view = new QWidget( this );
81 setCentralWidget( view ); 89 setCentralWidget( view );
@@ -101,3 +109,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
101 109
110 statusWidget = new StatusWidget( view );
111
102 layout->addWidget( mailView ); 112 layout->addWidget( mailView );
113 layout->addWidget( statusWidget );
103 layout->setStretchFactor( folderView, 1 ); 114 layout->setStretchFactor( folderView, 1 );
@@ -105,2 +116,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
105 116
117
106 slotAdjustLayout(); 118 slotAdjustLayout();
@@ -143,2 +155,8 @@ void MainWindow::slotAdjustColumns()
143 155
156void MainWindow::slotEditSettings() {
157 SettingsDialog settingsDialog( this, 0, true );
158 settingsDialog.showMaximized();
159 settingsDialog.exec();
160}
161
144void MainWindow::slotShowFolders( bool show ) 162void MainWindow::slotShowFolders( bool show )
@@ -181,3 +199,3 @@ void MainWindow::displayMail(QListViewItem*item)
181 } else { 199 } else {
182 ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") ); 200 ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "") );
183 } 201 }
diff --git a/noncore/net/mail/mainwindow.h b/noncore/net/mail/mainwindow.h
index 21af190..4e4f4bb 100644
--- a/noncore/net/mail/mainwindow.h
+++ b/noncore/net/mail/mainwindow.h
@@ -11,2 +11,3 @@
11#include "accountview.h" 11#include "accountview.h"
12#include "statuswidget.h"
12 13
@@ -30,2 +31,3 @@ protected slots:
30 void slotAdjustLayout(); 31 void slotAdjustLayout();
32 void slotEditSettings();
31 33
@@ -33,2 +35,3 @@ protected:
33 QToolBar *toolBar; 35 QToolBar *toolBar;
36 StatusWidget *statusWidget;
34 QMenuBar *menuBar; 37 QMenuBar *menuBar;
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp
index 740e4cf..7ab4e0d 100644
--- a/noncore/net/mail/opiemail.cpp
+++ b/noncore/net/mail/opiemail.cpp
@@ -13,3 +13,3 @@ OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags )
13 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); 13 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
14 connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); 14// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
15 connect( editSettings, SIGNAL( activated() ), SLOT( slotEditSettings() ) ); 15 connect( editSettings, SIGNAL( activated() ), SLOT( slotEditSettings() ) );
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index d86454c..e11fe1f 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -8,2 +8,4 @@
8 8
9#include <qpe/config.h>
10
9#include <opie/ofiledialog.h> 11#include <opie/ofiledialog.h>
@@ -111,2 +113,8 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
111 113
114
115void ViewMail::slotShowHtml( bool state ) {
116 m_showHtml = state;
117 setText();
118}
119
112void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) { 120void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) {
@@ -166,14 +174,14 @@ void ViewMail::setMail( RecMail mail ) {
166 174
167m_recMail = mail; 175 m_recMail = mail;
168 176
169m_mail[0] = mail.getFrom(); 177 m_mail[0] = mail.getFrom();
170m_mail[1] = mail.getSubject(); 178 m_mail[1] = mail.getSubject();
171m_mail[3] = mail.getDate(); 179 m_mail[3] = mail.getDate();
172m_mail[4] = mail.Msgid(); 180 m_mail[4] = mail.Msgid();
173 181
174m_mail2[0] = mail.To(); 182 m_mail2[0] = mail.To();
175m_mail2[1] = mail.CC(); 183 m_mail2[1] = mail.CC();
176m_mail2[2] = mail.Bcc(); 184 m_mail2[2] = mail.Bcc();
177 185
178setText(); 186 setText();
179} 187}
@@ -188,5 +196,6 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
188 196
189 connect(reply, SIGNAL(activated()), SLOT(slotReply())); 197 connect( reply, SIGNAL(activated()), SLOT(slotReply()));
190 connect(forward, SIGNAL(activated()), SLOT(slotForward())); 198 connect( forward, SIGNAL(activated()), SLOT(slotForward()));
191 connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail( ) ) ); 199 connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail( ) ) );
200 connect( showHtml, SIGNAL( toggled( bool ) ), SLOT( slotShowHtml( bool ) ) );
192 201
@@ -195,2 +204,3 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
195 204
205 readConfig();
196 206
@@ -198,2 +208,9 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
198 208
209void ViewMail::readConfig() {
210 Config cfg( "mail" );
211 cfg.setGroup( "Settings" );
212 m_showHtml = cfg.readBoolEntry( "showHtml", false );
213 showHtml->setOn( m_showHtml );
214}
215
199void ViewMail::setText() 216void ViewMail::setText()
@@ -201,31 +218,35 @@ void ViewMail::setText()
201 218
202 QString toString; 219 QString toString;
203 QString ccString; 220 QString ccString;
204 QString bccString; 221 QString bccString;
205 222
206 for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) { 223 for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) {
207 toString += (*it); 224 toString += (*it);
208 } 225 }
209 for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) { 226 for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) {
210 ccString += (*it); 227 ccString += (*it);
211 } 228 }
212 for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) { 229 for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) {
213 bccString += (*it); 230 bccString += (*it);
214 } 231 }
215 232
216 setCaption( caption().arg( m_mail[0] ) ); 233 setCaption( caption().arg( m_mail[0] ) );
217 234
218 m_mailHtml = "<html><body>" 235 m_mailHtml = "<html><body>"
219 "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" 236 "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>"
220 "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" 237 "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>"
221 "</td></tr><tr bgcolor=\"#EEEEE6\"><td>" 238 "</td></tr><tr bgcolor=\"#EEEEE6\"><td>"
222 "<b>" + tr( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>" 239 "<b>" + tr( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>"
223 "<b>" + tr( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" + 240 "<b>" + tr( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" +
224 tr( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>" 241 tr( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>"
225 "<b>" + tr( "Date" ) + ": </b> " + m_mail[3] + 242 "<b>" + tr( "Date" ) + ": </b> " + m_mail[3] +
226 "</td></tr></table><font face=fixed>"; 243 "</td></tr></table><font face=fixed>";
227 244
245 if ( !m_showHtml ) {
228 browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" ); 246 browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" );
229 // remove later in favor of a real handling 247 } else {
230 m_gotBody = true; 248 browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" );
249 }
250 // remove later in favor of a real handling
251 m_gotBody = true;
231} 252}
diff --git a/noncore/net/mail/viewmail.h b/noncore/net/mail/viewmail.h
index dd7f854..bf7a4dd 100644
--- a/noncore/net/mail/viewmail.h
+++ b/noncore/net/mail/viewmail.h
@@ -44,5 +44,7 @@ protected slots:
44 void slotDeleteMail( ); 44 void slotDeleteMail( );
45 45 void slotShowHtml( bool );
46 46
47private: 47private:
48 void readConfig();
49
48 bool _inLoop; 50 bool _inLoop;
@@ -52,2 +54,3 @@ private:
52 RecMail m_recMail; 54 RecMail m_recMail;
55 bool m_showHtml;
53 56
diff --git a/noncore/net/mail/viewmailbase.cpp b/noncore/net/mail/viewmailbase.cpp
index 0c7f671..e69617d 100644
--- a/noncore/net/mail/viewmailbase.cpp
+++ b/noncore/net/mail/viewmailbase.cpp
@@ -45,2 +45,7 @@ ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl)
45 45
46
47 showHtml = new QAction( tr( "Show Html" ), QIconSet( Resource::loadPixmap( "mail/attach" ) ), 0, 0, this, 0, true );
48 showHtml->addTo( toolbar );
49 showHtml->addTo( mailmenu );
50
46 deleteMail = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); 51 deleteMail = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this);
diff --git a/noncore/net/mail/viewmailbase.h b/noncore/net/mail/viewmailbase.h
index 898522e..6d2a5b2 100644
--- a/noncore/net/mail/viewmailbase.h
+++ b/noncore/net/mail/viewmailbase.h
@@ -21,3 +21,3 @@ public:
21protected: 21protected:
22 QAction *reply, *forward, *attachbutton, *deleteMail; 22 QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml;
23 QListView *attachments; 23 QListView *attachments;
@@ -32,2 +32,3 @@ protected slots:
32 32
33
33}; 34};