aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletcontroller.h
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-01-21 16:58:20 +0000
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-02-04 12:23:40 +0000
commit8847cdaaaeb45c1ddee89f43ac4b8fafb20e5c0d (patch)
tree321d97f44c2168eef5725b5e2528de375d96dbaf /src/qt/walletcontroller.h
parent4c8982a88e3d9fae4f8fc147a2d9f9650a493da7 (diff)
gui: Add OpenWalletActivity
Diffstat (limited to 'src/qt/walletcontroller.h')
-rw-r--r--src/qt/walletcontroller.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/qt/walletcontroller.h b/src/qt/walletcontroller.h
index 1664fa6f3f..f19c0e1f3d 100644
--- a/src/qt/walletcontroller.h
+++ b/src/qt/walletcontroller.h
@@ -12,6 +12,7 @@
#include <memory>
#include <vector>
+#include <QMessageBox>
#include <QMutex>
#include <QThread>
@@ -23,6 +24,8 @@ class Handler;
class Node;
} // namespace interfaces
+class OpenWalletActivity;
+
/**
* Controller between interfaces::Node, WalletModel instances and the GUI.
*/
@@ -40,7 +43,7 @@ public:
std::vector<WalletModel*> getWallets() const;
std::vector<std::string> getWalletsAvailableToOpen() const;
- WalletModel* openWallet(const std::string& name, QWidget* parent = nullptr);
+ OpenWalletActivity* openWallet(const std::string& name, QWidget* parent = nullptr);
private Q_SLOTS:
void addWallet(WalletModel* wallet_model);
@@ -59,6 +62,28 @@ private:
mutable QMutex m_mutex;
std::vector<WalletModel*> m_wallets;
std::unique_ptr<interfaces::Handler> m_handler_load_wallet;
+
+ friend class OpenWalletActivity;
+};
+
+class OpenWalletActivity : public QObject
+{
+ Q_OBJECT
+
+public:
+ OpenWalletActivity(WalletController* wallet_controller, const std::string& name);
+
+public Q_SLOTS:
+ void open();
+
+Q_SIGNALS:
+ void message(QMessageBox::Icon icon, const QString text);
+ void finished();
+ void opened(WalletModel* wallet_model);
+
+private:
+ WalletController* const m_wallet_controller;
+ std::string const m_name;
};
#endif // BITCOIN_QT_WALLETCONTROLLER_H