summaryrefslogtreecommitdiffstats
path: root/gui/dialogs
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-02-16 10:46:14 +0100
committerJan Dalheimer <jan@dalheimer.de>2014-02-16 10:46:14 +0100
commit616c37269053bc4f111792dbb9374cc119a58339 (patch)
tree7ac3bc3bbec628593473bc87ffcec9acf24e990b /gui/dialogs
parent994972bf5da5584186e6e82c36287afeb6c1e23a (diff)
downloadMultiMC-616c37269053bc4f111792dbb9374cc119a58339.tar
MultiMC-616c37269053bc4f111792dbb9374cc119a58339.tar.gz
MultiMC-616c37269053bc4f111792dbb9374cc119a58339.tar.lz
MultiMC-616c37269053bc4f111792dbb9374cc119a58339.tar.xz
MultiMC-616c37269053bc4f111792dbb9374cc119a58339.zip
Fix more stuff. Detached tools, only MCEdit for now.
Diffstat (limited to 'gui/dialogs')
-rw-r--r--gui/dialogs/SettingsDialog.cpp28
-rw-r--r--gui/dialogs/SettingsDialog.h2
-rw-r--r--gui/dialogs/SettingsDialog.ui34
3 files changed, 62 insertions, 2 deletions
diff --git a/gui/dialogs/SettingsDialog.cpp b/gui/dialogs/SettingsDialog.cpp
index 7afb6565..9423d7eb 100644
--- a/gui/dialogs/SettingsDialog.cpp
+++ b/gui/dialogs/SettingsDialog.cpp
@@ -374,6 +374,7 @@ void SettingsDialog::applySettings(SettingsObject *s)
// Profilers
s->set("JProfilerPath", ui->jprofilerPathEdit->text());
s->set("JVisualVMPath", ui->jvisualvmPathEdit->text());
+ s->set("MCEditPath", ui->mceditPathEdit->text());
}
void SettingsDialog::loadSettings(SettingsObject *s)
@@ -457,6 +458,7 @@ void SettingsDialog::loadSettings(SettingsObject *s)
// Profilers
ui->jprofilerPathEdit->setText(s->get("JProfilerPath").toString());
ui->jvisualvmPathEdit->setText(s->get("JVisualVMPath").toString());
+ ui->mceditPathEdit->setText(s->get("MCEditPath").toString());
}
void SettingsDialog::on_javaDetectBtn_clicked()
@@ -565,3 +567,29 @@ void SettingsDialog::on_jvisualvmCheckBtn_clicked()
QMessageBox::information(this, tr("OK"), tr("JVisualVM setup seems to be OK"));
}
}
+
+void SettingsDialog::on_mceditPathBtn_clicked()
+{
+ QString raw_dir = QFileDialog::getOpenFileName(this, tr("MCEdit Path"),
+ ui->jvisualvmPathEdit->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->mceditPathEdit->setText(cooked_dir);
+ }
+}
+void SettingsDialog::on_mceditCheckBtn_clicked()
+{
+ QString error;
+ if (!MMC->tools()["mcedit"]->check(ui->mceditPathEdit->text(), &error))
+ {
+ QMessageBox::critical(this, tr("Error"),
+ tr("Error while checking MCEdit install:\n%1").arg(error));
+ }
+ else
+ {
+ QMessageBox::information(this, tr("OK"), tr("MCEdit setup seems to be OK"));
+ }
+}
diff --git a/gui/dialogs/SettingsDialog.h b/gui/dialogs/SettingsDialog.h
index 60d569f9..d8495fdd 100644
--- a/gui/dialogs/SettingsDialog.h
+++ b/gui/dialogs/SettingsDialog.h
@@ -79,6 +79,8 @@ slots:
void on_jprofilerCheckBtn_clicked();
void on_jvisualvmPathBtn_clicked();
void on_jvisualvmCheckBtn_clicked();
+ void on_mceditPathBtn_clicked();
+ void on_mceditCheckBtn_clicked();
/*!
* Updates the list of update channels in the combo box.
diff --git a/gui/dialogs/SettingsDialog.ui b/gui/dialogs/SettingsDialog.ui
index acf360a3..fbfa7aed 100644
--- a/gui/dialogs/SettingsDialog.ui
+++ b/gui/dialogs/SettingsDialog.ui
@@ -863,9 +863,9 @@
</item>
</layout>
</widget>
- <widget class="QWidget" name="profilingTab">
+ <widget class="QWidget" name="externalToolsTab">
<attribute name="title">
- <string>Profiling</string>
+ <string>External Tools</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_13">
<item>
@@ -929,6 +929,36 @@
</widget>
</item>
<item>
+ <widget class="QGroupBox" name="groupBox_4">
+ <property name="title">
+ <string>MCEdit</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_12">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
+ <item>
+ <widget class="QLineEdit" name="mceditPathEdit"/>
+ </item>
+ <item>
+ <widget class="QPushButton" name="mceditPathBtn">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QPushButton" name="mceditCheckBtn">
+ <property name="text">
+ <string>Check</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>