From 8847cdaaaeb45c1ddee89f43ac4b8fafb20e5c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Barbosa?= Date: Mon, 21 Jan 2019 16:58:20 +0000 Subject: gui: Add OpenWalletActivity --- src/qt/walletcontroller.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/qt/walletcontroller.h') 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 #include +#include #include #include @@ -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 getWallets() const; std::vector 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 m_wallets; std::unique_ptr 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 -- cgit v1.2.3