author | harlekin <harlekin> | 2003-03-23 14:17:43 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-03-23 14:17:43 (UTC) |
commit | dca448bad29f0afbab1fc0ffe493560fd927c1b5 (patch) (side-by-side diff) | |
tree | 178ab4781f5952f6e333659531cb7e0db0276f24 /noncore/settings/mediummount | |
parent | 013194659dde417767c62ab2fe18b09ea21558eb (diff) | |
download | opie-dca448bad29f0afbab1fc0ffe493560fd927c1b5.zip opie-dca448bad29f0afbab1fc0ffe493560fd927c1b5.tar.gz opie-dca448bad29f0afbab1fc0ffe493560fd927c1b5.tar.bz2 |
a dialog now x does not save ok saves, also some layout changes
Diffstat (limited to 'noncore/settings/mediummount') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/mediummount/mainwindow.cc | 34 | ||||
-rw-r--r-- | noncore/settings/mediummount/mainwindow.h | 7 | ||||
-rw-r--r-- | noncore/settings/mediummount/mediumglobal.cc | 19 | ||||
-rw-r--r-- | noncore/settings/mediummount/mediumglobal.h | 3 | ||||
-rw-r--r-- | noncore/settings/mediummount/mediumwidget.cc | 10 | ||||
-rw-r--r-- | noncore/settings/mediummount/mediumwidget.h | 5 |
6 files changed, 48 insertions, 30 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 @@ -4,2 +4,4 @@ #include <qlayout.h> +#include <qtooltip.h> +#include <qwhatsthis.h> @@ -15,12 +17,15 @@ 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(); } @@ -29,4 +34,4 @@ MainWindow::~MainWindow() { - } + void MainWindow::init() @@ -49,2 +54,15 @@ 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 @@ -6,3 +6,3 @@ #include <qlist.h> -#include <qmainwindow.h> +#include <qdialog.h> @@ -14,6 +14,6 @@ namespace MediumMountSetting { 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(); @@ -23,2 +23,3 @@ namespace MediumMountSetting { void slotCheckingChanged(int ); + void accept(); private: 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 @@ -18,3 +18,3 @@ using namespace MediumMountSetting; MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name ) - : QWidget( wid, name ) + : QWidget( wid, name, WStyle_ContextHelp ) { @@ -28,4 +28,4 @@ void MediumGlobalWidget::initGUI() m_layout = new QVBoxLayout(this ); - m_layout->setMargin( 10 ); - m_layout->setSpacing( 10 ); + // m_layout->setMargin( 10 ); + // m_layout->setSpacing( 10 ); @@ -41,3 +41,3 @@ void MediumGlobalWidget::initGUI() "each medium.") ); - + m_layout->addWidget( m_label ); @@ -63,3 +63,3 @@ void MediumGlobalWidget::initGUI() m_frameLay = new QGridLayout(m_global, 4, 3 ); - m_frameLay->setMargin( 12 ); + m_frameLay->setMargin( 6 ); @@ -67,3 +67,3 @@ void MediumGlobalWidget::initGUI() QSizePolicy::Fixed, - QSizePolicy::Fixed ); + QSizePolicy::Fixed ); m_audio = new QCheckBox( tr("Audio"), m_global ); @@ -86,7 +86,7 @@ void MediumGlobalWidget::initGUI() - 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 ); - + @@ -142,3 +142,2 @@ 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 @@ -25,2 +25,4 @@ namespace MediumMountSetting { ~MediumGlobalWidget(); + + void writeConfig(); signals: @@ -37,3 +39,2 @@ namespace MediumMountSetting { void readConfig(); - void writeConfig(); Config *m_config; 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 @@ -38,3 +38,3 @@ MediumMountWidget::MediumMountWidget(const QString &path, m_label->setPixmap(pix ); - m_config = 0; + m_config = 0; @@ -83,3 +83,3 @@ void MediumMountWidget::initGUI() - QSpacerItem *iti1b = new QSpacerItem(2, 10, QSizePolicy::Fixed, + QSpacerItem *iti1b = new QSpacerItem(2, 10, QSizePolicy::Fixed, QSizePolicy::Fixed ); @@ -98,3 +98,3 @@ void MediumMountWidget::initGUI() - connect(m_all, SIGNAL(stateChanged(int) ), + connect(m_all, SIGNAL(stateChanged(int) ), this, SLOT(slotStateChanged() ) ); @@ -145,3 +145,3 @@ void MediumMountWidget::readConfig( ) m_text->setEnabled ( true ); - m_all->setEnabled ( true ); + m_all->setEnabled ( true ); @@ -173,3 +173,2 @@ MediumMountWidget::~MediumMountWidget() { - writeConfig(); delete m_config; @@ -177,3 +176,2 @@ MediumMountWidget::~MediumMountWidget() - 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,2 +28,4 @@ namespace MediumMountSetting { ~MediumMountWidget(); + + void writeConfig(); @@ -36,4 +38,3 @@ namespace MediumMountSetting { void initGUI(); - void writeConfig(); - + bool m_dirty : 1; |