Merge #15210: gui: Fix window title update

1ed425ea17 gui: Fix window title update (João Barbosa)

Pull request description:

  Removes trailing `-` from window title when running on mainnet.

  Reported by @Sjors in https://github.com/bitcoin/bitcoin/pull/15149#issuecomment-455787938.

Tree-SHA512: 22f13c361496720f30a4926d928851ed74456c0d70bd313b0ebaca91a9ebfde96991091ac3d1b094f33d3ce9afafd709eb1917f00d96fa3ca69751b6b14e1d2b
This commit is contained in:
Wladimir J. van der Laan 2019-01-21 16:48:14 +01:00
commit 7455ca2ae6
No known key found for this signature in database
GPG key ID: 1E4AED62986CD25D

View file

@ -1225,16 +1225,18 @@ void BitcoinGUI::updateProxyIcon()
void BitcoinGUI::updateWindowTitle() void BitcoinGUI::updateWindowTitle()
{ {
QString window_title = tr(PACKAGE_NAME) + " - "; QString window_title = tr(PACKAGE_NAME);
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
if (walletFrame) { if (walletFrame) {
WalletModel* const wallet_model = walletFrame->currentWalletModel(); WalletModel* const wallet_model = walletFrame->currentWalletModel();
if (wallet_model && !wallet_model->getWalletName().isEmpty()) { if (wallet_model && !wallet_model->getWalletName().isEmpty()) {
window_title += wallet_model->getDisplayName() + " - "; window_title += " - " + wallet_model->getDisplayName();
} }
} }
#endif #endif
window_title += m_network_style->getTitleAddText(); if (!m_network_style->getTitleAddText().isEmpty()) {
window_title += " - " + m_network_style->getTitleAddText();
}
setWindowTitle(window_title); setWindowTitle(window_title);
} }