author | alwin <alwin> | 2004-01-02 23:58:44 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-01-02 23:58:44 (UTC) |
commit | 86cac2c819dd683ac3f13be2c3bf1f28e0b83dab (patch) (side-by-side diff) | |
tree | 3ee125def2a60097d19c22bbd155ef1353f68f85 | |
parent | 9dbd01bcb23a56171d7ec24a9ca3fcd6f62bc6ab (diff) | |
download | opie-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!
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 8 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 6 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.h | 14 |
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 @@ #include <qmessagebox.h> #include <qtextstream.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> #include "defines.h" #include "mainwindow.h" -#include "settingsdialog.h" #include "viewmail.h" #include "mailtypes.h" #include "mailistviewitem.h" MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) : QMainWindow( parent, name, flags ) { @@ -75,17 +74,16 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) connect( deleteMails, SIGNAL( activated() ), SLOT( slotDeleteMail() ) ); editSettings = new QAction( tr( "Edit settings" ), ICON_EDITSETTINGS, 0, 0, this ); editSettings->addTo( settingsMenu ); connect( editSettings, SIGNAL( activated() ), SLOT( slotEditSettings() ) ); - editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS, 0, 0, this ); editAccounts->addTo( settingsMenu ); //setCentralWidget( view ); QVBox* wrapperBox = new QVBox( this ); setCentralWidget( wrapperBox ); @@ -152,20 +150,18 @@ void MainWindow::slotAdjustColumns() mailView->setColumnWidth( 0, 10 ); mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); mailView->setColumnWidth( 2, 80 ); mailView->setColumnWidth( 3, 50 ); mailView->setColumnWidth( 4, 50 ); } -void MainWindow::slotEditSettings() { - SettingsDialog settingsDialog( this, 0, true ); - settingsDialog.showMaximized(); - settingsDialog.exec(); +void MainWindow::slotEditSettings() +{ } void MainWindow::slotShowFolders( bool show ) { qDebug( "Show Folders" ); if ( show && folderView->isHidden() ) { qDebug( "-> showing" ); 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; class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); public slots: - void slotAdjustColumns(); + virtual void slotAdjustColumns(); protected slots: virtual void slotShowFolders( bool show ); virtual void refreshMailView(QList<RecMail>*); virtual void displayMail(); virtual void slotDeleteMail(); virtual void mailHold(int, QListViewItem *,const QPoint&,int); 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 @@ #include <qmessagebox.h> +#include "settingsdialog.h" #include "opiemail.h" #include "editaccounts.h" #include "composemail.h" #include "smtpwrapper.h" #include <qpe/qcopenvelope_qws.h> #include <qaction.h> #include <qapplication.h> @@ -12,17 +13,16 @@ OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) { settings = new Settings(); folderView->populate( settings->getAccounts() ); connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); - connect( editSettings, SIGNAL( activated() ), SLOT( slotEditSettings() ) ); connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); // Added by Stefan Eilers to allow starting by addressbook.. // copied from old mail2 #if !defined(QT_NO_COP) connect( qApp, SIGNAL( appMessage( const QCString&, const QByteArray& ) ), this, SLOT( appMessage( const QCString&, const QByteArray& ) ) ); #endif } @@ -87,17 +87,19 @@ void OpieMail::slotSendQueued() void OpieMail::slotSearchMails() { qDebug( "Search Mails" ); } void OpieMail::slotEditSettings() { - qDebug( "Edit Settings" ); + SettingsDialog settingsDialog( this, 0, true ); + settingsDialog.showMaximized(); + settingsDialog.exec(); } void OpieMail::slotEditAccounts() { qDebug( "Edit Accounts" ); EditAccounts eaDialog( settings, this, 0, true ); eaDialog.showMaximized(); 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 { Q_OBJECT public: OpieMail( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); static QString appName() { return QString::fromLatin1("opiemail"); } public slots: - void slotwriteMail(const QString&name,const QString&email); - void slotComposeMail(); - void appMessage(const QCString &msg, const QByteArray &data); + virtual void slotwriteMail(const QString&name,const QString&email); + virtual void slotComposeMail(); + virtual void appMessage(const QCString &msg, const QByteArray &data); protected slots: - void slotSendQueued(); - void slotSearchMails(); - void slotEditSettings(); - void slotEditAccounts(); + virtual void slotSendQueued(); + virtual void slotSearchMails(); + virtual void slotEditSettings(); + virtual void slotEditAccounts(); private: Settings *settings; }; #endif |