diff options
author | Sky <git@bunnies.cc> | 2013-10-05 02:02:47 +0100 |
---|---|---|
committer | Sky <git@bunnies.cc> | 2013-10-05 02:02:47 +0100 |
commit | 932376c6e0aad27f65b25574b23e601afb6047d2 (patch) | |
tree | eca23e9009b0f5cff7e1c06d783784a651d3551b /gui | |
parent | 1dee4bb60d08995f0fd4eb229f131f2ca546d24c (diff) | |
download | MultiMC-932376c6e0aad27f65b25574b23e601afb6047d2.tar MultiMC-932376c6e0aad27f65b25574b23e601afb6047d2.tar.gz MultiMC-932376c6e0aad27f65b25574b23e601afb6047d2.tar.lz MultiMC-932376c6e0aad27f65b25574b23e601afb6047d2.tar.xz MultiMC-932376c6e0aad27f65b25574b23e601afb6047d2.zip |
Add "browse" button using Qt's file browser to settings dialog
Diffstat (limited to 'gui')
-rw-r--r-- | gui/settingsdialog.cpp | 9 | ||||
-rw-r--r-- | gui/settingsdialog.h | 2 | ||||
-rw-r--r-- | gui/settingsdialog.ui | 23 |
3 files changed, 26 insertions, 8 deletions
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 @@ </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="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="text"> + <string>Auto-detect</string> + </property> + </widget> + </item> </layout> </widget> </item> |