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 | |||
@@ -3,4 +3,6 @@ | |||
3 | #include <qtabwidget.h> | 3 | #include <qtabwidget.h> |
4 | #include <qlayout.h> | 4 | #include <qlayout.h> |
5 | #include <qtooltip.h> | ||
6 | #include <qwhatsthis.h> | ||
5 | 7 | ||
6 | #include <qpe/storage.h> | 8 | #include <qpe/storage.h> |
@@ -14,20 +16,23 @@ using namespace MediumMountSetting; | |||
14 | 16 | ||
15 | 17 | ||
16 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags ) | 18 | MainWindow::MainWindow( QWidget *parent, const char *name, bool modal, WFlags ) |
17 | : QMainWindow( parent, name, WStyle_ContextHelp ) | 19 | : QDialog( parent, name, modal, WStyle_ContextHelp ) |
18 | 20 | ||
19 | { | 21 | { |
20 | setCaption ( tr( "Medium Mount Settings" )); | 22 | setCaption ( tr( "Medium Mount Settings" )); |
21 | 23 | ||
22 | // m_lay = new QVBoxLayout( this ); | 24 | m_lay = new QVBoxLayout( this ); |
23 | m_tab = new QTabWidget( this ); | 25 | |
24 | setCentralWidget( m_tab ); | 26 | m_tab = new QTabWidget( this ); |
25 | init(); | 27 | |
28 | m_lay->addWidget( m_tab ); | ||
29 | |||
30 | init(); | ||
26 | } | 31 | } |
27 | 32 | ||
28 | MainWindow::~MainWindow() | 33 | MainWindow::~MainWindow() |
29 | { | 34 | { |
30 | |||
31 | } | 35 | } |
36 | |||
32 | void MainWindow::init() | 37 | void MainWindow::init() |
33 | { | 38 | { |
@@ -48,4 +53,17 @@ void MainWindow::init() | |||
48 | } | 53 | } |
49 | 54 | ||
55 | void MainWindow::accept() | ||
56 | { | ||
57 | m_global->writeConfig(); | ||
58 | |||
59 | MediumMountWidget *confWidget; | ||
60 | for ( confWidget = m_mediums.first(); confWidget != 0; | ||
61 | confWidget = m_mediums.next() ) { | ||
62 | confWidget->writeConfig(); | ||
63 | } | ||
64 | |||
65 | QDialog::accept(); | ||
66 | } | ||
67 | |||
50 | void MainWindow::slotGlobalChanged(int ) | 68 | void MainWindow::slotGlobalChanged(int ) |
51 | { | 69 | { |
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 @@ | |||
5 | 5 | ||
6 | #include <qlist.h> | 6 | #include <qlist.h> |
7 | #include <qmainwindow.h> | 7 | #include <qdialog.h> |
8 | 8 | ||
9 | class QVBoxLayout; | 9 | class QVBoxLayout; |
@@ -13,8 +13,8 @@ namespace MediumMountSetting { | |||
13 | class MediumMountWidget; | 13 | class MediumMountWidget; |
14 | class MediumGlobalWidget; | 14 | class MediumGlobalWidget; |
15 | class MainWindow : public QMainWindow { | 15 | class MainWindow : public QDialog { |
16 | Q_OBJECT | 16 | Q_OBJECT |
17 | public: | 17 | public: |
18 | MainWindow(QWidget *parent = 0, const char *name = 0 , WFlags = 0); | 18 | MainWindow(QWidget *parent = 0, const char *name = 0 , bool modal = FALSE, WFlags = 0); |
19 | ~MainWindow(); | 19 | ~MainWindow(); |
20 | 20 | ||
@@ -22,4 +22,5 @@ namespace MediumMountSetting { | |||
22 | void slotGlobalChanged(int ); | 22 | void slotGlobalChanged(int ); |
23 | void slotCheckingChanged(int ); | 23 | void slotCheckingChanged(int ); |
24 | void accept(); | ||
24 | private: | 25 | private: |
25 | void init(); | 26 | 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; | |||
17 | 17 | ||
18 | MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name ) | 18 | MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name ) |
19 | : QWidget( wid, name ) | 19 | : QWidget( wid, name, WStyle_ContextHelp ) |
20 | { | 20 | { |
21 | m_config = 0; | 21 | m_config = 0; |
@@ -27,6 +27,6 @@ void MediumGlobalWidget::initGUI() | |||
27 | { | 27 | { |
28 | m_layout = new QVBoxLayout(this ); | 28 | m_layout = new QVBoxLayout(this ); |
29 | m_layout->setMargin( 10 ); | 29 | // m_layout->setMargin( 10 ); |
30 | m_layout->setSpacing( 10 ); | 30 | // m_layout->setSpacing( 10 ); |
31 | 31 | ||
32 | 32 | ||
@@ -40,5 +40,5 @@ void MediumGlobalWidget::initGUI() | |||
40 | "per medium level. You're also able to reconfigure " | 40 | "per medium level. You're also able to reconfigure " |
41 | "each medium.") ); | 41 | "each medium.") ); |
42 | 42 | ||
43 | m_layout->addWidget( m_label ); | 43 | m_layout->addWidget( m_label ); |
44 | 44 | ||
@@ -62,9 +62,9 @@ void MediumGlobalWidget::initGUI() | |||
62 | m_global = new QGroupBox( tr("Which media files"), m_frame ); | 62 | m_global = new QGroupBox( tr("Which media files"), m_frame ); |
63 | m_frameLay = new QGridLayout(m_global, 4, 3 ); | 63 | m_frameLay = new QGridLayout(m_global, 4, 3 ); |
64 | m_frameLay->setMargin( 12 ); | 64 | m_frameLay->setMargin( 6 ); |
65 | 65 | ||
66 | QSpacerItem *item2 = new QSpacerItem( 5, 8, | 66 | QSpacerItem *item2 = new QSpacerItem( 5, 8, |
67 | QSizePolicy::Fixed, | 67 | QSizePolicy::Fixed, |
68 | QSizePolicy::Fixed ); | 68 | QSizePolicy::Fixed ); |
69 | m_audio = new QCheckBox( tr("Audio"), m_global ); | 69 | m_audio = new QCheckBox( tr("Audio"), m_global ); |
70 | m_all = new QCheckBox( tr("All") , m_global ); | 70 | m_all = new QCheckBox( tr("All") , m_global ); |
@@ -85,9 +85,9 @@ void MediumGlobalWidget::initGUI() | |||
85 | m_frameLay->addWidget( m_video, 2, 2 ); | 85 | m_frameLay->addWidget( m_video, 2, 2 ); |
86 | 86 | ||
87 | m_frameLay->addRowSpacing( 0, 8 ); | 87 | // m_frameLay->addRowSpacing( 0, 8 ); |
88 | m_frameLay->addColSpacing( 1, 2 ); | 88 | // m_frameLay->addColSpacing( 1, 2 ); |
89 | 89 | ||
90 | m_box->addWidget( m_global ); | 90 | m_box->addWidget( m_global ); |
91 | 91 | ||
92 | 92 | ||
93 | m_layout->addWidget( m_frame ); | 93 | m_layout->addWidget( m_frame ); |
@@ -141,5 +141,4 @@ void MediumGlobalWidget::writeConfig() | |||
141 | MediumGlobalWidget::~MediumGlobalWidget() | 141 | MediumGlobalWidget::~MediumGlobalWidget() |
142 | { | 142 | { |
143 | writeConfig(); | ||
144 | delete m_config; | 143 | delete m_config; |
145 | } | 144 | } |
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 { | |||
24 | MediumGlobalWidget(QWidget *parent = 0, const char *name =0 ); | 24 | MediumGlobalWidget(QWidget *parent = 0, const char *name =0 ); |
25 | ~MediumGlobalWidget(); | 25 | ~MediumGlobalWidget(); |
26 | |||
27 | void writeConfig(); | ||
26 | signals: | 28 | signals: |
27 | // the global status changed | 29 | // the global status changed |
@@ -36,5 +38,4 @@ namespace MediumMountSetting { | |||
36 | void initGUI(); | 38 | void initGUI(); |
37 | void readConfig(); | 39 | void readConfig(); |
38 | void writeConfig(); | ||
39 | Config *m_config; | 40 | Config *m_config; |
40 | QCheckBox *m_check; | 41 | 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 | |||
@@ -37,5 +37,5 @@ MediumMountWidget::MediumMountWidget(const QString &path, | |||
37 | initGUI(); | 37 | initGUI(); |
38 | m_label->setPixmap(pix ); | 38 | m_label->setPixmap(pix ); |
39 | m_config = 0; | 39 | m_config = 0; |
40 | 40 | ||
41 | readConfig(); | 41 | readConfig(); |
@@ -82,5 +82,5 @@ void MediumMountWidget::initGUI() | |||
82 | m_video = new QCheckBox( tr("Video"), m_group ); | 82 | m_video = new QCheckBox( tr("Video"), m_group ); |
83 | 83 | ||
84 | QSpacerItem *iti1b = new QSpacerItem(2, 10, QSizePolicy::Fixed, | 84 | QSpacerItem *iti1b = new QSpacerItem(2, 10, QSizePolicy::Fixed, |
85 | QSizePolicy::Fixed ); | 85 | QSizePolicy::Fixed ); |
86 | m_checks->addItem( iti1b, 0, 0 ); | 86 | m_checks->addItem( iti1b, 0, 0 ); |
@@ -97,5 +97,5 @@ void MediumMountWidget::initGUI() | |||
97 | m_checks->setColStretch(1, -2 ); | 97 | m_checks->setColStretch(1, -2 ); |
98 | 98 | ||
99 | connect(m_all, SIGNAL(stateChanged(int) ), | 99 | connect(m_all, SIGNAL(stateChanged(int) ), |
100 | this, SLOT(slotStateChanged() ) ); | 100 | this, SLOT(slotStateChanged() ) ); |
101 | 101 | ||
@@ -144,5 +144,5 @@ void MediumMountWidget::readConfig( ) | |||
144 | m_image->setEnabled( true ); | 144 | m_image->setEnabled( true ); |
145 | m_text->setEnabled ( true ); | 145 | m_text->setEnabled ( true ); |
146 | m_all->setEnabled ( true ); | 146 | m_all->setEnabled ( true ); |
147 | 147 | ||
148 | m_all->setChecked( false ); | 148 | m_all->setChecked( false ); |
@@ -172,9 +172,7 @@ void MediumMountWidget::writeConfig() | |||
172 | MediumMountWidget::~MediumMountWidget() | 172 | MediumMountWidget::~MediumMountWidget() |
173 | { | 173 | { |
174 | writeConfig(); | ||
175 | delete m_config; | 174 | delete m_config; |
176 | } | 175 | } |
177 | 176 | ||
178 | |||
179 | void MediumMountWidget::slotAdd() | 177 | void MediumMountWidget::slotAdd() |
180 | { | 178 | { |
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 | |||
@@ -27,4 +27,6 @@ namespace MediumMountSetting { | |||
27 | MediumMountWidget(const QString&, const QPixmap &, QWidget *parent, const char *name = 0 ); | 27 | MediumMountWidget(const QString&, const QPixmap &, QWidget *parent, const char *name = 0 ); |
28 | ~MediumMountWidget(); | 28 | ~MediumMountWidget(); |
29 | |||
30 | void writeConfig(); | ||
29 | 31 | ||
30 | private slots: | 32 | private slots: |
@@ -35,6 +37,5 @@ namespace MediumMountSetting { | |||
35 | void readConfig(); | 37 | void readConfig(); |
36 | void initGUI(); | 38 | void initGUI(); |
37 | void writeConfig(); | 39 | |
38 | |||
39 | bool m_dirty : 1; | 40 | bool m_dirty : 1; |
40 | 41 | ||