-rw-r--r-- | noncore/settings/mediummount/mainwindow.cc | 28 | ||||
-rw-r--r-- | noncore/settings/mediummount/mainwindow.h | 7 | ||||
-rw-r--r-- | noncore/settings/mediummount/mediumglobal.cc | 13 | ||||
-rw-r--r-- | noncore/settings/mediummount/mediumglobal.h | 3 | ||||
-rw-r--r-- | noncore/settings/mediummount/mediumwidget.cc | 2 | ||||
-rw-r--r-- | noncore/settings/mediummount/mediumwidget.h | 3 |
6 files changed, 37 insertions, 19 deletions
diff --git a/noncore/settings/mediummount/mainwindow.cc b/noncore/settings/mediummount/mainwindow.cc index 6d9bb80..bfd1e21 100644 --- a/noncore/settings/mediummount/mainwindow.cc +++ b/noncore/settings/mediummount/mainwindow.cc @@ -3,4 +3,6 @@ #include <qtabwidget.h> #include <qlayout.h> +#include <qtooltip.h> +#include <qwhatsthis.h> #include <qpe/storage.h> @@ -14,13 +16,16 @@ using namespace MediumMountSetting; -MainWindow::MainWindow( QWidget *parent, const char *name, WFlags ) - : QMainWindow( parent, name, WStyle_ContextHelp ) +MainWindow::MainWindow( QWidget *parent, const char *name, bool modal, WFlags ) + : QDialog( parent, name, modal, WStyle_ContextHelp ) { setCaption ( tr( "Medium Mount Settings" )); - // m_lay = new QVBoxLayout( this ); + m_lay = new QVBoxLayout( this ); + m_tab = new QTabWidget( this ); - setCentralWidget( m_tab ); + + m_lay->addWidget( m_tab ); + init(); } @@ -28,6 +33,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags ) MainWindow::~MainWindow() { - } + void MainWindow::init() { @@ -48,4 +53,17 @@ void MainWindow::init() } +void MainWindow::accept() +{ + m_global->writeConfig(); + + MediumMountWidget *confWidget; + for ( confWidget = m_mediums.first(); confWidget != 0; + confWidget = m_mediums.next() ) { + confWidget->writeConfig(); + } + + QDialog::accept(); +} + void MainWindow::slotGlobalChanged(int ) { diff --git a/noncore/settings/mediummount/mainwindow.h b/noncore/settings/mediummount/mainwindow.h index ce54674..9c648ef 100644 --- a/noncore/settings/mediummount/mainwindow.h +++ b/noncore/settings/mediummount/mainwindow.h @@ -5,5 +5,5 @@ #include <qlist.h> -#include <qmainwindow.h> +#include <qdialog.h> class QVBoxLayout; @@ -13,8 +13,8 @@ namespace MediumMountSetting { class MediumMountWidget; class MediumGlobalWidget; - class MainWindow : public QMainWindow { + class MainWindow : public QDialog { Q_OBJECT public: - MainWindow(QWidget *parent = 0, const char *name = 0 , WFlags = 0); + MainWindow(QWidget *parent = 0, const char *name = 0 , bool modal = FALSE, WFlags = 0); ~MainWindow(); @@ -22,4 +22,5 @@ namespace MediumMountSetting { void slotGlobalChanged(int ); void slotCheckingChanged(int ); + void accept(); private: void init(); diff --git a/noncore/settings/mediummount/mediumglobal.cc b/noncore/settings/mediummount/mediumglobal.cc index fa4171c..46d3343 100644 --- a/noncore/settings/mediummount/mediumglobal.cc +++ b/noncore/settings/mediummount/mediumglobal.cc @@ -17,5 +17,5 @@ using namespace MediumMountSetting; MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name ) - : QWidget( wid, name ) + : QWidget( wid, name, WStyle_ContextHelp ) { m_config = 0; @@ -27,6 +27,6 @@ void MediumGlobalWidget::initGUI() { m_layout = new QVBoxLayout(this ); - m_layout->setMargin( 10 ); - m_layout->setSpacing( 10 ); + // m_layout->setMargin( 10 ); + // m_layout->setSpacing( 10 ); @@ -62,5 +62,5 @@ void MediumGlobalWidget::initGUI() m_global = new QGroupBox( tr("Which media files"), m_frame ); m_frameLay = new QGridLayout(m_global, 4, 3 ); - m_frameLay->setMargin( 12 ); + m_frameLay->setMargin( 6 ); QSpacerItem *item2 = new QSpacerItem( 5, 8, @@ -85,6 +85,6 @@ void MediumGlobalWidget::initGUI() m_frameLay->addWidget( m_video, 2, 2 ); - m_frameLay->addRowSpacing( 0, 8 ); - m_frameLay->addColSpacing( 1, 2 ); +// m_frameLay->addRowSpacing( 0, 8 ); +// m_frameLay->addColSpacing( 1, 2 ); m_box->addWidget( m_global ); @@ -141,5 +141,4 @@ void MediumGlobalWidget::writeConfig() MediumGlobalWidget::~MediumGlobalWidget() { - writeConfig(); delete m_config; } diff --git a/noncore/settings/mediummount/mediumglobal.h b/noncore/settings/mediummount/mediumglobal.h index 7b3cea0..ea1f0df 100644 --- a/noncore/settings/mediummount/mediumglobal.h +++ b/noncore/settings/mediummount/mediumglobal.h @@ -24,4 +24,6 @@ namespace MediumMountSetting { MediumGlobalWidget(QWidget *parent = 0, const char *name =0 ); ~MediumGlobalWidget(); + + void writeConfig(); signals: // the global status changed @@ -36,5 +38,4 @@ namespace MediumMountSetting { void initGUI(); void readConfig(); - void writeConfig(); Config *m_config; QCheckBox *m_check; diff --git a/noncore/settings/mediummount/mediumwidget.cc b/noncore/settings/mediummount/mediumwidget.cc index 04e4e7c..f98e637 100644 --- a/noncore/settings/mediummount/mediumwidget.cc +++ b/noncore/settings/mediummount/mediumwidget.cc @@ -172,9 +172,7 @@ void MediumMountWidget::writeConfig() MediumMountWidget::~MediumMountWidget() { - writeConfig(); delete m_config; } - void MediumMountWidget::slotAdd() { diff --git a/noncore/settings/mediummount/mediumwidget.h b/noncore/settings/mediummount/mediumwidget.h index 7a801eb..7f7b755 100644 --- a/noncore/settings/mediummount/mediumwidget.h +++ b/noncore/settings/mediummount/mediumwidget.h @@ -28,4 +28,6 @@ namespace MediumMountSetting { ~MediumMountWidget(); + void writeConfig(); + private slots: void slotAdd(); @@ -35,5 +37,4 @@ namespace MediumMountSetting { void readConfig(); void initGUI(); - void writeConfig(); bool m_dirty : 1; |