summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/SettingsDialog.cpp
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2013-12-20 14:47:26 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-21 23:40:37 +0100
commit82c87aa06f793b9f38e6cb42d284f00695f4bac5 (patch)
tree21f893b0336a90d4e4b9f14cb5312f2c1ea04280 /gui/dialogs/SettingsDialog.cpp
parent34a3fedf7b115c84ff305bf72fbc9d568682d84a (diff)
downloadMultiMC-82c87aa06f793b9f38e6cb42d284f00695f4bac5.tar
MultiMC-82c87aa06f793b9f38e6cb42d284f00695f4bac5.tar.gz
MultiMC-82c87aa06f793b9f38e6cb42d284f00695f4bac5.tar.lz
MultiMC-82c87aa06f793b9f38e6cb42d284f00695f4bac5.tar.xz
MultiMC-82c87aa06f793b9f38e6cb42d284f00695f4bac5.zip
Initial FTB support. Allows "tracking" of FTB instances.
Diffstat (limited to 'gui/dialogs/SettingsDialog.cpp')
-rw-r--r--gui/dialogs/SettingsDialog.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/gui/dialogs/SettingsDialog.cpp b/gui/dialogs/SettingsDialog.cpp
index b960483a..131cb5c3 100644
--- a/gui/dialogs/SettingsDialog.cpp
+++ b/gui/dialogs/SettingsDialog.cpp
@@ -60,6 +60,32 @@ void SettingsDialog::updateCheckboxStuff()
ui->windowHeightSpinBox->setEnabled(!ui->maximizedCheckBox->isChecked());
}
+void SettingsDialog::on_ftbLauncherBrowseBtn_clicked()
+{
+ QString raw_dir = QFileDialog::getExistingDirectory(this, tr("FTB Launcher Directory"),
+ ui->ftbLauncherBox->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->ftbLauncherBox->setText(cooked_dir);
+ }
+}
+
+void SettingsDialog::on_ftbBrowseBtn_clicked()
+{
+ QString raw_dir = QFileDialog::getExistingDirectory(this, tr("FTB Directory"),
+ ui->ftbBox->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->ftbBox->setText(cooked_dir);
+ }
+}
+
void SettingsDialog::on_instDirBrowseBtn_clicked()
{
QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Instance Directory"),
@@ -135,6 +161,11 @@ void SettingsDialog::applySettings(SettingsObject *s)
// Updates
s->set("AutoUpdate", ui->autoUpdateCheckBox->isChecked());
+ // FTB
+ s->set("TrackFTBInstances", ui->trackFtbBox->isChecked());
+ s->set("FTBLauncherRoot", ui->ftbLauncherBox->text());
+ s->set("FTBRoot", ui->ftbBox->text());
+
// Folders
// TODO: Offer to move instances to new instance folder.
s->set("InstanceDir", ui->instDirTextBox->text());
@@ -185,6 +216,11 @@ void SettingsDialog::loadSettings(SettingsObject *s)
ui->autoUpdateCheckBox->setChecked(s->get("AutoUpdate").toBool());
ui->devBuildsCheckBox->setChecked(s->get("UseDevBuilds").toBool());
+ // FTB
+ ui->trackFtbBox->setChecked(s->get("TrackFTBInstances").toBool());
+ ui->ftbLauncherBox->setText(s->get("FTBLauncherRoot").toString());
+ ui->ftbBox->setText(s->get("FTBRoot").toString());
+
// Folders
ui->instDirTextBox->setText(s->get("InstanceDir").toString());
ui->modsDirTextBox->setText(s->get("CentralModsDir").toString());