Skip to content

Commit e3c1711

Browse files
committed
Merge bitcoin-core#758: Update Node window title with the chain type
9d37886 gui: Update Node window title with chain type (pablomartin4btc) Pull request description: It fixes bitcoin-core#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](bitcoin-core#78 (comment)) on this while discussing network switching. ACKs for top commit: MarnixCroes: tACK 9d37886 hernanmarino: tACK 9d37886 BrandonOdiwuor: tested ACK 9d37886 alfonsoromanz: Tested ACK bitcoin-core@9d37886 kristapsk: ACK 9d37886 hebasto: ACK 9d37886, tested on Ubuntu 23.10. Tree-SHA512: 8c34c4586bd59b1c522662e8aa0726dccc8f12e020f7a6a1af5200a29e5817e1c51e0f467c7923041fc41535ea093c3e0dd787befbbcc84d6b9f7ff0d969db04
2 parents 2afbacc + 9d37886 commit e3c1711

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/qt/rpcconsole.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,8 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
581581
clear();
582582

583583
GUIUtil::handleCloseWindowShortcut(this);
584+
585+
updateWindowTitle();
584586
}
585587

586588
RPCConsole::~RPCConsole()
@@ -1387,3 +1389,13 @@ void RPCConsole::updateAlerts(const QString& warnings)
13871389
this->ui->label_alerts->setVisible(!warnings.isEmpty());
13881390
this->ui->label_alerts->setText(warnings);
13891391
}
1392+
1393+
void RPCConsole::updateWindowTitle()
1394+
{
1395+
const ChainType chain = Params().GetChainType();
1396+
if (chain == ChainType::MAIN) return;
1397+
1398+
const QString chainType = QString::fromStdString(Params().GetChainTypeString());
1399+
const QString title = tr("Node window - [%1]").arg(chainType);
1400+
this->setWindowTitle(title);
1401+
}

src/qt/rpcconsole.h

+2
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ public Q_SLOTS:
189189
return time_at_event.count() ? GUIUtil::formatDurationStr(time_now - time_at_event) : tr("Never");
190190
}
191191

192+
void updateWindowTitle();
193+
192194
private Q_SLOTS:
193195
void updateAlerts(const QString& warnings);
194196
};

0 commit comments

Comments
 (0)