Skip to content

Commit ad9629e

Browse files
hebastovijaydasmp
authored andcommitted
Merge bitcoin-core/gui#758: Update Node window title with the chain type
9d37886 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](bitcoin-core/gui#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/gui@9d37886 kristapsk: ACK 9d37886 hebasto: ACK 9d37886, tested on Ubuntu 23.10. Tree-SHA512: 8c34c4586bd59b1c522662e8aa0726dccc8f12e020f7a6a1af5200a29e5817e1c51e0f467c7923041fc41535ea093c3e0dd787befbbcc84d6b9f7ff0d969db04
1 parent ffcf4f6 commit ad9629e

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

src/qt/rpcconsole.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,8 @@ RPCConsole::RPCConsole(interfaces::Node& node, QWidget* parent, Qt::WindowFlags
617617
reloadThemedWidgets();
618618

619619
GUIUtil::handleCloseWindowShortcut(this);
620+
621+
updateWindowTitle();
620622
}
621623

622624
RPCConsole::~RPCConsole()
@@ -1523,3 +1525,13 @@ void RPCConsole::updateAlerts(const QString& warnings)
15231525
this->ui->label_alerts->setVisible(!warnings.isEmpty());
15241526
this->ui->label_alerts->setText(warnings);
15251527
}
1528+
1529+
void RPCConsole::updateWindowTitle()
1530+
{
1531+
const ChainType chain = Params().GetChainType();
1532+
if (chain == ChainType::MAIN) return;
1533+
1534+
const QString chainType = QString::fromStdString(Params().GetChainTypeString());
1535+
const QString title = tr("Node window - [%1]").arg(chainType);
1536+
this->setWindowTitle(title);
1537+
}

src/qt/rpcconsole.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ public Q_SLOTS:
217217
return time_at_event.count() ? GUIUtil::formatDurationStr(time_now - time_at_event) : tr("Never");
218218
}
219219

220+
void updateWindowTitle();
221+
220222
private Q_SLOTS:
221223
void updateAlerts(const QString& warnings);
222224
};

0 commit comments

Comments
 (0)