diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-10-06 02:22:18 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-10-06 02:22:18 +0200 |
commit | 9cef16a47d8e6085baec08c4b2823631ef8f1b30 (patch) | |
tree | 319d22c472b8d502deecd96bc587ce1e07545262 /gui | |
parent | f83119ce7ec3d11a903901b8eff762d2b0a9f635 (diff) | |
parent | b5816f976eca1b2220fff284c5dbceeb5e211bde (diff) | |
download | MultiMC-9cef16a47d8e6085baec08c4b2823631ef8f1b30.tar MultiMC-9cef16a47d8e6085baec08c4b2823631ef8f1b30.tar.gz MultiMC-9cef16a47d8e6085baec08c4b2823631ef8f1b30.tar.lz MultiMC-9cef16a47d8e6085baec08c4b2823631ef8f1b30.tar.xz MultiMC-9cef16a47d8e6085baec08c4b2823631ef8f1b30.zip |
Merge branch 'develop' of https://github.com/Drayshak/MultiMC5 into develop
Diffstat (limited to 'gui')
-rw-r--r-- | gui/settingsdialog.cpp | 20 | ||||
-rw-r--r-- | gui/settingsdialog.h | 4 | ||||
-rw-r--r-- | gui/settingsdialog.ui | 37 |
3 files changed, 51 insertions, 10 deletions
diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp index 31fe2d96..c6fe893d 100644 --- a/gui/settingsdialog.cpp +++ b/gui/settingsdialog.cpp @@ -13,10 +13,11 @@ * limitations under the License. */ +#include <MultiMC.h> #include "settingsdialog.h" #include "ui_settingsdialog.h" +#include "logic/JavaUtils.h" -#include <MultiMC.h> #include <settingsobject.h> #include <QFileDialog> #include <QMessageBox> @@ -180,3 +181,20 @@ void SettingsDialog::loadSettings(SettingsObject *s) ui->preLaunchCmdTextBox->setText(s->get("PreLaunchCommand").toString()); ui->postExitCmdTextBox->setText(s->get("PostExitCommand").toString()); } + +void SettingsDialog::on_pushButton_clicked() +{ + JavaUtils jut; + QStringList paths = jut.FindJavaPath(); + + ui->javaPathTextBox->setText(paths.at(0)); +} + +void SettingsDialog::on_btnBrowse_clicked() +{ + QString dir = QFileDialog::getOpenFileName(this, tr("Find Java executable")); + if(!dir.isNull()) + { + ui->javaPathTextBox->setText(dir); + } +} diff --git a/gui/settingsdialog.h b/gui/settingsdialog.h index b0a8c673..a8dfb1c6 100644 --- a/gui/settingsdialog.h +++ b/gui/settingsdialog.h @@ -53,6 +53,10 @@ private slots: void on_buttonBox_accepted(); + void on_pushButton_clicked(); + + void on_btnBrowse_clicked(); + private: Ui::SettingsDialog *ui; }; diff --git a/gui/settingsdialog.ui b/gui/settingsdialog.ui index 0d30e301..d7a134fb 100644 --- a/gui/settingsdialog.ui +++ b/gui/settingsdialog.ui @@ -33,7 +33,7 @@ <enum>QTabWidget::Rounded</enum> </property> <property name="currentIndex"> - <number>0</number> + <number>2</number> </property> <widget class="QWidget" name="generalTab"> <attribute name="title"> @@ -379,26 +379,45 @@ </property> </widget> </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="javaPathTextBox"/> - </item> - <item row="1" column="0"> + <item row="2" column="0"> <widget class="QLabel" name="labelJVMArgs"> <property name="text"> <string>JVM arguments:</string> </property> </widget> </item> - <item row="0" column="2"> - <widget class="QPushButton" name="pushButton"> + <item row="1" column="3"> + <widget class="QPushButton" name="btnBrowse"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text"> - <string>Auto-detect</string> + <string>Browse...</string> </property> </widget> </item> - <item row="1" column="1" colspan="2"> + <item row="0" column="1" colspan="3"> + <widget class="QLineEdit" name="javaPathTextBox"/> + </item> + <item row="2" column="1" colspan="3"> <widget class="QLineEdit" name="jvmArgsTextBox"/> </item> + <item row="1" column="2"> + <widget class="QPushButton" name="pushButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Auto-detect</string> + </property> + </widget> + </item> </layout> </widget> </item> |