mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-06 14:19:59 -05:00
qt, test: Recognize dialog object by name
This commit is contained in:
parent
3cbc8cbc71
commit
4c9db9b587
2 changed files with 2 additions and 1 deletions
|
@ -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.setInformativeText(tr("The PSBT has been copied to the clipboard. You can also save it."));
|
||||||
msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard);
|
msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard);
|
||||||
msgBox.setDefaultButton(QMessageBox::Discard);
|
msgBox.setDefaultButton(QMessageBox::Discard);
|
||||||
|
msgBox.setObjectName("psbt_copied_message");
|
||||||
switch (msgBox.exec()) {
|
switch (msgBox.exec()) {
|
||||||
case QMessageBox::Save: {
|
case QMessageBox::Save: {
|
||||||
QString selectedFilter;
|
QString selectedFilter;
|
||||||
|
|
|
@ -418,7 +418,7 @@ void TestGUIWatchOnly(interfaces::Node& node, TestChain100Setup& test)
|
||||||
timer.setInterval(500);
|
timer.setInterval(500);
|
||||||
QObject::connect(&timer, &QTimer::timeout, [&](){
|
QObject::connect(&timer, &QTimer::timeout, [&](){
|
||||||
for (QWidget* widget : QApplication::topLevelWidgets()) {
|
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);
|
QMessageBox* dialog = qobject_cast<QMessageBox*>(widget);
|
||||||
QAbstractButton* button = dialog->button(QMessageBox::Discard);
|
QAbstractButton* button = dialog->button(QMessageBox::Discard);
|
||||||
button->setEnabled(true);
|
button->setEnabled(true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue