summaryrefslogtreecommitdiff
authoralwin <alwin>2004-01-02 23:58:44 (UTC)
committer alwin <alwin>2004-01-02 23:58:44 (UTC)
commit86cac2c819dd683ac3f13be2c3bf1f28e0b83dab (patch) (unidiff)
tree3ee125def2a60097d19c22bbd155ef1353f68f85
parent9dbd01bcb23a56171d7ec24a9ca3fcd6f62bc6ab (diff)
downloadopie-86cac2c819dd683ac3f13be2c3bf1f28e0b83dab.zip
opie-86cac2c819dd683ac3f13be2c3bf1f28e0b83dab.tar.gz
opie-86cac2c819dd683ac3f13be2c3bf1f28e0b83dab.tar.bz2
settings dialog will show when clicked.
slots are all virtual so always the right one is called! Note: It is better to make all slots declared virtual - or do not make any child-classes!
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/mainwindow.cpp8
-rw-r--r--noncore/net/mail/mainwindow.h2
-rw-r--r--noncore/net/mail/opiemail.cpp6
-rw-r--r--noncore/net/mail/opiemail.h14
4 files changed, 14 insertions, 16 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index cf4cbe8..2a74286 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -8,13 +8,12 @@
8 8
9#include <qpe/qpeapplication.h> 9#include <qpe/qpeapplication.h>
10#include <qpe/resource.h> 10#include <qpe/resource.h>
11 11
12#include "defines.h" 12#include "defines.h"
13#include "mainwindow.h" 13#include "mainwindow.h"
14#include "settingsdialog.h"
15#include "viewmail.h" 14#include "viewmail.h"
16#include "mailtypes.h" 15#include "mailtypes.h"
17#include "mailistviewitem.h" 16#include "mailistviewitem.h"
18 17
19 18
20MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) 19MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
@@ -77,13 +76,12 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
77 76
78 editSettings = new QAction( tr( "Edit settings" ), ICON_EDITSETTINGS, 77 editSettings = new QAction( tr( "Edit settings" ), ICON_EDITSETTINGS,
79 0, 0, this ); 78 0, 0, this );
80 editSettings->addTo( settingsMenu ); 79 editSettings->addTo( settingsMenu );
81 connect( editSettings, SIGNAL( activated() ), 80 connect( editSettings, SIGNAL( activated() ),
82 SLOT( slotEditSettings() ) ); 81 SLOT( slotEditSettings() ) );
83
84 editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS, 82 editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS,
85 0, 0, this ); 83 0, 0, this );
86 editAccounts->addTo( settingsMenu ); 84 editAccounts->addTo( settingsMenu );
87 85
88 //setCentralWidget( view ); 86 //setCentralWidget( view );
89 87
@@ -154,16 +152,14 @@ void MainWindow::slotAdjustColumns()
154 mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); 152 mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 );
155 mailView->setColumnWidth( 2, 80 ); 153 mailView->setColumnWidth( 2, 80 );
156 mailView->setColumnWidth( 3, 50 ); 154 mailView->setColumnWidth( 3, 50 );
157 mailView->setColumnWidth( 4, 50 ); 155 mailView->setColumnWidth( 4, 50 );
158} 156}
159 157
160void MainWindow::slotEditSettings() { 158void MainWindow::slotEditSettings()
161 SettingsDialog settingsDialog( this, 0, true ); 159{
162 settingsDialog.showMaximized();
163 settingsDialog.exec();
164} 160}
165 161
166void MainWindow::slotShowFolders( bool show ) 162void MainWindow::slotShowFolders( bool show )
167{ 163{
168 qDebug( "Show Folders" ); 164 qDebug( "Show Folders" );
169 if ( show && folderView->isHidden() ) { 165 if ( show && folderView->isHidden() ) {
diff --git a/noncore/net/mail/mainwindow.h b/noncore/net/mail/mainwindow.h
index 638232a..0e077f6 100644
--- a/noncore/net/mail/mainwindow.h
+++ b/noncore/net/mail/mainwindow.h
@@ -18,13 +18,13 @@ class MainWindow : public QMainWindow
18 Q_OBJECT 18 Q_OBJECT
19 19
20public: 20public:
21 MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); 21 MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 );
22 22
23public slots: 23public slots:
24 void slotAdjustColumns(); 24 virtual void slotAdjustColumns();
25 25
26protected slots: 26protected slots:
27 virtual void slotShowFolders( bool show ); 27 virtual void slotShowFolders( bool show );
28 virtual void refreshMailView(QList<RecMail>*); 28 virtual void refreshMailView(QList<RecMail>*);
29 virtual void displayMail(); 29 virtual void displayMail();
30 virtual void slotDeleteMail(); 30 virtual void slotDeleteMail();
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp
index 2909893..e35f5b6 100644
--- a/noncore/net/mail/opiemail.cpp
+++ b/noncore/net/mail/opiemail.cpp
@@ -1,7 +1,8 @@
1#include <qmessagebox.h> 1#include <qmessagebox.h>
2#include "settingsdialog.h"
2#include "opiemail.h" 3#include "opiemail.h"
3#include "editaccounts.h" 4#include "editaccounts.h"
4#include "composemail.h" 5#include "composemail.h"
5#include "smtpwrapper.h" 6#include "smtpwrapper.h"
6#include <qpe/qcopenvelope_qws.h> 7#include <qpe/qcopenvelope_qws.h>
7#include <qaction.h> 8#include <qaction.h>
@@ -14,13 +15,12 @@ OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags )
14 15
15 folderView->populate( settings->getAccounts() ); 16 folderView->populate( settings->getAccounts() );
16 17
17 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); 18 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) );
18 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); 19 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
19// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); 20// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
20 connect( editSettings, SIGNAL( activated() ), SLOT( slotEditSettings() ) );
21 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); 21 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) );
22 // Added by Stefan Eilers to allow starting by addressbook.. 22 // Added by Stefan Eilers to allow starting by addressbook..
23 // copied from old mail2 23 // copied from old mail2
24#if !defined(QT_NO_COP) 24#if !defined(QT_NO_COP)
25 connect( qApp, SIGNAL( appMessage( const QCString&, const QByteArray& ) ), 25 connect( qApp, SIGNAL( appMessage( const QCString&, const QByteArray& ) ),
26 this, SLOT( appMessage( const QCString&, const QByteArray& ) ) ); 26 this, SLOT( appMessage( const QCString&, const QByteArray& ) ) );
@@ -89,13 +89,15 @@ void OpieMail::slotSearchMails()
89{ 89{
90 qDebug( "Search Mails" ); 90 qDebug( "Search Mails" );
91} 91}
92 92
93void OpieMail::slotEditSettings() 93void OpieMail::slotEditSettings()
94{ 94{
95 qDebug( "Edit Settings" ); 95 SettingsDialog settingsDialog( this, 0, true );
96 settingsDialog.showMaximized();
97 settingsDialog.exec();
96} 98}
97 99
98void OpieMail::slotEditAccounts() 100void OpieMail::slotEditAccounts()
99{ 101{
100 qDebug( "Edit Accounts" ); 102 qDebug( "Edit Accounts" );
101 EditAccounts eaDialog( settings, this, 0, true ); 103 EditAccounts eaDialog( settings, this, 0, true );
diff --git a/noncore/net/mail/opiemail.h b/noncore/net/mail/opiemail.h
index 8cbcaa4..4e3c974 100644
--- a/noncore/net/mail/opiemail.h
+++ b/noncore/net/mail/opiemail.h
@@ -10,20 +10,20 @@ class OpieMail : public MainWindow
10 10
11public: 11public:
12 OpieMail( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); 12 OpieMail( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 );
13 static QString appName() { return QString::fromLatin1("opiemail"); } 13 static QString appName() { return QString::fromLatin1("opiemail"); }
14 14
15public slots: 15public slots:
16 void slotwriteMail(const QString&name,const QString&email); 16 virtual void slotwriteMail(const QString&name,const QString&email);
17 void slotComposeMail(); 17 virtual void slotComposeMail();
18 void appMessage(const QCString &msg, const QByteArray &data); 18 virtual void appMessage(const QCString &msg, const QByteArray &data);
19protected slots: 19protected slots:
20 void slotSendQueued(); 20 virtual void slotSendQueued();
21 void slotSearchMails(); 21 virtual void slotSearchMails();
22 void slotEditSettings(); 22 virtual void slotEditSettings();
23 void slotEditAccounts(); 23 virtual void slotEditAccounts();
24private: 24private:
25 Settings *settings; 25 Settings *settings;
26 26
27}; 27};
28 28
29#endif 29#endif