-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 @@ -125,8 +125,12 @@ void MediumMountWidget::initGUI() connect(m_del, SIGNAL(clicked() ), this, SLOT(slotRemove() ) ); 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 ); m_box->addWidget( m_always ); @@ -168,8 +172,9 @@ void MediumMountWidget::readConfig( ) m_config->setGroup("subdirs"); QStringList entries = m_config->readListEntry("subdirs",':'); m_subList->clear(); m_subList->insertStringList(entries); + m_scan_all_check->setChecked(m_config->readBoolEntry("wholemedia",true)); } void MediumMountWidget::writeConfig() { @@ -191,15 +196,19 @@ void MediumMountWidget::writeConfig() for (int i = 0; i < m_subList->count();++i) { ctext = m_subList->text(i); if (ctext.isEmpty()) continue; - if (ctext.startsWith("/")&&ctext.length()>1) { + if (ctext.startsWith("/")) { ctext = ctext.right(ctext.length()-1); } + if (!ctext.isEmpty()) { entries.append(ctext); } + } m_config->writeEntry("subdirs",entries,':'); + m_config->writeEntry("wholemedia",m_scan_all_check->isChecked()); } + MediumMountWidget::~MediumMountWidget() { delete m_config; } @@ -230,4 +239,12 @@ void MediumMountWidget::slotStateChanged() m_video->setEnabled( state ); m_image->setEnabled( state ); } + +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 @@ -34,8 +34,9 @@ namespace MediumMountSetting { private slots: void slotAdd(); void slotRemove(); void slotStateChanged(); + void slotScanAllChanged(int); private: void readConfig(); void initGUI(); @@ -66,8 +67,9 @@ namespace MediumMountSetting { QCheckBox *m_image; QCheckBox *m_text; QCheckBox *m_video; + QCheckBox *m_scan_all_check; QCheckBox *m_always; //QCheckBox *m_yesNo; QHBox *m_hboxAdd; |