From dca448bad29f0afbab1fc0ffe493560fd927c1b5 Mon Sep 17 00:00:00 2001 From: harlekin Date: Sun, 23 Mar 2003 14:17:43 +0000 Subject: a dialog now x does not save ok saves, also some layout changes --- (limited to 'noncore/settings/mediummount/mainwindow.cc') 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 @@ -2,6 +2,8 @@ #include #include +#include +#include #include @@ -13,22 +15,25 @@ 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" )); + setCaption ( tr( "Medium Mount Settings" )); - // m_lay = new QVBoxLayout( this ); - m_tab = new QTabWidget( this ); - setCentralWidget( m_tab ); - init(); + m_lay = new QVBoxLayout( this ); + + m_tab = new QTabWidget( this ); + + m_lay->addWidget( m_tab ); + + init(); } MainWindow::~MainWindow() { - } + void MainWindow::init() { m_global = new MediumGlobalWidget( m_tab, "test drive" ); @@ -47,6 +52,19 @@ 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 ) { -- cgit v0.9.0.2