summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/SettingsDialog.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-31 01:24:28 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-31 01:32:51 +0100
commit952b63f68de93e8acf7aab81373661dae8d5098b (patch)
treea3be2560a2c34f8827a37998c7baa5a525dde22f /gui/dialogs/SettingsDialog.cpp
parentc44bcfab4bf4f25a7f39d6154fc366db4c0fcfbc (diff)
downloadMultiMC-952b63f68de93e8acf7aab81373661dae8d5098b.tar
MultiMC-952b63f68de93e8acf7aab81373661dae8d5098b.tar.gz
MultiMC-952b63f68de93e8acf7aab81373661dae8d5098b.tar.lz
MultiMC-952b63f68de93e8acf7aab81373661dae8d5098b.tar.xz
MultiMC-952b63f68de93e8acf7aab81373661dae8d5098b.zip
Refactor icon lists heavily
* Icon list now uses a filesystem watcher for updates * Icon folder is user-customizable * All the little details. ALL OF THEM.
Diffstat (limited to 'gui/dialogs/SettingsDialog.cpp')
-rw-r--r--gui/dialogs/SettingsDialog.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/gui/dialogs/SettingsDialog.cpp b/gui/dialogs/SettingsDialog.cpp
index 30a973da..569c8f63 100644
--- a/gui/dialogs/SettingsDialog.cpp
+++ b/gui/dialogs/SettingsDialog.cpp
@@ -102,6 +102,18 @@ void SettingsDialog::on_instDirBrowseBtn_clicked()
ui->instDirTextBox->setText(cooked_dir);
}
}
+void SettingsDialog::on_iconsDirBrowseBtn_clicked()
+{
+ QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Icons Directory"),
+ ui->iconsDirTextBox->text());
+ QString cooked_dir = NormalizePath(raw_dir);
+
+ // do not allow current dir - it's dirty. Do not allow dirs that don't exist
+ if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists())
+ {
+ ui->iconsDirTextBox->setText(cooked_dir);
+ }
+}
void SettingsDialog::on_modsDirBrowseBtn_clicked()
{
@@ -205,6 +217,7 @@ void SettingsDialog::applySettings(SettingsObject *s)
s->set("InstanceDir", ui->instDirTextBox->text());
s->set("CentralModsDir", ui->modsDirTextBox->text());
s->set("LWJGLDir", ui->lwjglDirTextBox->text());
+ s->set("IconsDir", ui->iconsDirTextBox->text());
// Editors
QString jsonEditor = ui->jsonEditorTextBox->text();
@@ -271,6 +284,7 @@ void SettingsDialog::loadSettings(SettingsObject *s)
ui->instDirTextBox->setText(s->get("InstanceDir").toString());
ui->modsDirTextBox->setText(s->get("CentralModsDir").toString());
ui->lwjglDirTextBox->setText(s->get("LWJGLDir").toString());
+ ui->iconsDirTextBox->setText(s->get("IconsDir").toString());
// Editors
ui->jsonEditorTextBox->setText(s->get("JsonEditor").toString());