summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/accountview.cpp11
-rw-r--r--noncore/net/mail/accountview.h2
-rw-r--r--noncore/net/mail/defines.h2
-rw-r--r--noncore/net/mail/mainwindow.cpp7
-rw-r--r--noncore/net/mail/mainwindow.h4
-rw-r--r--noncore/net/mail/opiemail.cpp13
-rw-r--r--noncore/net/mail/opiemail.h3
-rw-r--r--noncore/net/mail/settingsdialog.cpp4
-rw-r--r--noncore/net/mail/settingsdialogui.ui30
9 files changed, 69 insertions, 7 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index 1183704..0e739e2 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -2,52 +2,61 @@
2#include "accountview.h" 2#include "accountview.h"
3#include "accountitem.h" 3#include "accountitem.h"
4#include "selectstore.h" 4#include "selectstore.h"
5 5
6#include <libmailwrapper/settings.h> 6#include <libmailwrapper/settings.h>
7#include <libmailwrapper/mailwrapper.h> 7#include <libmailwrapper/mailwrapper.h>
8#include <libmailwrapper/mailtypes.h> 8#include <libmailwrapper/mailtypes.h>
9#include <libmailwrapper/abstractmail.h> 9#include <libmailwrapper/abstractmail.h>
10 10
11/* OPIE */ 11/* OPIE */
12#include <opie2/odebug.h> 12#include <opie2/odebug.h>
13#include <qpe/qpeapplication.h> 13#include <qpe/qpeapplication.h>
14#include <qpe/config.h>
14 15
15/* QT */ 16/* QT */
16#include <qmessagebox.h> 17#include <qmessagebox.h>
17#include <qpopupmenu.h> 18#include <qpopupmenu.h>
18 19
19using namespace Opie::Core; 20using namespace Opie::Core;
20AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) 21AccountView::AccountView( QWidget *parent, const char *name, WFlags flags )
21 : QListView( parent, name, flags ) 22 : QListView( parent, name, flags )
22{ 23{
23 setSorting(0); 24 setSorting(0);
24 setSelectionMode(Single); 25 setSelectionMode(Single);
25 m_rightPressed = false; 26 m_rightPressed = false;
26 27
27 connect( this, SIGNAL( selectionChanged(QListViewItem*) ), 28 connect( this, SIGNAL( selectionChanged(QListViewItem*) ),
28 SLOT( slotSelectionChanged(QListViewItem*) ) ); 29 SLOT( slotSelectionChanged(QListViewItem*) ) );
29 connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, 30 connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
30 SLOT( slotMouseButton(int,QListViewItem*,const QPoint&,int) ) ); 31 SLOT( slotMouseButton(int,QListViewItem*,const QPoint&,int) ) );
31 connect( this, SIGNAL(clicked(QListViewItem*) ),this, 32 connect( this, SIGNAL(clicked(QListViewItem*) ),this,
32 SLOT( slotMouseClicked(QListViewItem*) ) ); 33 SLOT( slotMouseClicked(QListViewItem*) ) );
33 m_currentItem = 0; 34 m_currentItem = 0;
35 readSettings();
34} 36}
35 37
36AccountView::~AccountView() 38AccountView::~AccountView()
37{ 39{
38 imapAccounts.clear(); 40 imapAccounts.clear();
39 mhAccounts.clear(); 41 mhAccounts.clear();
40} 42}
41 43
44void AccountView::readSettings()
45{
46 Config cfg("mail");
47 cfg.setGroup( "Settings" );
48 m_clickopens = cfg.readBoolEntry("clickOpensFolder",true);
49}
50
42void AccountView::slotSelectionChanged(QListViewItem*item) 51void AccountView::slotSelectionChanged(QListViewItem*item)
43{ 52{
44 if (!item) { 53 if (!item) {
45 emit serverSelected(0); 54 emit serverSelected(0);
46 return; 55 return;
47 } 56 }
48 AccountViewItem *view = static_cast<AccountViewItem *>(item); 57 AccountViewItem *view = static_cast<AccountViewItem *>(item);
49 emit serverSelected(view->isServer()); 58 emit serverSelected(view->isServer());
50} 59}
51 60
52QMap<int,QString> AccountView::currentServerMenu()const 61QMap<int,QString> AccountView::currentServerMenu()const
53{ 62{
@@ -89,25 +98,25 @@ void AccountView::slotRightButton(int, QListViewItem * item,const QPoint&,int)
89 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); 98 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
90 delete m; 99 delete m;
91} 100}
92 101
93void AccountView::slotLeftButton(int, QListViewItem *,const QPoint&,int) 102void AccountView::slotLeftButton(int, QListViewItem *,const QPoint&,int)
94{ 103{
95 m_rightPressed = false; 104 m_rightPressed = false;
96} 105}
97 106
98void AccountView::slotMouseClicked(QListViewItem*item) 107void AccountView::slotMouseClicked(QListViewItem*item)
99{ 108{
100 if (m_rightPressed) return; 109 if (m_rightPressed) return;
101 if (!item || m_currentItem == item) return; 110 if (!item || m_currentItem == item||!m_clickopens) return;
102 /* ### ToDo check settings if on single tab it should open */ 111 /* ### ToDo check settings if on single tab it should open */
103 m_currentItem = item; 112 m_currentItem = item;
104 refresh(m_currentItem); 113 refresh(m_currentItem);
105} 114}
106 115
107void AccountView::slotMouseButton(int button, QListViewItem * item,const QPoint&pos,int column) 116void AccountView::slotMouseButton(int button, QListViewItem * item,const QPoint&pos,int column)
108{ 117{
109 if (button==1) { 118 if (button==1) {
110 slotLeftButton(button,item,pos,column); 119 slotLeftButton(button,item,pos,column);
111 } else if (button==2) { 120 } else if (button==2) {
112 slotRightButton(button,item,pos,column); 121 slotRightButton(button,item,pos,column);
113 } 122 }
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h
index 5c4b559..418f4f3 100644
--- a/noncore/net/mail/accountview.h
+++ b/noncore/net/mail/accountview.h
@@ -24,35 +24,37 @@ public:
24 virtual void populate( QList<Account> list ); 24 virtual void populate( QList<Account> list );
25 virtual RecBodyP fetchBody(const Opie::Core::OSmartPointer<RecMail>&aMail); 25 virtual RecBodyP fetchBody(const Opie::Core::OSmartPointer<RecMail>&aMail);
26 virtual void downloadMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper); 26 virtual void downloadMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper);
27 virtual bool currentisDraft(); 27 virtual bool currentisDraft();
28 QMap<int,QString> currentServerMenu()const; 28 QMap<int,QString> currentServerMenu()const;
29 QMap<int,QString> currentFolderMenu()const; 29 QMap<int,QString> currentFolderMenu()const;
30 30
31public slots: 31public slots:
32 virtual void refreshAll(); 32 virtual void refreshAll();
33 virtual void refresh(QListViewItem *item); 33 virtual void refresh(QListViewItem *item);
34 virtual void refreshCurrent(); 34 virtual void refreshCurrent();
35 virtual void slotContextMenu(int id); 35 virtual void slotContextMenu(int id);
36 virtual void readSettings();
36 37
37 void setupFolderselect(Selectstore*sels); 38 void setupFolderselect(Selectstore*sels);
38 39
39signals: 40signals:
40 void refreshMailview(const QValueList<RecMailP>& ); 41 void refreshMailview(const QValueList<RecMailP>& );
41 void serverSelected(int); 42 void serverSelected(int);
42 void refreshMenues(int); 43 void refreshMenues(int);
43 44
44protected: 45protected:
45 QListViewItem* m_currentItem; 46 QListViewItem* m_currentItem;
46 QValueList<IMAPviewItem*> imapAccounts; 47 QValueList<IMAPviewItem*> imapAccounts;
47 QValueList<MHviewItem*> mhAccounts; 48 QValueList<MHviewItem*> mhAccounts;
48 bool m_rightPressed:1; 49 bool m_rightPressed:1;
50 bool m_clickopens:1;
49 51
50protected slots: 52protected slots:
51 virtual void slotRightButton(int, QListViewItem *,const QPoint&,int); 53 virtual void slotRightButton(int, QListViewItem *,const QPoint&,int);
52 virtual void slotLeftButton(int, QListViewItem *,const QPoint&,int); 54 virtual void slotLeftButton(int, QListViewItem *,const QPoint&,int);
53 virtual void slotMouseButton(int, QListViewItem *,const QPoint&,int); 55 virtual void slotMouseButton(int, QListViewItem *,const QPoint&,int);
54 virtual void slotMouseClicked(QListViewItem*); 56 virtual void slotMouseClicked(QListViewItem*);
55 virtual void slotSelectionChanged(QListViewItem*); 57 virtual void slotSelectionChanged(QListViewItem*);
56}; 58};
57 59
58#endif 60#endif
diff --git a/noncore/net/mail/defines.h b/noncore/net/mail/defines.h
index 5fcbf0f..50d63dd 100644
--- a/noncore/net/mail/defines.h
+++ b/noncore/net/mail/defines.h
@@ -8,32 +8,34 @@
8#define PIC_COMPOSEMAIL "mail/composemail" 8#define PIC_COMPOSEMAIL "mail/composemail"
9#define PIC_SENDQUEUED "mail/sendqueued" 9#define PIC_SENDQUEUED "mail/sendqueued"
10#define PIC_SHOWFOLDERS "mail/showfolders" 10#define PIC_SHOWFOLDERS "mail/showfolders"
11#define PIC_SYNC "mail/sync" 11#define PIC_SYNC "mail/sync"
12#define PIC_IMAPFOLDER "mail/imapfolder" 12#define PIC_IMAPFOLDER "mail/imapfolder"
13#define PIC_MBOXFOLDER "mail/mboxfolder" 13#define PIC_MBOXFOLDER "mail/mboxfolder"
14#define PIC_POP3FOLDER "mail/pop3folder" 14#define PIC_POP3FOLDER "mail/pop3folder"
15#define PIC_INBOXFOLDER "mail/inbox" 15#define PIC_INBOXFOLDER "mail/inbox"
16#define PIC_OUTBOXFOLDER "mail/outbox" 16#define PIC_OUTBOXFOLDER "mail/outbox"
17#define PIC_LOCALFOLDER "mail/localfolder" 17#define PIC_LOCALFOLDER "mail/localfolder"
18 18
19#define PIC_OFFLINE "mail/notconnected" 19#define PIC_OFFLINE "mail/notconnected"
20#define PIC_DOCUMENT "DocsIcon"
20 21
21#define ICON_COMPOSEMAIL QIconSet( Resource::loadPixmap( PIC_COMPOSEMAIL ) ) 22#define ICON_COMPOSEMAIL QIconSet( Resource::loadPixmap( PIC_COMPOSEMAIL ) )
22#define ICON_SENDQUEUED QIconSet( Resource::loadPixmap( PIC_SENDQUEUED ) ) 23#define ICON_SENDQUEUED QIconSet( Resource::loadPixmap( PIC_SENDQUEUED ) )
23#define ICON_SHOWFOLDERS QIconSet( Resource::loadPixmap( PIC_SHOWFOLDERS ) ) 24#define ICON_SHOWFOLDERS QIconSet( Resource::loadPixmap( PIC_SHOWFOLDERS ) )
24#define ICON_SEARCHMAILS QIconSet( Resource::loadPixmap( PIC_SEARCHMAILS ) ) 25#define ICON_SEARCHMAILS QIconSet( Resource::loadPixmap( PIC_SEARCHMAILS ) )
25#define ICON_EDITSETTINGS QIconSet( Resource::loadPixmap( PIC_EDITSETTINGS ) ) 26#define ICON_EDITSETTINGS QIconSet( Resource::loadPixmap( PIC_EDITSETTINGS ) )
26#define ICON_EDITACCOUNTS QIconSet( Resource::loadPixmap( PIC_EDITACCOUNTS ) ) 27#define ICON_EDITACCOUNTS QIconSet( Resource::loadPixmap( PIC_EDITACCOUNTS ) )
27#define ICON_SYNC QIconSet( Resource::loadPixmap( PIC_SYNC ) ) 28#define ICON_SYNC QIconSet( Resource::loadPixmap( PIC_SYNC ) )
29#define ICON_READMAIL QIconSet( Resource::loadPixmap( PIC_DOCUMENT))
28 30
29#define PIXMAP_IMAPFOLDER QPixmap( Resource::loadPixmap( PIC_IMAPFOLDER ) ) 31#define PIXMAP_IMAPFOLDER QPixmap( Resource::loadPixmap( PIC_IMAPFOLDER ) )
30#define PIXMAP_POP3FOLDER QPixmap( Resource::loadPixmap( PIC_POP3FOLDER ) ) 32#define PIXMAP_POP3FOLDER QPixmap( Resource::loadPixmap( PIC_POP3FOLDER ) )
31#define PIXMAP_INBOXFOLDER QPixmap( Resource::loadPixmap( PIC_INBOXFOLDER) ) 33#define PIXMAP_INBOXFOLDER QPixmap( Resource::loadPixmap( PIC_INBOXFOLDER) )
32#define PIXMAP_MBOXFOLDER QPixmap( Resource::loadPixmap( PIC_MBOXFOLDER ) ) 34#define PIXMAP_MBOXFOLDER QPixmap( Resource::loadPixmap( PIC_MBOXFOLDER ) )
33#define PIXMAP_OUTBOXFOLDER QPixmap( Resource::loadPixmap( PIC_OUTBOXFOLDER) ) 35#define PIXMAP_OUTBOXFOLDER QPixmap( Resource::loadPixmap( PIC_OUTBOXFOLDER) )
34#define PIXMAP_LOCALFOLDER QPixmap( Resource::loadPixmap( PIC_LOCALFOLDER) ) 36#define PIXMAP_LOCALFOLDER QPixmap( Resource::loadPixmap( PIC_LOCALFOLDER) )
35#define PIXMAP_OFFLINE QPixmap( Resource::loadPixmap( PIC_OFFLINE) ) 37#define PIXMAP_OFFLINE QPixmap( Resource::loadPixmap( PIC_OFFLINE) )
36 38
37#define IMAP_PORT "143" 39#define IMAP_PORT "143"
38#define IMAP_SSL_PORT "993" 40#define IMAP_SSL_PORT "993"
39#define SMTP_PORT "25" 41#define SMTP_PORT "25"
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index 3689352..b587424 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -54,29 +54,35 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
54 folderMenu->insertItem(tr("Delete folder"),FOLDER_MENU_DELETE_FOLDER); 54 folderMenu->insertItem(tr("Delete folder"),FOLDER_MENU_DELETE_FOLDER);
55 folderMenu->insertItem(tr("Move/Copie all mails"),FOLDER_MENU_MOVE_MAILS); 55 folderMenu->insertItem(tr("Move/Copie all mails"),FOLDER_MENU_MOVE_MAILS);
56 menuBar->setItemEnabled(m_ServerMenuId,false); 56 menuBar->setItemEnabled(m_ServerMenuId,false);
57 menuBar->setItemEnabled(m_FolderMenuId,false); 57 menuBar->setItemEnabled(m_FolderMenuId,false);
58 58
59 addToolBar( toolBar ); 59 addToolBar( toolBar );
60 toolBar->setHorizontalStretchable( true ); 60 toolBar->setHorizontalStretchable( true );
61 61
62 QLabel *spacer = new QLabel( toolBar ); 62 QLabel *spacer = new QLabel( toolBar );
63 spacer->setBackgroundMode( QWidget::PaletteButton ); 63 spacer->setBackgroundMode( QWidget::PaletteButton );
64 toolBar->setStretchableWidget( spacer ); 64 toolBar->setStretchableWidget( spacer );
65 65
66 readMail = new QAction(tr("Read current mail"),ICON_READMAIL,0,0,this);
67 readMail->addTo(toolBar);
68 readMail->addTo(mailMenu);
69 connect(readMail,SIGNAL(activated()),this,SLOT(displayMail()));
70
66 composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, 71 composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL,
67 0, 0, this ); 72 0, 0, this );
68 composeMail->addTo( toolBar ); 73 composeMail->addTo( toolBar );
69 composeMail->addTo( mailMenu ); 74 composeMail->addTo( mailMenu );
70 75
76
71 sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, 77 sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED,
72 0, 0, this ); 78 0, 0, this );
73 sendQueued->addTo( toolBar ); 79 sendQueued->addTo( toolBar );
74 sendQueued->addTo( mailMenu ); 80 sendQueued->addTo( mailMenu );
75 81
76 /* 82 /*
77 syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, 83 syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC,
78 0, 0, this ); 84 0, 0, this );
79 syncFolders->addTo( toolBar ); 85 syncFolders->addTo( toolBar );
80 syncFolders->addTo( mailMenu ); 86 syncFolders->addTo( mailMenu );
81 */ 87 */
82 88
@@ -113,24 +119,25 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
113 119
114 QWidget *view = new QWidget( this ); 120 QWidget *view = new QWidget( this );
115 setCentralWidget( view ); 121 setCentralWidget( view );
116 layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); 122 layout = new QBoxLayout ( view, QBoxLayout::LeftToRight );
117 123
118 folderView = new AccountView( view ); 124 folderView = new AccountView( view );
119 folderView->header()->hide(); 125 folderView->header()->hide();
120 folderView->setRootIsDecorated( true ); 126 folderView->setRootIsDecorated( true );
121 folderView->addColumn( tr( "Mailbox" ) ); 127 folderView->addColumn( tr( "Mailbox" ) );
122 connect(folderView,SIGNAL(serverSelected(int)),this,SLOT(serverSelected(int))); 128 connect(folderView,SIGNAL(serverSelected(int)),this,SLOT(serverSelected(int)));
123 connect(serverMenu,SIGNAL(activated(int)),folderView,SLOT(slotContextMenu(int))); 129 connect(serverMenu,SIGNAL(activated(int)),folderView,SLOT(slotContextMenu(int)));
124 connect(folderMenu,SIGNAL(activated(int)),folderView,SLOT(slotContextMenu(int))); 130 connect(folderMenu,SIGNAL(activated(int)),folderView,SLOT(slotContextMenu(int)));
131 connect(this,SIGNAL(settingsChanged()),folderView,SLOT(readSettings()));
125 132
126 133
127 layout->addWidget( folderView ); 134 layout->addWidget( folderView );
128 135
129 mailView = new QListView( view ); 136 mailView = new QListView( view );
130 mailView->addColumn( "" ); 137 mailView->addColumn( "" );
131 mailView->addColumn( tr( "Subject" ),QListView::Manual ); 138 mailView->addColumn( tr( "Subject" ),QListView::Manual );
132 mailView->addColumn( tr( "Sender" ),QListView::Manual ); 139 mailView->addColumn( tr( "Sender" ),QListView::Manual );
133 mailView->addColumn( tr( "Size" ),QListView::Manual); 140 mailView->addColumn( tr( "Size" ),QListView::Manual);
134 mailView->addColumn( tr( "Date" )); 141 mailView->addColumn( tr( "Date" ));
135 mailView->setAllColumnsShowFocus(true); 142 mailView->setAllColumnsShowFocus(true);
136 mailView->setShowSortIndicator(true); 143 mailView->setShowSortIndicator(true);
diff --git a/noncore/net/mail/mainwindow.h b/noncore/net/mail/mainwindow.h
index b781d62..6449ce8 100644
--- a/noncore/net/mail/mainwindow.h
+++ b/noncore/net/mail/mainwindow.h
@@ -40,22 +40,24 @@ protected slots:
40 virtual void mailHold(int, QListViewItem *,const QPoint&,int); 40 virtual void mailHold(int, QListViewItem *,const QPoint&,int);
41 virtual void slotAdjustLayout(); 41 virtual void slotAdjustLayout();
42 virtual void slotEditSettings(); 42 virtual void slotEditSettings();
43 virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int ); 43 virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int );
44 virtual void serverSelected(int); 44 virtual void serverSelected(int);
45 45
46protected: 46protected:
47 QToolBar *toolBar; 47 QToolBar *toolBar;
48 QMenuBar *menuBar; 48 QMenuBar *menuBar;
49 QPopupMenu *mailMenu, *settingsMenu,*serverMenu,*folderMenu; 49 QPopupMenu *mailMenu, *settingsMenu,*serverMenu,*folderMenu;
50 50
51 QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, 51 QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails,
52 *editSettings, *editAccounts, *syncFolders; 52 *editSettings, *editAccounts, *syncFolders,*readMail;
53 AccountView *folderView; 53 AccountView *folderView;
54 QListView *mailView; 54 QListView *mailView;
55 QBoxLayout *layout; 55 QBoxLayout *layout;
56 int m_Rotate; 56 int m_Rotate;
57 QCopChannel* m_sysChannel; 57 QCopChannel* m_sysChannel;
58 int m_ServerMenuId,m_FolderMenuId; 58 int m_ServerMenuId,m_FolderMenuId;
59signals:
60 void settingsChanged();
59}; 61};
60 62
61#endif 63#endif
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
26using namespace Opie::Core; 27using namespace Opie::Core;
27 28
28typedef QMapNode<QString,QString> tkeyvalues; 29typedef QMapNode<QString,QString> tkeyvalues;
29typedef QValueList<tkeyvalues> tvaluelist; 30typedef 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
105OpieMail::OpieMail( QWidget *parent, const char *name, WFlags ) 106OpieMail::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
114OpieMail::~OpieMail() 119OpieMail::~OpieMail()
115{ 120{
116 if (settings) delete settings; 121 if (settings) delete settings;
117} 122}
118 123
119void OpieMail::setup_signalblocking() 124void OpieMail::setup_signalblocking()
120{ 125{
@@ -225,25 +230,30 @@ void OpieMail::slotSendQueued()
225 delete wrap; 230 delete wrap;
226 } 231 }
227} 232}
228 233
229void OpieMail::slotSearchMails() 234void OpieMail::slotSearchMails()
230{ 235{
231 odebug << "Search Mails" << oendl; 236 odebug << "Search Mails" << oendl;
232} 237}
233 238
234void OpieMail::slotEditSettings() 239void 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
240void OpieMail::slotEditAccounts() 250void 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
343void OpieMail::mailLeftClicked(int button, QListViewItem *item,const QPoint&,int ) 353void 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
355void OpieMail::slotMoveCopyMail() 366void OpieMail::slotMoveCopyMail()
356{ 367{
diff --git a/noncore/net/mail/opiemail.h b/noncore/net/mail/opiemail.h
index 75a0b2d..327bef7 100644
--- a/noncore/net/mail/opiemail.h
+++ b/noncore/net/mail/opiemail.h
@@ -34,18 +34,21 @@ protected slots:
34 virtual void mailHold(int, QListViewItem *,const QPoint&,int); 34 virtual void mailHold(int, QListViewItem *,const QPoint&,int);
35 virtual void slotShowFolders( bool show ); 35 virtual void slotShowFolders( bool show );
36 virtual void refreshMailView(const QValueList<RecMailP>&); 36 virtual void refreshMailView(const QValueList<RecMailP>&);
37 virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int ); 37 virtual void mailLeftClicked( int, QListViewItem *,const QPoint&,int );
38 virtual void slotMoveCopyMail(); 38 virtual void slotMoveCopyMail();
39 virtual void reEditMail(); 39 virtual void reEditMail();
40 virtual void serverSelected(int); 40 virtual void serverSelected(int);
41 virtual void refreshMenu(int); 41 virtual void refreshMenu(int);
42 42
43protected: 43protected:
44 void setup_signalblocking(); 44 void setup_signalblocking();
45 45
46 bool m_clickopens:1;
47
46private: 48private:
47 Settings *settings; 49 Settings *settings;
50signals:
48 51
49}; 52};
50 53
51#endif 54#endif
diff --git a/noncore/net/mail/settingsdialog.cpp b/noncore/net/mail/settingsdialog.cpp
index 6441948..74b8b12 100644
--- a/noncore/net/mail/settingsdialog.cpp
+++ b/noncore/net/mail/settingsdialog.cpp
@@ -11,37 +11,41 @@ SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, W
11 11
12 readConfig(); 12 readConfig();
13} 13}
14 14
15SettingsDialog::~SettingsDialog() { 15SettingsDialog::~SettingsDialog() {
16 16
17} 17}
18 18
19void SettingsDialog::readConfig() { 19void SettingsDialog::readConfig() {
20 Config cfg("mail"); 20 Config cfg("mail");
21 cfg.setGroup( "Settings" ); 21 cfg.setGroup( "Settings" );
22 showHtmlButton->setChecked( cfg.readBoolEntry( "showHtml", false ) ); 22 showHtmlButton->setChecked( cfg.readBoolEntry( "showHtml", false ) );
23 clickOpenMailButton->setChecked(cfg.readBoolEntry("clickOpensMail",true));
24 clickOpenFolderButton->setChecked(cfg.readBoolEntry("clickOpensFolder",true));
23 cfg.setGroup( "Compose" ); 25 cfg.setGroup( "Compose" );
24 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); 26 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) );
25 cfg.setGroup( "Applet" ); 27 cfg.setGroup( "Applet" );
26 cbEnableTaskbarApplet->setChecked( cfg.readBoolEntry( "Disabled", false ) ); 28 cbEnableTaskbarApplet->setChecked( cfg.readBoolEntry( "Disabled", false ) );
27 spCheckOften->setValue( cfg.readNumEntry( "CheckEvery", 5 ) ); 29 spCheckOften->setValue( cfg.readNumEntry( "CheckEvery", 5 ) );
28 cbBlinkLed->setChecked( cfg.readBoolEntry( "BlinkLed", true ) ); 30 cbBlinkLed->setChecked( cfg.readBoolEntry( "BlinkLed", true ) );
29 cbPlaySound->setChecked( cfg.readBoolEntry( "PlaySound", false ) ); 31 cbPlaySound->setChecked( cfg.readBoolEntry( "PlaySound", false ) );
30 32
31} 33}
32 34
33void SettingsDialog::writeConfig() { 35void SettingsDialog::writeConfig() {
34 Config cfg( "mail" ); 36 Config cfg( "mail" );
35 cfg.setGroup( "Settings" ); 37 cfg.setGroup( "Settings" );
38 cfg.writeEntry("clickOpensMail",clickOpenMailButton->isChecked());
39 cfg.writeEntry("clickOpensFolder",clickOpenFolderButton->isChecked());
36 cfg.writeEntry( "showHtml", showHtmlButton->isChecked() ); 40 cfg.writeEntry( "showHtml", showHtmlButton->isChecked() );
37 cfg.setGroup( "Compose" ); 41 cfg.setGroup( "Compose" );
38 cfg.writeEntry( "sendLater", checkBoxLater->isChecked() ); 42 cfg.writeEntry( "sendLater", checkBoxLater->isChecked() );
39 cfg.setGroup( "Applet" ); 43 cfg.setGroup( "Applet" );
40 cfg.writeEntry( "Disabled", cbEnableTaskbarApplet->isChecked() ); 44 cfg.writeEntry( "Disabled", cbEnableTaskbarApplet->isChecked() );
41 int check = spCheckOften->value(); 45 int check = spCheckOften->value();
42 if (check<1)check=1;if (check>99)check=99; 46 if (check<1)check=1;if (check>99)check=99;
43 cfg.writeEntry( "CheckEvery", check); 47 cfg.writeEntry( "CheckEvery", check);
44 cfg.writeEntry( "BlinkLed", cbBlinkLed->isChecked() ); 48 cfg.writeEntry( "BlinkLed", cbBlinkLed->isChecked() );
45 cfg.writeEntry( "PlaySound", cbPlaySound->isChecked() ); 49 cfg.writeEntry( "PlaySound", cbPlaySound->isChecked() );
46} 50}
47 51
diff --git a/noncore/net/mail/settingsdialogui.ui b/noncore/net/mail/settingsdialogui.ui
index 4acd84a..0a97da0 100644
--- a/noncore/net/mail/settingsdialogui.ui
+++ b/noncore/net/mail/settingsdialogui.ui
@@ -2,26 +2,26 @@
2<class>SettingsDialogUI</class> 2<class>SettingsDialogUI</class>
3<widget> 3<widget>
4 <class>QDialog</class> 4 <class>QDialog</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>SettingsDialogUI</cstring> 7 <cstring>SettingsDialogUI</cstring>
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>312</width> 14 <width>304</width>
15 <height>379</height> 15 <height>378</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Settings Dialog</string> 20 <string>Settings Dialog</string>
21 </property> 21 </property>
22 <property> 22 <property>
23 <name>layoutMargin</name> 23 <name>layoutMargin</name>
24 </property> 24 </property>
25 <property> 25 <property>
26 <name>layoutSpacing</name> 26 <name>layoutSpacing</name>
27 </property> 27 </property>
@@ -50,41 +50,63 @@
50 <class>QWidget</class> 50 <class>QWidget</class>
51 <property stdset="1"> 51 <property stdset="1">
52 <name>name</name> 52 <name>name</name>
53 <cstring>tab</cstring> 53 <cstring>tab</cstring>
54 </property> 54 </property>
55 <attribute> 55 <attribute>
56 <name>title</name> 56 <name>title</name>
57 <string>View Mail</string> 57 <string>View Mail</string>
58 </attribute> 58 </attribute>
59 <vbox> 59 <vbox>
60 <property stdset="1"> 60 <property stdset="1">
61 <name>margin</name> 61 <name>margin</name>
62 <number>3</number> 62 <number>11</number>
63 </property> 63 </property>
64 <property stdset="1"> 64 <property stdset="1">
65 <name>spacing</name> 65 <name>spacing</name>
66 <number>3</number> 66 <number>6</number>
67 </property> 67 </property>
68 <widget> 68 <widget>
69 <class>QCheckBox</class> 69 <class>QCheckBox</class>
70 <property stdset="1"> 70 <property stdset="1">
71 <name>name</name> 71 <name>name</name>
72 <cstring>showHtmlButton</cstring> 72 <cstring>showHtmlButton</cstring>
73 </property> 73 </property>
74 <property stdset="1"> 74 <property stdset="1">
75 <name>text</name> 75 <name>text</name>
76 <string>View mail as Html</string> 76 <string>View mail as Html</string>
77 </property> 77 </property>
78 </widget> 78 </widget>
79 <widget>
80 <class>QCheckBox</class>
81 <property stdset="1">
82 <name>name</name>
83 <cstring>clickOpenMailButton</cstring>
84 </property>
85 <property stdset="1">
86 <name>text</name>
87 <string>Click opens mail</string>
88 </property>
89 </widget>
90 <widget>
91 <class>QCheckBox</class>
92 <property stdset="1">
93 <name>name</name>
94 <cstring>clickOpenFolderButton</cstring>
95 </property>
96 <property stdset="1">
97 <name>text</name>
98 <string>Click activate server/folder</string>
99 </property>
100 </widget>
79 <spacer> 101 <spacer>
80 <property> 102 <property>
81 <name>name</name> 103 <name>name</name>
82 <cstring>Spacer1</cstring> 104 <cstring>Spacer1</cstring>
83 </property> 105 </property>
84 <property stdset="1"> 106 <property stdset="1">
85 <name>orientation</name> 107 <name>orientation</name>
86 <enum>Vertical</enum> 108 <enum>Vertical</enum>
87 </property> 109 </property>
88 <property stdset="1"> 110 <property stdset="1">
89 <name>sizeType</name> 111 <name>sizeType</name>
90 <enum>Expanding</enum> 112 <enum>Expanding</enum>