aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletcontroller.h
diff options
context:
space:
mode:
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