25 #include <KDirSelectDialog>
27 #include <KMessageBox>
29 #include <QtGui/QRadioButton>
30 #include <QtGui/QCloseEvent>
31 #include <QtCore/QDir>
35 setButtons(KDialog::Reset | KDialog::Close);
37 setupUi(this->mainWidget());
45 colourSchemeGroup->setLayout(vbox);
50 connect(&m_timer, SIGNAL(timeout()), SIGNAL(
mapIsInvalid()));
52 connect(m_addButton, SIGNAL(clicked()), SLOT(
addFolder()));
53 connect(m_removeButton, SIGNAL(clicked()), SLOT(
removeFolder()));
54 connect(
this, SIGNAL(resetClicked()), SLOT(
reset()));
55 connect(
this, SIGNAL(closeClicked()), SLOT(close()));
57 connect(colourSchemeGroup, SIGNAL(clicked(
int)), SLOT(
changeScheme(
int)));
58 connect(contrastSlider, SIGNAL(valueChanged(
int)), SLOT(
changeContrast(
int)));
61 connect(scanAcrossMounts, SIGNAL(toggled(
bool)), SLOT(
startTimer()));
62 connect(dontScanRemoteMounts, SIGNAL(toggled(
bool)), SLOT(
startTimer()));
63 connect(dontScanRemovableMedia, SIGNAL(toggled(
bool)), SLOT(
startTimer()));
64 connect(scanAcrossMounts, SIGNAL(toggled(
bool)),
66 connect(dontScanRemoteMounts, SIGNAL(toggled(
bool)),
68 connect(dontScanRemovableMedia, SIGNAL(toggled(
bool)),
78 m_removeButton->setIcon(KIcon(
QLatin1String(
"list-remove" )));
98 scanAcrossMounts->setChecked(Config::scanAcrossMounts);
99 dontScanRemoteMounts->setChecked(!Config::scanRemoteMounts);
100 dontScanRemovableMedia->setChecked(!Config::scanRemovableMedia);
102 dontScanRemoteMounts->setEnabled(Config::scanAcrossMounts);
106 m_listBox->addItems(Config::skipList);
107 m_listBox->setCurrentRow(0);
109 m_removeButton->setEnabled(m_listBox->count() > 0);
112 if (colourSchemeGroup->selected() != Config::scheme)
114 qobject_cast<
QRadioButton*>(colourSchemeGroup->layout()->itemAt(Config::scheme)->widget())->setChecked(
true);
120 contrastSlider->setValue(Config::contrast);
122 useAntialiasing->setChecked(Config::antialias);
124 varyLabelFontSizes->setChecked(Config::varyLabelFontSizes);
125 minFontPitchLabel->setEnabled(Config::varyLabelFontSizes);
126 minFontPitch->setEnabled(Config::varyLabelFontSizes);
127 minFontPitch->setValue(Config::minFontPitch);
128 showSmallFiles->setChecked(Config::showSmallFiles);
135 Config::scanAcrossMounts = b;
137 dontScanRemoteMounts->setEnabled(b);
143 Config::scanRemoteMounts = !b;
148 Config::scanRemovableMedia = !b;
155 const KUrl url = KDirSelectDialog::selectDirectory(KUrl(
QDir::rootPath()),
false,
this, i18n(
"Select Folder to Scan" ));
162 const QString path = url.path(KUrl::AddTrailingSlash);
164 if (!Config::skipList.contains(path))
166 Config::skipList.
append(path);
167 m_listBox->addItem(path);
168 if (m_listBox->currentItem() == 0) m_listBox->setCurrentRow(0);
169 m_removeButton->setEnabled(
true);
171 else KMessageBox::sorry(
this, i18n(
"That folder is already set to be excluded from scans"));
178 Config::skipList.removeAll(m_listBox->currentItem()->text());
182 m_listBox->addItems(Config::skipList);
184 m_removeButton->setEnabled(m_listBox->count() > 0);
185 if (m_listBox->count() > 0) m_listBox->setCurrentRow(0);
192 m_timer.
start(TIMEOUT);
202 Config::contrast = c;
207 Config::antialias = b;
212 Config::varyLabelFontSizes = b;
213 minFontPitchLabel->setEnabled(b);
214 minFontPitch->setEnabled(b);
219 Config::minFontPitch = p;
224 Config::showSmallFiles = b;
242 #include "settingsDialog.moc"
void setInterval(int msec)
QString & append(QChar ch)
SettingsDialog(QWidget *=0)
void toggleVaryLabelFontSizes(bool)
void toggleDontScanRemovableMedia(bool)
void changeMinFontPitch(int)
void toggleScanAcrossMounts(bool)
void toggleShowSmallFiles(bool)
void toggleUseAntialiasing(bool=true)
void toggleDontScanRemoteMounts(bool)
virtual void closeEvent(QCloseEvent *)
void setSingleShot(bool singleShot)
void slotSliderReleased()