aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-02-12 13:04:56 +0000
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-02-12 13:08:28 +0000
commite3c17112ddfe740e5ab4c652d80ed1a19c13da5a (patch)
treea035ee6219f56b253bf93c7677563a20ac2f385f /src/qt
parent2afbacc4b17871e46ad8e412d4908f7154b11f17 (diff)
parent9d37886a3b6ce24f4a4a05193eb0d071655a8457 (diff)
downloadbitcoin-e3c17112ddfe740e5ab4c652d80ed1a19c13da5a.tar.xz
Merge bitcoin-core/gui#758: Update Node window title with the chain type
9d37886a3b6ce24f4a4a05193eb0d071655a8457 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: tACK 9d37886a3b6ce24f4a4a05193eb0d071655a8457 hernanmarino: tACK 9d37886a3b6ce24f4a4a05193eb0d071655a8457 BrandonOdiwuor: tested ACK 9d37886a3b6ce24f4a4a05193eb0d071655a8457 alfonsoromanz: Tested ACK https://github.com/bitcoin-core/gui/pull/758/commits/9d37886a3b6ce24f4a4a05193eb0d071655a8457 kristapsk: ACK 9d37886a3b6ce24f4a4a05193eb0d071655a8457 hebasto: ACK 9d37886a3b6ce24f4a4a05193eb0d071655a8457, tested on Ubuntu 23.10. Tree-SHA512: 8c34c4586bd59b1c522662e8aa0726dccc8f12e020f7a6a1af5200a29e5817e1c51e0f467c7923041fc41535ea093c3e0dd787befbbcc84d6b9f7ff0d969db04
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/rpcconsole.cpp12
-rw-r--r--src/qt/rpcconsole.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index ceaa3ac46b..4ef45490d9 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -581,6 +581,8 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
clear();
GUIUtil::handleCloseWindowShortcut(this);
+
+ updateWindowTitle();
}
RPCConsole::~RPCConsole()
@@ -1387,3 +1389,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);
};