Merge g758 via qt_nodewindow_chainname-22

This commit is contained in:
Luke Dashjr 2023-11-15 23:49:11 +00:00
commit b42b1dab09
2 changed files with 14 additions and 0 deletions

View File

@ -571,6 +571,8 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
clear();
GUIUtil::handleCloseWindowShortcut(this);
updateWindowTitle();
}
RPCConsole::~RPCConsole()
@ -1378,3 +1380,13 @@ void RPCConsole::updateAlerts(const QString& warnings)
this->ui->label_alerts->setVisible(!warnings.isEmpty());
this->ui->label_alerts->setText(warnings);
}
void RPCConsole::updateWindowTitle()
{
const std::string chain = Params().NetworkIDString();
if (chain == CBaseChainParams::MAIN) return;
const QString chainType = QString::fromStdString(Params().NetworkIDString());
const QString title = tr("Node window - [%1]").arg(chainType);
this->setWindowTitle(title);
}

View File

@ -191,6 +191,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);
};