aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletcontroller.cpp
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2023-08-13 20:28:37 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2023-08-13 20:38:07 -0300
commit32db15450a9ef2a45de29b3b2ae60491a38edbd6 (patch)
tree7e49fc70a9ef1abbbb9f157505d9fa8a858e11c6 /src/qt/walletcontroller.cpp
parent3654d84c6f53e5137f9208851ff904c248b4741f (diff)
downloadbitcoin-32db15450a9ef2a45de29b3b2ae60491a38edbd6.tar.xz
gui: make '-min' minimize wallet loading dialog
When '-min' is enabled, no loading dialog should be presented on screen during startup.
Diffstat (limited to 'src/qt/walletcontroller.cpp')
-rw-r--r--src/qt/walletcontroller.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qt/walletcontroller.cpp b/src/qt/walletcontroller.cpp
index d782838d6f..8c8abf0e90 100644
--- a/src/qt/walletcontroller.cpp
+++ b/src/qt/walletcontroller.cpp
@@ -191,7 +191,7 @@ WalletControllerActivity::WalletControllerActivity(WalletController* wallet_cont
connect(this, &WalletControllerActivity::finished, this, &QObject::deleteLater);
}
-void WalletControllerActivity::showProgressDialog(const QString& title_text, const QString& label_text)
+void WalletControllerActivity::showProgressDialog(const QString& title_text, const QString& label_text, bool show_minimized)
{
auto progress_dialog = new QProgressDialog(m_parent_widget);
progress_dialog->setAttribute(Qt::WA_DeleteOnClose);
@@ -206,6 +206,8 @@ void WalletControllerActivity::showProgressDialog(const QString& title_text, con
// The setValue call forces QProgressDialog to start the internal duration estimation.
// See details in https://bugreports.qt.io/browse/QTBUG-47042.
progress_dialog->setValue(0);
+ // When requested, launch dialog minimized
+ if (show_minimized) progress_dialog->showMinimized();
}
CreateWalletActivity::CreateWalletActivity(WalletController* wallet_controller, QWidget* parent_widget)
@@ -368,14 +370,15 @@ LoadWalletsActivity::LoadWalletsActivity(WalletController* wallet_controller, QW
{
}
-void LoadWalletsActivity::load()
+void LoadWalletsActivity::load(bool show_loading_minimized)
{
showProgressDialog(
//: Title of progress window which is displayed when wallets are being loaded.
tr("Load Wallets"),
/*: Descriptive text of the load wallets progress window which indicates to
the user that wallets are currently being loaded.*/
- tr("Loading wallets…"));
+ tr("Loading wallets…"),
+ /*show_minimized=*/show_loading_minimized);
QTimer::singleShot(0, worker(), [this] {
for (auto& wallet : node().walletLoader().getWallets()) {