mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 11:13:23 -03:00
Merge bitcoin-core/gui#758: Update Node window title with the chain type
9d37886a3b
gui: Update Node window title with chain type (pablomartin4btc) Pull request description: It fixes #544. Enhance the Node window title by appending the chain type to it, except for the `mainnet`, mirroring the behavior in the main window. ![image](https://github.com/bitcoin-core/gui/assets/110166421/6b81675c-6e53-411f-9ea7-921e74cd2359) There was also some [interest](https://github.com/bitcoin-core/gui/issues/78#issuecomment-695755972) on this while discussing network switching. ACKs for top commit: MarnixCroes: tACK9d37886a3b
hernanmarino: tACK9d37886a3b
BrandonOdiwuor: tested ACK9d37886a3b
alfonsoromanz: Tested ACK9d37886a3b
kristapsk: ACK9d37886a3b
hebasto: ACK9d37886a3b
, tested on Ubuntu 23.10. Tree-SHA512: 8c34c4586bd59b1c522662e8aa0726dccc8f12e020f7a6a1af5200a29e5817e1c51e0f467c7923041fc41535ea093c3e0dd787befbbcc84d6b9f7ff0d969db04
This commit is contained in:
commit
e3c17112dd
2 changed files with 14 additions and 0 deletions
|
@ -581,6 +581,8 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
GUIUtil::handleCloseWindowShortcut(this);
|
GUIUtil::handleCloseWindowShortcut(this);
|
||||||
|
|
||||||
|
updateWindowTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
RPCConsole::~RPCConsole()
|
RPCConsole::~RPCConsole()
|
||||||
|
@ -1387,3 +1389,13 @@ void RPCConsole::updateAlerts(const QString& warnings)
|
||||||
this->ui->label_alerts->setVisible(!warnings.isEmpty());
|
this->ui->label_alerts->setVisible(!warnings.isEmpty());
|
||||||
this->ui->label_alerts->setText(warnings);
|
this->ui->label_alerts->setText(warnings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RPCConsole::updateWindowTitle()
|
||||||
|
{
|
||||||
|
const ChainType chain = Params().GetChainType();
|
||||||
|
if (chain == ChainType::MAIN) return;
|
||||||
|
|
||||||
|
const QString chainType = QString::fromStdString(Params().GetChainTypeString());
|
||||||
|
const QString title = tr("Node window - [%1]").arg(chainType);
|
||||||
|
this->setWindowTitle(title);
|
||||||
|
}
|
|
@ -189,6 +189,8 @@ private:
|
||||||
return time_at_event.count() ? GUIUtil::formatDurationStr(time_now - time_at_event) : tr("Never");
|
return time_at_event.count() ? GUIUtil::formatDurationStr(time_now - time_at_event) : tr("Never");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void updateWindowTitle();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void updateAlerts(const QString& warnings);
|
void updateAlerts(const QString& warnings);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue