diff options
author | pablomartin4btc <pablomartin4btc@gmail.com> | 2023-09-17 12:15:36 -0300 |
---|---|---|
committer | pablomartin4btc <pablomartin4btc@gmail.com> | 2023-09-18 00:46:09 -0300 |
commit | 9d37886a3b6ce24f4a4a05193eb0d071655a8457 (patch) | |
tree | ba601e3ec97b4efcec895247f0ed118c1862acf9 /src/qt | |
parent | f01416e23c9c820517c37003a2a98dd46d1022ba (diff) | |
download | bitcoin-9d37886a3b6ce24f4a4a05193eb0d071655a8457.tar.xz |
gui: Update Node window title with chain type
Update Node window with the chain type except for mainnet.
This replicates the behaviour of the main window.
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/rpcconsole.cpp | 12 | ||||
-rw-r--r-- | src/qt/rpcconsole.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index cb4ecfb6fb..c5a8d628e6 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -571,6 +571,8 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty clear(); GUIUtil::handleCloseWindowShortcut(this); + + updateWindowTitle(); } RPCConsole::~RPCConsole() @@ -1368,3 +1370,13 @@ void RPCConsole::updateAlerts(const QString& warnings) this->ui->label_alerts->setVisible(!warnings.isEmpty()); 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); +}
\ No newline at end of file diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 65eef7fbba..358f68c3c8 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -189,6 +189,8 @@ private: return time_at_event.count() ? GUIUtil::formatDurationStr(time_now - time_at_event) : tr("Never"); } + void updateWindowTitle(); + private Q_SLOTS: void updateAlerts(const QString& warnings); }; |