-rw-r--r-- | noncore/net/mail/opiemail.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 1bc81e4..fb8877a 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -6,24 +6,25 @@ | |||
6 | #include "mailistviewitem.h" | 6 | #include "mailistviewitem.h" |
7 | #include "viewmail.h" | 7 | #include "viewmail.h" |
8 | #include "selectstore.h" | 8 | #include "selectstore.h" |
9 | #include "selectsmtp.h" | 9 | #include "selectsmtp.h" |
10 | 10 | ||
11 | #include <libmailwrapper/smtpwrapper.h> | 11 | #include <libmailwrapper/smtpwrapper.h> |
12 | #include <libmailwrapper/mailtypes.h> | 12 | #include <libmailwrapper/mailtypes.h> |
13 | #include <libmailwrapper/abstractmail.h> | 13 | #include <libmailwrapper/abstractmail.h> |
14 | /* OPIE */ | 14 | /* OPIE */ |
15 | #include <opie2/odebug.h> | 15 | #include <opie2/odebug.h> |
16 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
17 | #include <qpe/qpeapplication.h> | 17 | #include <qpe/qpeapplication.h> |
18 | #include <qpe/config.h> | ||
18 | 19 | ||
19 | /* QT */ | 20 | /* QT */ |
20 | #include <qmap.h> | 21 | #include <qmap.h> |
21 | #include <qvaluelist.h> | 22 | #include <qvaluelist.h> |
22 | 23 | ||
23 | /* UNIX */ | 24 | /* UNIX */ |
24 | #include <signal.h> | 25 | #include <signal.h> |
25 | 26 | ||
26 | using namespace Opie::Core; | 27 | using namespace Opie::Core; |
27 | 28 | ||
28 | typedef QMapNode<QString,QString> tkeyvalues; | 29 | typedef QMapNode<QString,QString> tkeyvalues; |
29 | typedef QValueList<tkeyvalues> tvaluelist; | 30 | typedef QValueList<tkeyvalues> tvaluelist; |
@@ -97,24 +98,28 @@ void ValueExplode::splitit() | |||
97 | if (pos2==-1) { | 98 | if (pos2==-1) { |
98 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos),"")); | 99 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos),"")); |
99 | } else { | 100 | } else { |
100 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos,pos2-startpos),iLine.mid(pos2+1))); | 101 | m_LastParsed.append(tkeyvalues(iLine.mid(startpos,pos2-startpos),iLine.mid(pos2+1))); |
101 | } | 102 | } |
102 | } | 103 | } |
103 | } | 104 | } |
104 | 105 | ||
105 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags ) | 106 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags ) |
106 | : MainWindow( parent, name, WStyle_ContextHelp ) | 107 | : MainWindow( parent, name, WStyle_ContextHelp ) |
107 | { | 108 | { |
108 | setup_signalblocking(); | 109 | setup_signalblocking(); |
110 | Config cfg("mail"); | ||
111 | cfg.setGroup( "Settings" ); | ||
112 | m_clickopens = cfg.readBoolEntry("clickOpensMail",true); | ||
113 | |||
109 | settings = new Settings(); | 114 | settings = new Settings(); |
110 | folderView->populate( settings->getAccounts() ); | 115 | folderView->populate( settings->getAccounts() ); |
111 | connect(folderView,SIGNAL(refreshMenues(int)),this,SLOT(refreshMenu(int))); | 116 | connect(folderView,SIGNAL(refreshMenues(int)),this,SLOT(refreshMenu(int))); |
112 | } | 117 | } |
113 | 118 | ||
114 | OpieMail::~OpieMail() | 119 | OpieMail::~OpieMail() |
115 | { | 120 | { |
116 | if (settings) delete settings; | 121 | if (settings) delete settings; |
117 | } | 122 | } |
118 | 123 | ||
119 | void OpieMail::setup_signalblocking() | 124 | void OpieMail::setup_signalblocking() |
120 | { | 125 | { |
@@ -225,25 +230,30 @@ void OpieMail::slotSendQueued() | |||
225 | delete wrap; | 230 | delete wrap; |
226 | } | 231 | } |
227 | } | 232 | } |
228 | 233 | ||
229 | void OpieMail::slotSearchMails() | 234 | void OpieMail::slotSearchMails() |
230 | { | 235 | { |
231 | odebug << "Search Mails" << oendl; | 236 | odebug << "Search Mails" << oendl; |
232 | } | 237 | } |
233 | 238 | ||
234 | void OpieMail::slotEditSettings() | 239 | void OpieMail::slotEditSettings() |
235 | { | 240 | { |
236 | SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp ); | 241 | SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp ); |
237 | QPEApplication::execDialog( &settingsDialog ); | 242 | if (QPEApplication::execDialog( &settingsDialog )) { |
243 | Config cfg("mail"); | ||
244 | cfg.setGroup( "Settings" ); | ||
245 | m_clickopens = cfg.readBoolEntry("clickOpensMail",true); | ||
246 | emit settingsChanged(); | ||
247 | } | ||
238 | } | 248 | } |
239 | 249 | ||
240 | void OpieMail::slotEditAccounts() | 250 | void OpieMail::slotEditAccounts() |
241 | { | 251 | { |
242 | odebug << "Edit Accounts" << oendl; | 252 | odebug << "Edit Accounts" << oendl; |
243 | EditAccounts eaDialog( settings, this, 0, true, WStyle_ContextHelp ); | 253 | EditAccounts eaDialog( settings, this, 0, true, WStyle_ContextHelp ); |
244 | eaDialog.slotAdjustColumns(); | 254 | eaDialog.slotAdjustColumns(); |
245 | if (QPEApplication::execDialog( &eaDialog )==QDialog::Rejected);// return; | 255 | if (QPEApplication::execDialog( &eaDialog )==QDialog::Rejected);// return; |
246 | 256 | ||
247 | if ( settings ) delete settings; | 257 | if ( settings ) delete settings; |
248 | settings = new Settings(); | 258 | settings = new Settings(); |
249 | mailView->clear(); | 259 | mailView->clear(); |
@@ -333,24 +343,25 @@ void OpieMail::refreshMailView(const QValueList<RecMailP>&list) | |||
333 | 343 | ||
334 | QValueList<RecMailP>::ConstIterator it; | 344 | QValueList<RecMailP>::ConstIterator it; |
335 | for (it = list.begin(); it != list.end();++it) | 345 | for (it = list.begin(); it != list.end();++it) |
336 | { | 346 | { |
337 | item = new MailListViewItem(mailView,item); | 347 | item = new MailListViewItem(mailView,item); |
338 | item->storeData((*it)); | 348 | item->storeData((*it)); |
339 | item->showEntry(); | 349 | item->showEntry(); |
340 | } | 350 | } |
341 | } | 351 | } |
342 | 352 | ||
343 | void OpieMail::mailLeftClicked(int button, QListViewItem *item,const QPoint&,int ) | 353 | void OpieMail::mailLeftClicked(int button, QListViewItem *item,const QPoint&,int ) |
344 | { | 354 | { |
355 | if (!m_clickopens) return; | ||
345 | /* just LEFT button - or tap with stylus on pda */ | 356 | /* just LEFT button - or tap with stylus on pda */ |
346 | if (button!=1) return; | 357 | if (button!=1) return; |
347 | if (!item) return; | 358 | if (!item) return; |
348 | if (folderView->currentisDraft()) { | 359 | if (folderView->currentisDraft()) { |
349 | reEditMail(); | 360 | reEditMail(); |
350 | } else { | 361 | } else { |
351 | displayMail(); | 362 | displayMail(); |
352 | } | 363 | } |
353 | } | 364 | } |
354 | 365 | ||
355 | void OpieMail::slotMoveCopyMail() | 366 | void OpieMail::slotMoveCopyMail() |
356 | { | 367 | { |