diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-09-12 19:19:45 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-09-12 19:21:55 +0300 |
commit | 5895a502cbe42099e8b250575a593a0570aaa80e (patch) | |
tree | 1557c91b653cdae3d003462db3f48730105a015f | |
parent | ee1db7b6dc4e8a3458a7cfb5ead445c56fb75c51 (diff) | |
parent | 0b869df1c913839855148d728514c76ba7664092 (diff) | |
download | bitcoin-5895a502cbe42099e8b250575a593a0570aaa80e.tar.xz |
Merge bitcoin-core/gui#391: Add cancel button to configuration options popup
0b869df1c913839855148d728514c76ba7664092 qt: Add cancel button to configuration options popup (Shashwat)
Pull request description:
This PR renames the **OK** button to **Continue** and adds a **Cancel** button to the configuration options pop-up.
This feature will give the user an option to abort opening the configuration file if they want to. This is an essential helpful feature that was missing in the master branch.
In some windows managers such as Windows I3. The exit button at the top right corner is missing. So this feature becomes crucial there. And even when the exit button is there, it doesn't prevent the opening of the configuration file even when pressed.
Additionally, it will always be possible to close using Keyboard Shortcut. This PR helps accessibility for those who need to use a mouse.
<table>
<tr>
<td>Master
</td>
<td>PR
</td>
</tr>
<tr>
<td>
![Cancel-conf master(1)](https://user-images.githubusercontent.com/85434418/127555137-7a16dffd-109d-4024-917b-6b85f4df4f4a.png)
</td>
<td>
![Screenshot from 2021-09-07 20-15-28](https://user-images.githubusercontent.com/85434418/132365729-14f71f92-220b-4bb6-bed4-8315bd5697e6.png)
</td>
</tr>
</table>
ACKs for top commit:
hebasto:
ACK 0b869df1c913839855148d728514c76ba7664092, tested on Linux Mint 20.2 (Qt 5.12.8):
prayank23:
tACK https://github.com/bitcoin-core/gui/pull/391/commits/0b869df1c913839855148d728514c76ba7664092
Tree-SHA512: c314e8b84064134f028f66f5015eb0f6ba33d5d4174c9ff49dcb5d2b577dce6019f59f9c7913393a415a323ea98c26febf5ca26e3e2102e7a1d31171e01937f1
-rw-r--r-- | src/qt/optionsdialog.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 5ad4fc9b33..92644ef24b 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -296,10 +296,22 @@ void OptionsDialog::on_resetButton_clicked() void OptionsDialog::on_openBitcoinConfButton_clicked() { - /* explain the purpose of the config file */ - QMessageBox::information(this, tr("Configuration options"), - tr("The configuration file is used to specify advanced user options which override GUI settings. " - "Additionally, any command-line options will override this configuration file.")); + QMessageBox config_msgbox(this); + config_msgbox.setIcon(QMessageBox::Information); + //: Window title text of pop-up box that allows opening up of configuration file. + config_msgbox.setWindowTitle(tr("Configuration options")); + /*: Explanatory text about the priority order of instructions considered by client. + The order from high to low being: command-line, configuration file, GUI settings. */ + config_msgbox.setText(tr("The configuration file is used to specify advanced user options which override GUI settings. " + "Additionally, any command-line options will override this configuration file.")); + + QPushButton* open_button = config_msgbox.addButton(tr("Continue"), QMessageBox::ActionRole); + config_msgbox.addButton(tr("Cancel"), QMessageBox::RejectRole); + open_button->setDefault(true); + + config_msgbox.exec(); + + if (config_msgbox.clickedButton() != open_button) return; /* show an error if there was some problem opening the file */ if (!GUIUtil::openBitcoinConf()) |