diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 2862dddb56a..bfefcca4e72 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -103,7 +103,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty updateWindowTitle(); rpcConsole = new RPCConsole(node, _platformStyle, nullptr); - helpMessageDialog = new HelpMessageDialog(this, false); + helpMessageDialog = new HelpMessageDialog(this, false, m_network_style); #ifdef ENABLE_WALLET if(enableWallet) { @@ -920,7 +920,7 @@ void BitcoinGUI::aboutClicked() if(!clientModel) return; - auto dlg = new HelpMessageDialog(this, /*about=*/true); + auto dlg = new HelpMessageDialog(this, /*about=*/true, m_network_style); GUIUtil::ShowModalDialogAsynchronously(dlg); } diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index f43b9936284..235bde828bb 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -12,6 +12,8 @@ #include +#include + #include #include #include @@ -29,7 +31,7 @@ #include /** "Help message" or "About" dialog box */ -HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) : +HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about, const NetworkStyle *networkStyle) : QDialog(parent, GUIUtil::dialog_flags), ui(new Ui::HelpMessageDialog) { @@ -39,8 +41,8 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) : if (about) { - setWindowTitle(tr("About %1").arg(PACKAGE_NAME)); - + this->setAboutWindowTitle(networkStyle); + this->setChainTypeIconOnAboutLogo(networkStyle); std::string licenseInfo = LicenseInfo(); /// HTML-format the license message from the core QString licenseInfoHTML = QString::fromStdString(LicenseInfo()); @@ -135,6 +137,19 @@ void HelpMessageDialog::on_okButton_accepted() close(); } +void HelpMessageDialog::setAboutWindowTitle(const NetworkStyle *networkStyle) +{ + QString aboutTitle = tr("About %1").arg(PACKAGE_NAME); + if ((networkStyle) && (Params().GetChainType() != ChainType::MAIN)) aboutTitle.append(" " + networkStyle->getTitleAddText()); + setWindowTitle(aboutTitle); +} + +void HelpMessageDialog::setChainTypeIconOnAboutLogo(const NetworkStyle *networkStyle) +{ + const QSize requiredSize(1024,1024); + if (networkStyle) ui->aboutLogo->setPixmap(networkStyle->getAppIcon().pixmap(requiredSize)); +} + /** "Shutdown" window */ ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f): diff --git a/src/qt/utilitydialog.h b/src/qt/utilitydialog.h index d2a5d5f67f2..ab5b15610db 100644 --- a/src/qt/utilitydialog.h +++ b/src/qt/utilitydialog.h @@ -8,6 +8,8 @@ #include #include +class NetworkStyle; + QT_BEGIN_NAMESPACE class QMainWindow; QT_END_NAMESPACE @@ -22,7 +24,7 @@ class HelpMessageDialog : public QDialog Q_OBJECT public: - explicit HelpMessageDialog(QWidget *parent, bool about); + explicit HelpMessageDialog(QWidget *parent, bool about, const NetworkStyle *networkStyle = nullptr); ~HelpMessageDialog(); void printToConsole(); @@ -34,6 +36,8 @@ class HelpMessageDialog : public QDialog private Q_SLOTS: void on_okButton_accepted(); + void setAboutWindowTitle(const NetworkStyle *networkStyle = nullptr); + void setChainTypeIconOnAboutLogo(const NetworkStyle *networkStyle = nullptr); };