From 1dee4bb60d08995f0fd4eb229f131f2ca546d24c Mon Sep 17 00:00:00 2001 From: Sky Date: Sat, 5 Oct 2013 01:08:13 +0100 Subject: Add naive Windows Java detection - JavaUtils for finding it on other systems (incomplete) --- gui/settingsdialog.cpp | 11 ++++++++++- gui/settingsdialog.h | 2 ++ gui/settingsdialog.ui | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'gui') diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp index 9736c1c7..b5ff8d56 100644 --- a/gui/settingsdialog.cpp +++ b/gui/settingsdialog.cpp @@ -13,10 +13,11 @@ * limitations under the License. */ +#include #include "settingsdialog.h" #include "ui_settingsdialog.h" +#include "logic/JavaUtils.h" -#include #include #include #include @@ -180,3 +181,11 @@ 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)); +} diff --git a/gui/settingsdialog.h b/gui/settingsdialog.h index b0a8c673..2611f105 100644 --- a/gui/settingsdialog.h +++ b/gui/settingsdialog.h @@ -53,6 +53,8 @@ private slots: void on_buttonBox_accepted(); + void on_pushButton_clicked(); + private: Ui::SettingsDialog *ui; }; diff --git a/gui/settingsdialog.ui b/gui/settingsdialog.ui index 0d30e301..f0cb5c3d 100644 --- a/gui/settingsdialog.ui +++ b/gui/settingsdialog.ui @@ -33,7 +33,7 @@ QTabWidget::Rounded - 0 + 2 -- cgit v1.2.3 From 932376c6e0aad27f65b25574b23e601afb6047d2 Mon Sep 17 00:00:00 2001 From: Sky Date: Sat, 5 Oct 2013 02:02:47 +0100 Subject: Add "browse" button using Qt's file browser to settings dialog --- gui/settingsdialog.cpp | 9 +++++++++ gui/settingsdialog.h | 2 ++ gui/settingsdialog.ui | 23 +++++++++++++++-------- 3 files changed, 26 insertions(+), 8 deletions(-) (limited to 'gui') diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp index b5ff8d56..fd876a97 100644 --- a/gui/settingsdialog.cpp +++ b/gui/settingsdialog.cpp @@ -189,3 +189,12 @@ void SettingsDialog::on_pushButton_clicked() 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 2611f105..a8dfb1c6 100644 --- a/gui/settingsdialog.h +++ b/gui/settingsdialog.h @@ -55,6 +55,8 @@ private slots: void on_pushButton_clicked(); + void on_btnBrowse_clicked(); + private: Ui::SettingsDialog *ui; }; diff --git a/gui/settingsdialog.ui b/gui/settingsdialog.ui index f0cb5c3d..36c117f3 100644 --- a/gui/settingsdialog.ui +++ b/gui/settingsdialog.ui @@ -379,26 +379,33 @@ - - - - + JVM arguments: - - + + - Auto-detect + Browse... - + + + + + + + + Auto-detect + + + -- cgit v1.2.3 From 2398acc9e490ce124aa621c19156c89ef87591f1 Mon Sep 17 00:00:00 2001 From: Sky Date: Sat, 5 Oct 2013 02:07:19 +0100 Subject: Fix Java detection button sizes --- gui/settingsdialog.ui | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gui') diff --git a/gui/settingsdialog.ui b/gui/settingsdialog.ui index 36c117f3..d7a134fb 100644 --- a/gui/settingsdialog.ui +++ b/gui/settingsdialog.ui @@ -388,6 +388,12 @@ + + + 0 + 0 + + Browse... @@ -401,6 +407,12 @@ + + + 0 + 0 + + Auto-detect -- cgit v1.2.3