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 /noncore | |
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 @@ -10,8 +10,9 @@ /* OPIE */ #include <opie2/odebug.h> #include <qpe/qpeapplication.h> +#include <qpe/config.h> /* QT */ #include <qmessagebox.h> #include <qpopupmenu.h> @@ -30,16 +31,24 @@ AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) SLOT( slotMouseButton(int,QListViewItem*,const QPoint&,int) ) ); connect( this, SIGNAL(clicked(QListViewItem*) ),this, SLOT( slotMouseClicked(QListViewItem*) ) ); m_currentItem = 0; + readSettings(); } AccountView::~AccountView() { imapAccounts.clear(); mhAccounts.clear(); } +void AccountView::readSettings() +{ + Config cfg("mail"); + cfg.setGroup( "Settings" ); + m_clickopens = cfg.readBoolEntry("clickOpensFolder",true); +} + void AccountView::slotSelectionChanged(QListViewItem*item) { if (!item) { emit serverSelected(0); @@ -97,9 +106,9 @@ void AccountView::slotLeftButton(int, QListViewItem *,const QPoint&,int) 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 */ m_currentItem = item; refresh(m_currentItem); } 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 @@ -32,8 +32,9 @@ public slots: virtual void refreshAll(); virtual void refresh(QListViewItem *item); virtual void refreshCurrent(); virtual void slotContextMenu(int id); + virtual void readSettings(); void setupFolderselect(Selectstore*sels); signals: @@ -45,8 +46,9 @@ protected: QListViewItem* m_currentItem; QValueList<IMAPviewItem*> imapAccounts; QValueList<MHviewItem*> mhAccounts; bool m_rightPressed:1; + bool m_clickopens:1; protected slots: virtual void slotRightButton(int, QListViewItem *,const QPoint&,int); virtual void slotLeftButton(int, QListViewItem *,const QPoint&,int); 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 @@ -16,16 +16,18 @@ #define PIC_OUTBOXFOLDER "mail/outbox" #define PIC_LOCALFOLDER "mail/localfolder" #define PIC_OFFLINE "mail/notconnected" +#define PIC_DOCUMENT "DocsIcon" #define ICON_COMPOSEMAIL QIconSet( Resource::loadPixmap( PIC_COMPOSEMAIL ) ) #define ICON_SENDQUEUED QIconSet( Resource::loadPixmap( PIC_SENDQUEUED ) ) #define ICON_SHOWFOLDERS QIconSet( Resource::loadPixmap( PIC_SHOWFOLDERS ) ) #define ICON_SEARCHMAILS QIconSet( Resource::loadPixmap( PIC_SEARCHMAILS ) ) #define ICON_EDITSETTINGS QIconSet( Resource::loadPixmap( PIC_EDITSETTINGS ) ) #define ICON_EDITACCOUNTS QIconSet( Resource::loadPixmap( PIC_EDITACCOUNTS ) ) #define ICON_SYNC QIconSet( Resource::loadPixmap( PIC_SYNC ) ) +#define ICON_READMAIL QIconSet( Resource::loadPixmap( PIC_DOCUMENT)) #define PIXMAP_IMAPFOLDER QPixmap( Resource::loadPixmap( PIC_IMAPFOLDER ) ) #define PIXMAP_POP3FOLDER QPixmap( Resource::loadPixmap( PIC_POP3FOLDER ) ) #define PIXMAP_INBOXFOLDER QPixmap( Resource::loadPixmap( PIC_INBOXFOLDER) ) 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 @@ -62,13 +62,19 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) QLabel *spacer = new QLabel( toolBar ); spacer->setBackgroundMode( QWidget::PaletteButton ); toolBar->setStretchableWidget( spacer ); + 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, 0, 0, this ); composeMail->addTo( toolBar ); composeMail->addTo( mailMenu ); + sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, 0, 0, this ); sendQueued->addTo( toolBar ); sendQueued->addTo( mailMenu ); @@ -121,8 +127,9 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) folderView->addColumn( tr( "Mailbox" ) ); connect(folderView,SIGNAL(serverSelected(int)),this,SLOT(serverSelected(int))); connect(serverMenu,SIGNAL(activated(int)),folderView,SLOT(slotContextMenu(int))); connect(folderMenu,SIGNAL(activated(int)),folderView,SLOT(slotContextMenu(int))); + connect(this,SIGNAL(settingsChanged()),folderView,SLOT(readSettings())); layout->addWidget( folderView ); 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 @@ -48,14 +48,16 @@ protected: QMenuBar *menuBar; QPopupMenu *mailMenu, *settingsMenu,*serverMenu,*folderMenu; QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, - *editSettings, *editAccounts, *syncFolders; + *editSettings, *editAccounts, *syncFolders,*readMail; AccountView *folderView; QListView *mailView; QBoxLayout *layout; int m_Rotate; QCopChannel* m_sysChannel; int m_ServerMenuId,m_FolderMenuId; +signals: + void settingsChanged(); }; #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 @@ -14,8 +14,9 @@ /* OPIE */ #include <opie2/odebug.h> #include <qpe/resource.h> #include <qpe/qpeapplication.h> +#include <qpe/config.h> /* QT */ #include <qmap.h> #include <qvaluelist.h> @@ -105,8 +106,12 @@ void ValueExplode::splitit() OpieMail::OpieMail( QWidget *parent, const char *name, WFlags ) : MainWindow( parent, name, WStyle_ContextHelp ) { setup_signalblocking(); + Config cfg("mail"); + cfg.setGroup( "Settings" ); + m_clickopens = cfg.readBoolEntry("clickOpensMail",true); + settings = new Settings(); folderView->populate( settings->getAccounts() ); connect(folderView,SIGNAL(refreshMenues(int)),this,SLOT(refreshMenu(int))); } @@ -233,9 +238,14 @@ void OpieMail::slotSearchMails() 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(); + } } void OpieMail::slotEditAccounts() { @@ -341,8 +351,9 @@ void OpieMail::refreshMailView(const QValueList<RecMailP>&list) } void OpieMail::mailLeftClicked(int button, QListViewItem *item,const QPoint&,int ) { + if (!m_clickopens) return; /* just LEFT button - or tap with stylus on pda */ if (button!=1) return; if (!item) return; if (folderView->currentisDraft()) { 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 @@ -42,10 +42,13 @@ protected slots: protected: void setup_signalblocking(); + bool m_clickopens:1; + private: Settings *settings; +signals: }; #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 @@ -19,8 +19,10 @@ SettingsDialog::~SettingsDialog() { void SettingsDialog::readConfig() { Config cfg("mail"); cfg.setGroup( "Settings" ); showHtmlButton->setChecked( cfg.readBoolEntry( "showHtml", false ) ); + clickOpenMailButton->setChecked(cfg.readBoolEntry("clickOpensMail",true)); + clickOpenFolderButton->setChecked(cfg.readBoolEntry("clickOpensFolder",true)); cfg.setGroup( "Compose" ); checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); cfg.setGroup( "Applet" ); cbEnableTaskbarApplet->setChecked( cfg.readBoolEntry( "Disabled", false ) ); @@ -32,8 +34,10 @@ void SettingsDialog::readConfig() { void SettingsDialog::writeConfig() { Config cfg( "mail" ); cfg.setGroup( "Settings" ); + cfg.writeEntry("clickOpensMail",clickOpenMailButton->isChecked()); + cfg.writeEntry("clickOpensFolder",clickOpenFolderButton->isChecked()); cfg.writeEntry( "showHtml", showHtmlButton->isChecked() ); cfg.setGroup( "Compose" ); cfg.writeEntry( "sendLater", checkBoxLater->isChecked() ); cfg.setGroup( "Applet" ); 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 @@ -10,10 +10,10 @@ <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>312</width> - <height>379</height> + <width>304</width> + <height>378</height> </rect> </property> <property stdset="1"> <name>caption</name> @@ -58,13 +58,13 @@ </attribute> <vbox> <property stdset="1"> <name>margin</name> - <number>3</number> + <number>11</number> </property> <property stdset="1"> <name>spacing</name> - <number>3</number> + <number>6</number> </property> <widget> <class>QCheckBox</class> <property stdset="1"> @@ -75,8 +75,30 @@ <name>text</name> <string>View mail as Html</string> </property> </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> <property> <name>name</name> <cstring>Spacer1</cstring> |