gui: make '-min' minimize wallet loading dialog

When '-min' is enabled, no loading dialog should
be presented on screen during startup.
This commit is contained in:
furszy
2023-08-13 20:28:37 -03:00
parent 3654d84c6f
commit 32db15450a
5 changed files with 17 additions and 11 deletions

View File

@@ -407,18 +407,21 @@ void BitcoinApplication::initializeResult(bool success, interfaces::BlockAndHead
qInfo() << "Platform customization:" << platformStyle->getName();
clientModel = new ClientModel(node(), optionsModel);
window->setClientModel(clientModel, &tip_info);
// If '-min' option passed, start window minimized (iconified) or minimized to tray
bool start_minimized = gArgs.GetBoolArg("-min", false);
#ifdef ENABLE_WALLET
if (WalletModel::isWalletEnabled()) {
m_wallet_controller = new WalletController(*clientModel, platformStyle, this);
window->setWalletController(m_wallet_controller);
window->setWalletController(m_wallet_controller, /*show_loading_minimized=*/start_minimized);
if (paymentServer) {
paymentServer->setOptionsModel(optionsModel);
}
}
#endif // ENABLE_WALLET
// If -min option passed, start window minimized (iconified) or minimized to tray
if (!gArgs.GetBoolArg("-min", false)) {
// Show or minimize window
if (!start_minimized) {
window->show();
} else if (clientModel->getOptionsModel()->getMinimizeToTray() && window->hasTrayIcon()) {
// do nothing as the window is managed by the tray icon