Skip to content

Commit

Permalink
Merge bitcoin-core/gui#797: test: Recognize dialog object by name
Browse files Browse the repository at this point in the history
4c9db9b qt, test: Recognize dialog object by name (Hennadii Stepanov)

Pull request description:

  Fixes bitcoin-core/gui#796.

ACKs for top commit:
  furszy:
    Code ACK 4c9db9b
  BrandonOdiwuor:
    ACK 4c9db9b

Tree-SHA512: bd54a95d3ef77bce189c2ce279c6b3b4045bdc749e115045bfd7beda73be5a553e145eb331f454cb50374c5a9e98e73794d72d43aa1887dc42bcc585ca17d10c
  • Loading branch information
hebasto committed Feb 20, 2024
2 parents bdddf36 + 4c9db9b commit d301c99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/qt/test/wallettests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<QMessageBox*>(widget);
QAbstractButton* button = dialog->button(QMessageBox::Discard);
button->setEnabled(true);
Expand Down

0 comments on commit d301c99

Please sign in to comment.