author | alwin <alwin> | 2004-02-22 19:55:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-02-22 19:55:11 (UTC) |
commit | 5738a3d33bdaeb69994f70fd5ec8aa49df98ceeb (patch) (unidiff) | |
tree | bf44986448a8987633e3f92a7a627e69c67f1037 /noncore | |
parent | 8705083d6a267450c71b0276833db5c7238f260e (diff) | |
download | opie-5738a3d33bdaeb69994f70fd5ec8aa49df98ceeb.zip opie-5738a3d33bdaeb69994f70fd5ec8aa49df98ceeb.tar.gz opie-5738a3d33bdaeb69994f70fd5ec8aa49df98ceeb.tar.bz2 |
flag for setting search the whole media not such subdirs
-rw-r--r-- | noncore/settings/mediummount/mediumwidget.cc | 19 | ||||
-rw-r--r-- | noncore/settings/mediummount/mediumwidget.h | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/noncore/settings/mediummount/mediumwidget.cc b/noncore/settings/mediummount/mediumwidget.cc index caa9559..f39a6ed 100644 --- a/noncore/settings/mediummount/mediumwidget.cc +++ b/noncore/settings/mediummount/mediumwidget.cc | |||
@@ -123,12 +123,16 @@ void MediumMountWidget::initGUI() | |||
123 | connect(m_add, SIGNAL(clicked() ), | 123 | connect(m_add, SIGNAL(clicked() ), |
124 | this, SLOT(slotAdd() ) ); | 124 | this, SLOT(slotAdd() ) ); |
125 | connect(m_del, SIGNAL(clicked() ), | 125 | connect(m_del, SIGNAL(clicked() ), |
126 | this, SLOT(slotRemove() ) ); | 126 | this, SLOT(slotRemove() ) ); |
127 | 127 | ||
128 | m_box->addWidget(m_hboxAdd ); | 128 | m_box->addWidget(m_hboxAdd ); |
129 | m_scan_all_check = new QCheckBox( tr("Scan whole media"), this ); | ||
130 | connect(m_scan_all_check,SIGNAL(stateChanged(int)),this,SLOT(slotScanAllChanged(int))); | ||
131 | |||
132 | m_box->addWidget(m_scan_all_check); | ||
129 | 133 | ||
130 | m_always = new QCheckBox( tr("Always check this medium"), this ); | 134 | m_always = new QCheckBox( tr("Always check this medium"), this ); |
131 | 135 | ||
132 | m_box->addWidget( m_always ); | 136 | m_box->addWidget( m_always ); |
133 | 137 | ||
134 | QSpacerItem *item = new QSpacerItem(5, 50, | 138 | QSpacerItem *item = new QSpacerItem(5, 50, |
@@ -166,12 +170,13 @@ void MediumMountWidget::readConfig( ) | |||
166 | m_video->setChecked( m_config->readBoolEntry("video", true ) ); | 170 | m_video->setChecked( m_config->readBoolEntry("video", true ) ); |
167 | }; | 171 | }; |
168 | m_config->setGroup("subdirs"); | 172 | m_config->setGroup("subdirs"); |
169 | QStringList entries = m_config->readListEntry("subdirs",':'); | 173 | QStringList entries = m_config->readListEntry("subdirs",':'); |
170 | m_subList->clear(); | 174 | m_subList->clear(); |
171 | m_subList->insertStringList(entries); | 175 | m_subList->insertStringList(entries); |
176 | m_scan_all_check->setChecked(m_config->readBoolEntry("wholemedia",true)); | ||
172 | } | 177 | } |
173 | 178 | ||
174 | void MediumMountWidget::writeConfig() | 179 | void MediumMountWidget::writeConfig() |
175 | { | 180 | { |
176 | m_config->setGroup("main"); | 181 | m_config->setGroup("main"); |
177 | m_config->writeEntry("check", m_always->isChecked() ); | 182 | m_config->writeEntry("check", m_always->isChecked() ); |
@@ -189,19 +194,23 @@ void MediumMountWidget::writeConfig() | |||
189 | QStringList entries; | 194 | QStringList entries; |
190 | QString ctext; | 195 | QString ctext; |
191 | for (int i = 0; i < m_subList->count();++i) { | 196 | for (int i = 0; i < m_subList->count();++i) { |
192 | ctext = m_subList->text(i); | 197 | ctext = m_subList->text(i); |
193 | if (ctext.isEmpty()) | 198 | if (ctext.isEmpty()) |
194 | continue; | 199 | continue; |
195 | if (ctext.startsWith("/")&&ctext.length()>1) { | 200 | if (ctext.startsWith("/")) { |
196 | ctext = ctext.right(ctext.length()-1); | 201 | ctext = ctext.right(ctext.length()-1); |
197 | } | 202 | } |
203 | if (!ctext.isEmpty()) { | ||
198 | entries.append(ctext); | 204 | entries.append(ctext); |
199 | } | 205 | } |
206 | } | ||
200 | m_config->writeEntry("subdirs",entries,':'); | 207 | m_config->writeEntry("subdirs",entries,':'); |
208 | m_config->writeEntry("wholemedia",m_scan_all_check->isChecked()); | ||
201 | } | 209 | } |
210 | |||
202 | MediumMountWidget::~MediumMountWidget() | 211 | MediumMountWidget::~MediumMountWidget() |
203 | { | 212 | { |
204 | delete m_config; | 213 | delete m_config; |
205 | } | 214 | } |
206 | 215 | ||
207 | void MediumMountWidget::slotAdd() | 216 | void MediumMountWidget::slotAdd() |
@@ -228,6 +237,14 @@ void MediumMountWidget::slotStateChanged() | |||
228 | m_audio->setEnabled( state ); | 237 | m_audio->setEnabled( state ); |
229 | m_text->setEnabled ( state ); | 238 | m_text->setEnabled ( state ); |
230 | m_video->setEnabled( state ); | 239 | m_video->setEnabled( state ); |
231 | m_image->setEnabled( state ); | 240 | m_image->setEnabled( state ); |
232 | 241 | ||
233 | } | 242 | } |
243 | |||
244 | void MediumMountWidget::slotScanAllChanged(int) | ||
245 | { | ||
246 | bool state = !(m_scan_all_check->isChecked()); | ||
247 | m_add->setEnabled(state); | ||
248 | m_del->setEnabled(state); | ||
249 | m_subList->setEnabled(state); | ||
250 | } | ||
diff --git a/noncore/settings/mediummount/mediumwidget.h b/noncore/settings/mediummount/mediumwidget.h index 28ae369..ae5c5dc 100644 --- a/noncore/settings/mediummount/mediumwidget.h +++ b/noncore/settings/mediummount/mediumwidget.h | |||
@@ -32,12 +32,13 @@ namespace MediumMountSetting { | |||
32 | void writeConfig(); | 32 | void writeConfig(); |
33 | 33 | ||
34 | private slots: | 34 | private slots: |
35 | void slotAdd(); | 35 | void slotAdd(); |
36 | void slotRemove(); | 36 | void slotRemove(); |
37 | void slotStateChanged(); | 37 | void slotStateChanged(); |
38 | void slotScanAllChanged(int); | ||
38 | 39 | ||
39 | private: | 40 | private: |
40 | void readConfig(); | 41 | void readConfig(); |
41 | void initGUI(); | 42 | void initGUI(); |
42 | 43 | ||
43 | bool m_dirty : 1; | 44 | bool m_dirty : 1; |
@@ -64,12 +65,13 @@ namespace MediumMountSetting { | |||
64 | QCheckBox *m_all; | 65 | QCheckBox *m_all; |
65 | QCheckBox *m_audio; | 66 | QCheckBox *m_audio; |
66 | QCheckBox *m_image; | 67 | QCheckBox *m_image; |
67 | QCheckBox *m_text; | 68 | QCheckBox *m_text; |
68 | QCheckBox *m_video; | 69 | QCheckBox *m_video; |
69 | 70 | ||
71 | QCheckBox *m_scan_all_check; | ||
70 | QCheckBox *m_always; | 72 | QCheckBox *m_always; |
71 | //QCheckBox *m_yesNo; | 73 | //QCheckBox *m_yesNo; |
72 | 74 | ||
73 | QHBox *m_hboxAdd; | 75 | QHBox *m_hboxAdd; |
74 | 76 | ||
75 | QLabel *m_lblPath; | 77 | QLabel *m_lblPath; |