@@ -22,7 +22,9 @@ namespace
22
22
// ! Press "Yes" button in modal send confirmation dialog.
23
23
void ConfirmSend ()
24
24
{
25
- QTimer::singleShot (0 , Qt::PreciseTimer, []() {
25
+ QTimer* timer = new QTimer;
26
+ timer->setSingleShot (true );
27
+ QObject::connect (timer, &QTimer::timeout, []() {
26
28
for (QWidget* widget : QApplication::topLevelWidgets ()) {
27
29
if (widget->inherits (" SendConfirmationDialog" )) {
28
30
SendConfirmationDialog* dialog = qobject_cast<SendConfirmationDialog*>(widget);
@@ -32,6 +34,7 @@ void ConfirmSend()
32
34
}
33
35
}
34
36
});
37
+ timer->start (0 );
35
38
}
36
39
37
40
// ! Send coins to address and return txid.
@@ -42,9 +45,9 @@ uint256 SendCoins(CWallet& wallet, SendCoinsDialog& sendCoinsDialog, const CBitc
42
45
entry->findChild <QValidatedLineEdit*>(" payTo" )->setText (QString::fromStdString (address.ToString ()));
43
46
entry->findChild <BitcoinAmountField*>(" payAmount" )->setValue (amount);
44
47
uint256 txid;
45
- boost::signals2::scoped_connection c = wallet.NotifyTransactionChanged .connect ([&txid](CWallet*, const uint256& hash, ChangeType status) {
48
+ boost::signals2::scoped_connection c ( wallet.NotifyTransactionChanged .connect ([&txid](CWallet*, const uint256& hash, ChangeType status) {
46
49
if (status == CT_NEW) txid = hash;
47
- });
50
+ })) ;
48
51
ConfirmSend ();
49
52
QMetaObject::invokeMethod (&sendCoinsDialog, " on_sendButton_clicked" );
50
53
return txid;
0 commit comments