Skip to content

Commit 7bf22bf

Browse files
committed
gui: Reject options dialog when key escape is pressed
1 parent 4a43306 commit 7bf22bf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/qt/optionsdialog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
115115
mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
116116
mapper->setOrientation(Qt::Vertical);
117117

118+
GUIUtil::ItemDelegate* delegate = new GUIUtil::ItemDelegate(mapper);
119+
connect(delegate, &GUIUtil::ItemDelegate::keyEscapePressed, this, &OptionsDialog::reject);
120+
mapper->setItemDelegate(delegate);
121+
118122
/* setup/change UI elements when proxy IPs are invalid/valid */
119123
ui->proxyIp->setCheckValidator(new ProxyAddressValidator(parent));
120124
ui->proxyIpTor->setCheckValidator(new ProxyAddressValidator(parent));

0 commit comments

Comments
 (0)