Skip to content

Commit 5895a50

Browse files
committed
Merge bitcoin-core#391: Add cancel button to configuration options popup
0b869df 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 0b869df, tested on Linux Mint 20.2 (Qt 5.12.8): prayank23: tACK bitcoin-core@0b869df Tree-SHA512: c314e8b84064134f028f66f5015eb0f6ba33d5d4174c9ff49dcb5d2b577dce6019f59f9c7913393a415a323ea98c26febf5ca26e3e2102e7a1d31171e01937f1
2 parents ee1db7b + 0b869df commit 5895a50

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/qt/optionsdialog.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,22 @@ void OptionsDialog::on_resetButton_clicked()
296296

297297
void OptionsDialog::on_openBitcoinConfButton_clicked()
298298
{
299-
/* explain the purpose of the config file */
300-
QMessageBox::information(this, tr("Configuration options"),
301-
tr("The configuration file is used to specify advanced user options which override GUI settings. "
302-
"Additionally, any command-line options will override this configuration file."));
299+
QMessageBox config_msgbox(this);
300+
config_msgbox.setIcon(QMessageBox::Information);
301+
//: Window title text of pop-up box that allows opening up of configuration file.
302+
config_msgbox.setWindowTitle(tr("Configuration options"));
303+
/*: Explanatory text about the priority order of instructions considered by client.
304+
The order from high to low being: command-line, configuration file, GUI settings. */
305+
config_msgbox.setText(tr("The configuration file is used to specify advanced user options which override GUI settings. "
306+
"Additionally, any command-line options will override this configuration file."));
307+
308+
QPushButton* open_button = config_msgbox.addButton(tr("Continue"), QMessageBox::ActionRole);
309+
config_msgbox.addButton(tr("Cancel"), QMessageBox::RejectRole);
310+
open_button->setDefault(true);
311+
312+
config_msgbox.exec();
313+
314+
if (config_msgbox.clickedButton() != open_button) return;
303315

304316
/* show an error if there was some problem opening the file */
305317
if (!GUIUtil::openBitcoinConf())

0 commit comments

Comments
 (0)