author | alwin <alwin> | 2004-02-22 19:55:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-02-22 19:55:11 (UTC) |
commit | 5738a3d33bdaeb69994f70fd5ec8aa49df98ceeb (patch) (side-by-side diff) | |
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 | 23 | ||||
-rw-r--r-- | noncore/settings/mediummount/mediumwidget.h | 2 |
2 files changed, 22 insertions, 3 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 @@ -127,5 +127,9 @@ void MediumMountWidget::initGUI() m_box->addWidget(m_hboxAdd ); - + m_scan_all_check = new QCheckBox( tr("Scan whole media"), this ); + connect(m_scan_all_check,SIGNAL(stateChanged(int)),this,SLOT(slotScanAllChanged(int))); + + m_box->addWidget(m_scan_all_check); + m_always = new QCheckBox( tr("Always check this medium"), this ); @@ -170,4 +174,5 @@ void MediumMountWidget::readConfig( ) m_subList->clear(); m_subList->insertStringList(entries); + m_scan_all_check->setChecked(m_config->readBoolEntry("wholemedia",true)); } @@ -193,11 +198,15 @@ void MediumMountWidget::writeConfig() if (ctext.isEmpty()) continue; - if (ctext.startsWith("/")&&ctext.length()>1) { + if (ctext.startsWith("/")) { ctext = ctext.right(ctext.length()-1); } - entries.append(ctext); + if (!ctext.isEmpty()) { + entries.append(ctext); + } } m_config->writeEntry("subdirs",entries,':'); + m_config->writeEntry("wholemedia",m_scan_all_check->isChecked()); } + MediumMountWidget::~MediumMountWidget() { @@ -232,2 +241,10 @@ void MediumMountWidget::slotStateChanged() } + +void MediumMountWidget::slotScanAllChanged(int) +{ + bool state = !(m_scan_all_check->isChecked()); + m_add->setEnabled(state); + m_del->setEnabled(state); + m_subList->setEnabled(state); +} 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 @@ -36,4 +36,5 @@ namespace MediumMountSetting { void slotRemove(); void slotStateChanged(); + void slotScanAllChanged(int); private: @@ -68,4 +69,5 @@ namespace MediumMountSetting { QCheckBox *m_video; + QCheckBox *m_scan_all_check; QCheckBox *m_always; //QCheckBox *m_yesNo; |