author | alwin <alwin> | 2005-03-20 00:12:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-20 00:12:11 (UTC) |
commit | bde8cf28573964aeb78fa9785cf1514cb8aa35a7 (patch) (side-by-side diff) | |
tree | e91895f42ea3f9f5ac3d77128b8715b359ab54bf | |
parent | 9b608c7c967b2a22d4c6a8d8b98a4635d3b21204 (diff) | |
download | opie-bde8cf28573964aeb78fa9785cf1514cb8aa35a7.zip opie-bde8cf28573964aeb78fa9785cf1514cb8aa35a7.tar.gz opie-bde8cf28573964aeb78fa9785cf1514cb8aa35a7.tar.bz2 |
user may switch open folders/mails on single-click
-rw-r--r-- | noncore/net/mail/accountview.cpp | 11 | ||||
-rw-r--r-- | noncore/net/mail/accountview.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/defines.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 7 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.h | 4 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 13 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.h | 3 | ||||
-rw-r--r-- | noncore/net/mail/settingsdialog.cpp | 4 | ||||
-rw-r--r-- | noncore/net/mail/settingsdialogui.ui | 30 |
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 @@ -13,2 +13,3 @@ #include <qpe/qpeapplication.h> +#include <qpe/config.h> @@ -33,2 +34,3 @@ AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) m_currentItem = 0; + readSettings(); } @@ -41,2 +43,9 @@ AccountView::~AccountView() +void AccountView::readSettings() +{ + Config cfg("mail"); + cfg.setGroup( "Settings" ); + m_clickopens = cfg.readBoolEntry("clickOpensFolder",true); +} + void AccountView::slotSelectionChanged(QListViewItem*item) @@ -100,3 +109,3 @@ void AccountView::slotMouseClicked(QListViewItem*item) if (m_rightPressed) return; - if (!item || m_currentItem == item) return; + if (!item || m_currentItem == item||!m_clickopens) return; /* ### ToDo check settings if on single tab it should open */ 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 @@ -35,2 +35,3 @@ public slots: virtual void slotContextMenu(int id); + virtual void readSettings(); @@ -48,2 +49,3 @@ protected: bool m_rightPressed:1; + bool m_clickopens:1; 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 @@ -19,2 +19,3 @@ #define PIC_OFFLINE "mail/notconnected" +#define PIC_DOCUMENT "DocsIcon" @@ -27,2 +28,3 @@ #define ICON_SYNC QIconSet( Resource::loadPixmap( PIC_SYNC ) ) +#define ICON_READMAIL QIconSet( Resource::loadPixmap( PIC_DOCUMENT)) 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 @@ -65,2 +65,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) + readMail = new QAction(tr("Read current mail"),ICON_READMAIL,0,0,this); + readMail->addTo(toolBar); + readMail->addTo(mailMenu); + connect(readMail,SIGNAL(activated()),this,SLOT(displayMail())); + composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, @@ -70,2 +75,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) + sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, @@ -124,2 +130,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) connect(folderMenu,SIGNAL(activated(int)),folderView,SLOT(slotContextMenu(int))); + connect(this,SIGNAL(settingsChanged()),folderView,SLOT(readSettings())); 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 @@ -51,3 +51,3 @@ protected: QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, - *editSettings, *editAccounts, *syncFolders; + *editSettings, *editAccounts, *syncFolders,*readMail; AccountView *folderView; @@ -58,2 +58,4 @@ protected: int m_ServerMenuId,m_FolderMenuId; +signals: + void settingsChanged(); }; 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 @@ -17,2 +17,3 @@ #include <qpe/qpeapplication.h> +#include <qpe/config.h> @@ -108,2 +109,6 @@ OpieMail::OpieMail( QWidget *parent, const char *name, WFlags ) setup_signalblocking(); + Config cfg("mail"); + cfg.setGroup( "Settings" ); + m_clickopens = cfg.readBoolEntry("clickOpensMail",true); + settings = new Settings(); @@ -236,3 +241,8 @@ void OpieMail::slotEditSettings() SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp ); - QPEApplication::execDialog( &settingsDialog ); + if (QPEApplication::execDialog( &settingsDialog )) { + Config cfg("mail"); + cfg.setGroup( "Settings" ); + m_clickopens = cfg.readBoolEntry("clickOpensMail",true); + emit settingsChanged(); + } } @@ -344,2 +354,3 @@ void OpieMail::mailLeftClicked(int button, QListViewItem *item,const QPoint&,int { + if (!m_clickopens) return; /* just LEFT button - or tap with stylus on pda */ 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 @@ -45,4 +45,7 @@ protected: + bool m_clickopens:1; + private: Settings *settings; +signals: 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 @@ -22,2 +22,4 @@ void SettingsDialog::readConfig() { showHtmlButton->setChecked( cfg.readBoolEntry( "showHtml", false ) ); + clickOpenMailButton->setChecked(cfg.readBoolEntry("clickOpensMail",true)); + clickOpenFolderButton->setChecked(cfg.readBoolEntry("clickOpensFolder",true)); cfg.setGroup( "Compose" ); @@ -35,2 +37,4 @@ void SettingsDialog::writeConfig() { cfg.setGroup( "Settings" ); + cfg.writeEntry("clickOpensMail",clickOpenMailButton->isChecked()); + cfg.writeEntry("clickOpensFolder",clickOpenFolderButton->isChecked()); cfg.writeEntry( "showHtml", showHtmlButton->isChecked() ); 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 @@ -13,4 +13,4 @@ <y>0</y> - <width>312</width> - <height>379</height> + <width>304</width> + <height>378</height> </rect> @@ -61,3 +61,3 @@ <name>margin</name> - <number>3</number> + <number>11</number> </property> @@ -65,3 +65,3 @@ <name>spacing</name> - <number>3</number> + <number>6</number> </property> @@ -78,2 +78,24 @@ </widget> + <widget> + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>clickOpenMailButton</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Click opens mail</string> + </property> + </widget> + <widget> + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>clickOpenFolderButton</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Click activate server/folder</string> + </property> + </widget> <spacer> |