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