Skip to content

Commit 4c9db9b

Browse files
committed
qt, test: Recognize dialog object by name
1 parent 3cbc8cb commit 4c9db9b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/qt/sendcoinsdialog.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ void SendCoinsDialog::presentPSBT(PartiallySignedTransaction& psbtx)
406406
msgBox.setInformativeText(tr("The PSBT has been copied to the clipboard. You can also save it."));
407407
msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard);
408408
msgBox.setDefaultButton(QMessageBox::Discard);
409+
msgBox.setObjectName("psbt_copied_message");
409410
switch (msgBox.exec()) {
410411
case QMessageBox::Save: {
411412
QString selectedFilter;

src/qt/test/wallettests.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ void TestGUIWatchOnly(interfaces::Node& node, TestChain100Setup& test)
418418
timer.setInterval(500);
419419
QObject::connect(&timer, &QTimer::timeout, [&](){
420420
for (QWidget* widget : QApplication::topLevelWidgets()) {
421-
if (widget->inherits("QMessageBox")) {
421+
if (widget->inherits("QMessageBox") && widget->objectName().compare("psbt_copied_message") == 0) {
422422
QMessageBox* dialog = qobject_cast<QMessageBox*>(widget);
423423
QAbstractButton* button = dialog->button(QMessageBox::Discard);
424424
button->setEnabled(true);

0 commit comments

Comments
 (0)