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
@@ -6,17 +6,16 @@
6#include <qmessagebox.h> 6#include <qmessagebox.h>
7#include <qtextstream.h> 7#include <qtextstream.h>
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 )
21 : QMainWindow( parent, name, flags ) 20 : QMainWindow( parent, name, flags )
22{ 21{
@@ -75,17 +74,16 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
75 connect( deleteMails, SIGNAL( activated() ), 74 connect( deleteMails, SIGNAL( activated() ),
76 SLOT( slotDeleteMail() ) ); 75 SLOT( slotDeleteMail() ) );
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
90 QVBox* wrapperBox = new QVBox( this ); 88 QVBox* wrapperBox = new QVBox( this );
91 setCentralWidget( wrapperBox ); 89 setCentralWidget( wrapperBox );
@@ -152,20 +150,18 @@ void MainWindow::slotAdjustColumns()
152 150
153 mailView->setColumnWidth( 0, 10 ); 151 mailView->setColumnWidth( 0, 10 );
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() ) {
170 qDebug( "-> showing" ); 166 qDebug( "-> showing" );
171 folderView->show(); 167 folderView->show();
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
@@ -16,17 +16,17 @@ class RecMail;
16class MainWindow : public QMainWindow 16class MainWindow : public QMainWindow
17{ 17{
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();
31 virtual void mailHold(int, QListViewItem *,const QPoint&,int); 31 virtual void mailHold(int, QListViewItem *,const QPoint&,int);
32 virtual void slotAdjustLayout(); 32 virtual void slotAdjustLayout();
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,9 +1,10 @@
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>
8#include <qapplication.h> 9#include <qapplication.h>
9 10
@@ -12,17 +13,16 @@ OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags )
12{ 13{
13 settings = new Settings(); 14 settings = new Settings();
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& ) ) );
27#endif 27#endif
28} 28}
@@ -87,17 +87,19 @@ void OpieMail::slotSendQueued()
87 87
88void OpieMail::slotSearchMails() 88void 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 );
102 eaDialog.showMaximized(); 104 eaDialog.showMaximized();
103 eaDialog.slotAdjustColumns(); 105 eaDialog.slotAdjustColumns();
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
@@ -8,22 +8,22 @@ class OpieMail : public MainWindow
8{ 8{
9 Q_OBJECT 9 Q_OBJECT
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