aboutsummaryrefslogtreecommitdiff
path: root/src/qt/optionsdialog.cpp
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2018-07-30 22:47:48 +0100
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2018-07-30 23:13:04 +0100
commit7bf22bf0c21d13557ec46a67413819ebcabc3df0 (patch)
tree217bcb113f44fe3f8fcea4ca30f78aefcc97d438 /src/qt/optionsdialog.cpp
parent4a43306a4f643cf0d356d5d5e16913541f1bc893 (diff)
gui: Reject options dialog when key escape is pressed
Diffstat (limited to 'src/qt/optionsdialog.cpp')
-rw-r--r--src/qt/optionsdialog.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index a57343f036..eea9a882b1 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -115,6 +115,10 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
mapper->setOrientation(Qt::Vertical);
+ GUIUtil::ItemDelegate* delegate = new GUIUtil::ItemDelegate(mapper);
+ connect(delegate, &GUIUtil::ItemDelegate::keyEscapePressed, this, &OptionsDialog::reject);
+ mapper->setItemDelegate(delegate);
+
/* setup/change UI elements when proxy IPs are invalid/valid */
ui->proxyIp->setCheckValidator(new ProxyAddressValidator(parent));
ui->proxyIpTor->setCheckValidator(new ProxyAddressValidator(parent));