aboutsummaryrefslogtreecommitdiff
path: root/src/qt/sendcoinsdialog.h
diff options
context:
space:
mode:
authorTyler Hardin <th020394@gmail.com>2016-05-09 22:26:57 -0400
committerTyler Hardin <th020394@gmail.com>2016-05-09 22:26:57 -0400
commit3902a291abecad4da25d496f0e3e2b45f43a7947 (patch)
treedb2ce399f5450c6c11127eba2767cf65c5a0a511 /src/qt/sendcoinsdialog.h
parent42a67533828fe419f021d586495f8266db71b659 (diff)
Qt: Delay user confirmation of send
I made a subclass of QMessageBox that disables the send button in exec() and starts a timer that calls a slot to re-enable it after a configurable delay. It also has a countdown in the send/yes button while it is disabled to hint to the user why the send button is disabled (and that it is actually supposed to be disabled).
Diffstat (limited to 'src/qt/sendcoinsdialog.h')
-rw-r--r--src/qt/sendcoinsdialog.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h
index ec171734fa..be4f2ee44b 100644
--- a/src/qt/sendcoinsdialog.h
+++ b/src/qt/sendcoinsdialog.h
@@ -8,7 +8,9 @@
#include "walletmodel.h"
#include <QDialog>
+#include <QMessageBox>
#include <QString>
+#include <QTimer>
class ClientModel;
class OptionsModel;
@@ -100,4 +102,24 @@ Q_SIGNALS:
void message(const QString &title, const QString &message, unsigned int style);
};
+
+
+class SendConfirmationDialog : public QMessageBox
+{
+ Q_OBJECT
+
+public:
+ SendConfirmationDialog(const QString &title, const QString &text, int secDelay = 0, QWidget *parent = 0);
+ int exec();
+
+private Q_SLOTS:
+ void countDown();
+ void updateYesButton();
+
+private:
+ QAbstractButton *yesButton;
+ QTimer countDownTimer;
+ int secDelay;
+};
+
#endif // BITCOIN_QT_SENDCOINSDIALOG_H