From 4c9db9b5874acb5db2fb9bb1eb5d549aa17f9aa8 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Mon, 19 Feb 2024 13:53:47 +0000 Subject: qt, test: Recognize dialog object by name --- src/qt/sendcoinsdialog.cpp | 1 + src/qt/test/wallettests.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 3c331c70ef..89bd35eb1b 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -406,6 +406,7 @@ void SendCoinsDialog::presentPSBT(PartiallySignedTransaction& psbtx) msgBox.setInformativeText(tr("The PSBT has been copied to the clipboard. You can also save it.")); msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard); msgBox.setDefaultButton(QMessageBox::Discard); + msgBox.setObjectName("psbt_copied_message"); switch (msgBox.exec()) { case QMessageBox::Save: { QString selectedFilter; diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp index f5b86f44a6..603df0b15f 100644 --- a/src/qt/test/wallettests.cpp +++ b/src/qt/test/wallettests.cpp @@ -418,7 +418,7 @@ void TestGUIWatchOnly(interfaces::Node& node, TestChain100Setup& test) timer.setInterval(500); QObject::connect(&timer, &QTimer::timeout, [&](){ for (QWidget* widget : QApplication::topLevelWidgets()) { - if (widget->inherits("QMessageBox")) { + if (widget->inherits("QMessageBox") && widget->objectName().compare("psbt_copied_message") == 0) { QMessageBox* dialog = qobject_cast(widget); QAbstractButton* button = dialog->button(QMessageBox::Discard); button->setEnabled(true); -- cgit v1.2.3