author | harlekin <harlekin> | 2003-12-20 00:05:37 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-20 00:05:37 (UTC) |
commit | dc088ad432189b4883f7654ef6b2c1e2f69112cc (patch) (unidiff) | |
tree | 090f6afd960e644d7da1fae3b8c8ffa97b669b59 | |
parent | 00a0c8cf03fe746c1e3ba608bf298c8e66d065f9 (diff) | |
download | opie-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
-
-rw-r--r-- | noncore/net/mail/mail.pro | 12 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 20 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.h | 3 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 21 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.h | 5 | ||||
-rw-r--r-- | noncore/net/mail/viewmailbase.cpp | 5 | ||||
-rw-r--r-- | noncore/net/mail/viewmailbase.h | 3 |
8 files changed, 64 insertions, 7 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 | |||
@@ -16,5 +16,7 @@ HEADERS = defines.h \ | |||
16 | mailistviewitem.h \ | 16 | mailistviewitem.h \ |
17 | pop3wrapper.h \ | 17 | pop3wrapper.h \ |
18 | abstractmail.h | 18 | abstractmail.h \ |
19 | settingsdialog.h \ | ||
20 | statuswidget.h | ||
19 | 21 | ||
20 | SOURCES = main.cpp \ | 22 | SOURCES = main.cpp \ |
@@ -33,5 +35,7 @@ SOURCES = main.cpp \ | |||
33 | mailtypes.cpp \ | 35 | mailtypes.cpp \ |
34 | pop3wrapper.cpp \ | 36 | pop3wrapper.cpp \ |
35 | abstractmail.cpp | 37 | abstractmail.cpp \ |
38 | settingsdialog.cpp \ | ||
39 | statuswidget.cpp | ||
36 | 40 | ||
37 | INTERFACES = editaccountsui.ui \ | 41 | INTERFACES = editaccountsui.ui \ |
@@ -43,5 +47,7 @@ INTERFACES = editaccountsui.ui \ | |||
43 | addresspickerui.ui \ | 47 | addresspickerui.ui \ |
44 | logindialogui.ui \ | 48 | logindialogui.ui \ |
45 | composemailui.ui | 49 | composemailui.ui \ |
50 | settingsdialogui.ui \ | ||
51 | statuswidgetui.ui | ||
46 | 52 | ||
47 | INCLUDEPATH += $(OPIEDIR)/include | 53 | INCLUDEPATH += $(OPIEDIR)/include |
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 | |||
@@ -12,8 +12,10 @@ | |||
12 | #include "defines.h" | 12 | #include "defines.h" |
13 | #include "mainwindow.h" | 13 | #include "mainwindow.h" |
14 | #include "settingsdialog.h" | ||
14 | #include "viewmail.h" | 15 | #include "viewmail.h" |
15 | #include "mailtypes.h" | 16 | #include "mailtypes.h" |
16 | #include "mailistviewitem.h" | 17 | #include "mailistviewitem.h" |
17 | 18 | ||
19 | |||
18 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 20 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
19 | : QMainWindow( parent, name, flags ) | 21 | : QMainWindow( parent, name, flags ) |
@@ -46,8 +48,10 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
46 | sendQueued->addTo( mailMenu ); | 48 | sendQueued->addTo( mailMenu ); |
47 | 49 | ||
50 | /* | ||
48 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, | 51 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, |
49 | 0, 0, this ); | 52 | 0, 0, this ); |
50 | syncFolders->addTo( toolBar ); | 53 | syncFolders->addTo( toolBar ); |
51 | syncFolders->addTo( mailMenu ); | 54 | syncFolders->addTo( mailMenu ); |
55 | */ | ||
52 | 56 | ||
53 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, | 57 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, |
@@ -59,8 +63,10 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
59 | SLOT( slotShowFolders( bool ) ) ); | 63 | SLOT( slotShowFolders( bool ) ) ); |
60 | 64 | ||
65 | /* | ||
61 | searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS, | 66 | searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS, |
62 | 0, 0, this ); | 67 | 0, 0, this ); |
63 | searchMails->addTo( toolBar ); | 68 | searchMails->addTo( toolBar ); |
64 | searchMails->addTo( mailMenu ); | 69 | searchMails->addTo( mailMenu ); |
70 | */ | ||
65 | 71 | ||
66 | deleteMails = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); | 72 | deleteMails = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); |
@@ -73,4 +79,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
73 | 0, 0, this ); | 79 | 0, 0, this ); |
74 | editSettings->addTo( settingsMenu ); | 80 | editSettings->addTo( settingsMenu ); |
81 | connect( editSettings, SIGNAL( activated() ), | ||
82 | SLOT( slotEditSettings() ) ); | ||
75 | 83 | ||
76 | editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS, | 84 | editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS, |
@@ -100,8 +108,12 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
100 | mailView->setSorting(-1); | 108 | mailView->setSorting(-1); |
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 ); |
104 | layout->setStretchFactor( mailView, 2 ); | 115 | layout->setStretchFactor( mailView, 2 ); |
105 | 116 | ||
117 | |||
106 | slotAdjustLayout(); | 118 | slotAdjustLayout(); |
107 | 119 | ||
@@ -142,4 +154,10 @@ void MainWindow::slotAdjustColumns() | |||
142 | } | 154 | } |
143 | 155 | ||
156 | void MainWindow::slotEditSettings() { | ||
157 | SettingsDialog settingsDialog( this, 0, true ); | ||
158 | settingsDialog.showMaximized(); | ||
159 | settingsDialog.exec(); | ||
160 | } | ||
161 | |||
144 | void MainWindow::slotShowFolders( bool show ) | 162 | void MainWindow::slotShowFolders( bool show ) |
145 | { | 163 | { |
@@ -180,5 +198,5 @@ void MainWindow::displayMail(QListViewItem*item) | |||
180 | folderView->refreshCurrent(); | 198 | folderView->refreshCurrent(); |
181 | } else { | 199 | } else { |
182 | ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") ); | 200 | ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "") ); |
183 | } | 201 | } |
184 | } | 202 | } |
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 | |||
@@ -10,4 +10,5 @@ | |||
10 | 10 | ||
11 | #include "accountview.h" | 11 | #include "accountview.h" |
12 | #include "statuswidget.h" | ||
12 | 13 | ||
13 | class RecMail; | 14 | class RecMail; |
@@ -29,7 +30,9 @@ protected slots: | |||
29 | virtual void slotDeleteMail(); | 30 | virtual void slotDeleteMail(); |
30 | void slotAdjustLayout(); | 31 | void slotAdjustLayout(); |
32 | void slotEditSettings(); | ||
31 | 33 | ||
32 | protected: | 34 | protected: |
33 | QToolBar *toolBar; | 35 | QToolBar *toolBar; |
36 | StatusWidget *statusWidget; | ||
34 | QMenuBar *menuBar; | 37 | QMenuBar *menuBar; |
35 | QPopupMenu *mailMenu, *settingsMenu; | 38 | QPopupMenu *mailMenu, *settingsMenu; |
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 | |||
@@ -12,5 +12,5 @@ OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) | |||
12 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 12 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
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() ) ); |
16 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 16 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
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 | |||
@@ -7,4 +7,6 @@ | |||
7 | #include <qapplication.h> | 7 | #include <qapplication.h> |
8 | 8 | ||
9 | #include <qpe/config.h> | ||
10 | |||
9 | #include <opie/ofiledialog.h> | 11 | #include <opie/ofiledialog.h> |
10 | 12 | ||
@@ -110,4 +112,10 @@ for (unsigned int i = 0; i < body.Parts().count();++i) { | |||
110 | } | 112 | } |
111 | 113 | ||
114 | |||
115 | void ViewMail::slotShowHtml( bool state ) { | ||
116 | m_showHtml = state; | ||
117 | setText(); | ||
118 | } | ||
119 | |||
112 | void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) { | 120 | void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) { |
113 | if (!item ) | 121 | if (!item ) |
@@ -190,11 +198,20 @@ ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | |||
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 | ||
193 | attachments->setEnabled(m_gotBody); | 202 | attachments->setEnabled(m_gotBody); |
194 | connect( attachments, SIGNAL( clicked ( QListViewItem *, const QPoint & , int ) ), SLOT( slotItemClicked( QListViewItem *, const QPoint & , int ) ) ); | 203 | connect( attachments, SIGNAL( clicked ( QListViewItem *, const QPoint & , int ) ), SLOT( slotItemClicked( QListViewItem *, const QPoint & , int ) ) ); |
195 | 204 | ||
205 | readConfig(); | ||
196 | 206 | ||
197 | } | 207 | } |
198 | 208 | ||
209 | void ViewMail::readConfig() { | ||
210 | Config cfg( "mail" ); | ||
211 | cfg.setGroup( "Settings" ); | ||
212 | m_showHtml = cfg.readBoolEntry( "showHtml", false ); | ||
213 | showHtml->setOn( m_showHtml ); | ||
214 | } | ||
215 | |||
199 | void ViewMail::setText() | 216 | void ViewMail::setText() |
200 | { | 217 | { |
@@ -226,5 +243,9 @@ void ViewMail::setText() | |||
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>" ); |
247 | } else { | ||
248 | browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" ); | ||
249 | } | ||
229 | // remove later in favor of a real handling | 250 | // remove later in favor of a real handling |
230 | m_gotBody = true; | 251 | m_gotBody = true; |
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 | |||
@@ -43,7 +43,9 @@ protected slots: | |||
43 | void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); | 43 | void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); |
44 | void slotDeleteMail( ); | 44 | void slotDeleteMail( ); |
45 | 45 | void slotShowHtml( bool ); | |
46 | 46 | ||
47 | private: | 47 | private: |
48 | void readConfig(); | ||
49 | |||
48 | bool _inLoop; | 50 | bool _inLoop; |
49 | QString m_mailHtml; | 51 | QString m_mailHtml; |
@@ -51,4 +53,5 @@ private: | |||
51 | RecBody m_body; | 53 | RecBody m_body; |
52 | RecMail m_recMail; | 54 | RecMail m_recMail; |
55 | bool m_showHtml; | ||
53 | 56 | ||
54 | // 0 from 1 subject 2 bodytext 3 date | 57 | // 0 from 1 subject 2 bodytext 3 date |
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 | |||
@@ -44,4 +44,9 @@ ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) | |||
44 | connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool))); | 44 | connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool))); |
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); |
47 | deleteMail->addTo(toolbar); | 52 | deleteMail->addTo(toolbar); |
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 | |||
@@ -20,5 +20,5 @@ public: | |||
20 | 20 | ||
21 | protected: | 21 | protected: |
22 | QAction *reply, *forward, *attachbutton, *deleteMail; | 22 | QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml; |
23 | QListView *attachments; | 23 | QListView *attachments; |
24 | QToolBar *toolbar; | 24 | QToolBar *toolbar; |
@@ -31,4 +31,5 @@ protected slots: | |||
31 | void slotChangeAttachview(bool state); | 31 | void slotChangeAttachview(bool state); |
32 | 32 | ||
33 | |||
33 | }; | 34 | }; |
34 | 35 | ||