Skip to content

Commit

Permalink
gui: Update Node window title with chain type
Browse files Browse the repository at this point in the history
Update Node window with the chain type except for mainnet.
This replicates the behaviour of the main window.
  • Loading branch information
pablomartin4btc committed Sep 18, 2023
1 parent f01416e commit 9d37886
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,8 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
clear();

GUIUtil::handleCloseWindowShortcut(this);

updateWindowTitle();
}

RPCConsole::~RPCConsole()
Expand Down Expand Up @@ -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);
}
2 changes: 2 additions & 0 deletions src/qt/rpcconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ public Q_SLOTS:
return time_at_event.count() ? GUIUtil::formatDurationStr(time_now - time_at_event) : tr("Never");
}

void updateWindowTitle();

private Q_SLOTS:
void updateAlerts(const QString& warnings);
};
Expand Down

0 comments on commit 9d37886

Please sign in to comment.