From 0b869df1c913839855148d728514c76ba7664092 Mon Sep 17 00:00:00 2001 From: Shashwat Date: Wed, 21 Jul 2021 22:12:25 +0530 Subject: [PATCH] qt: Add cancel button to configuration options popup This adds a cancel buttion to the configuration options window --- src/qt/optionsdialog.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index b12fe965675..00d81f57fe4 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -295,10 +295,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())