aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletcontroller.h
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-09-30 17:27:33 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-09-30 17:35:14 +0300
commit9013f23b0a6e0e450c4603f9d0f050ff10d552f6 (patch)
tree727a304c02a0469f7178c97b856e5446d14577b2 /src/qt/walletcontroller.h
parent2d8e0c0c3c0d3c4cee7bb52d1edf501f40c53463 (diff)
parent2fe69efbc607fdcc3657637d59a38cc5b4db2d05 (diff)
downloadbitcoin-9013f23b0a6e0e450c4603f9d0f050ff10d552f6.tar.xz
Merge bitcoin-core/gui#342: wallet: Move wallets loading out from the main GUI thread
2fe69efbc607fdcc3657637d59a38cc5b4db2d05 qt, wallet: Drop no longer used WalletController::getOpenWallets() (Hennadii Stepanov) f6991cb906e9dad7ff76a51e2b654f798d5c2ba6 qt, wallet: Add LoadWalletsActivity class (Hennadii Stepanov) 4a024fc310f136ce62c733fb1174b3a80ea25d0a qt, wallet, refactor: Move connection to QObject::deleteLater to ctor (Hennadii Stepanov) f9b633eeab6e9ee405bba37573aed9aa83c51ea5 qt, wallet: Move activity progress dialog from data member to local (Hennadii Stepanov) Pull request description: This PR improves the GUI responsiveness during initial wallets loading at startup (especially ones that have tons of txs), and shows a standard progress dialog for long loading: ![DeepinScreenshot_select-area_20210522230626](https://user-images.githubusercontent.com/32963518/119239625-0b3a9380-bb53-11eb-9a54-34980d8a1194.png) Fixes #247. ACKs for top commit: ryanofsky: Code review ACK 2fe69efbc607fdcc3657637d59a38cc5b4db2d05. Just suggested changes since last review: squashing commits and dropping unused method (thanks!) shaavan: reACK 2fe69efbc607fdcc3657637d59a38cc5b4db2d05 promag: Code review ACK 2fe69efbc607fdcc3657637d59a38cc5b4db2d05. Tree-SHA512: 2ac3cb48886e0005fc36b3fd0c2b35abd557186be16db3145d753c34d94188e4f4ff14dc07fb0fb7558944f84498204a3988f8284fd56c6d85b47bc9081e71a6
Diffstat (limited to 'src/qt/walletcontroller.h')
-rw-r--r--src/qt/walletcontroller.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/qt/walletcontroller.h b/src/qt/walletcontroller.h
index f7e366878d..f97a7a1e84 100644
--- a/src/qt/walletcontroller.h
+++ b/src/qt/walletcontroller.h
@@ -52,9 +52,6 @@ public:
WalletController(ClientModel& client_model, const PlatformStyle* platform_style, QObject* parent);
~WalletController();
- //! Returns wallet models currently open.
- std::vector<WalletModel*> getOpenWallets() const;
-
WalletModel* getOrCreateWallet(std::unique_ptr<interfaces::Wallet> wallet);
//! Returns all wallet names in the wallet dir mapped to whether the wallet
@@ -90,7 +87,7 @@ class WalletControllerActivity : public QObject
public:
WalletControllerActivity(WalletController* wallet_controller, QWidget* parent_widget);
- virtual ~WalletControllerActivity();
+ virtual ~WalletControllerActivity() = default;
Q_SIGNALS:
void finished();
@@ -100,11 +97,9 @@ protected:
QObject* worker() const { return m_wallet_controller->m_activity_worker; }
void showProgressDialog(const QString& label_text);
- void destroyProgressDialog();
WalletController* const m_wallet_controller;
QWidget* const m_parent_widget;
- QProgressDialog* m_progress_dialog{nullptr};
WalletModel* m_wallet_model{nullptr};
bilingual_str m_error_message;
std::vector<bilingual_str> m_warning_message;
@@ -150,4 +145,14 @@ private:
void finish();
};
+class LoadWalletsActivity : public WalletControllerActivity
+{
+ Q_OBJECT
+
+public:
+ LoadWalletsActivity(WalletController* wallet_controller, QWidget* parent_widget);
+
+ void load();
+};
+
#endif // BITCOIN_QT_WALLETCONTROLLER_H