MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / AboutDialog

Method AboutDialog

launcher/ui/dialogs/AboutDialog.cpp:76–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74} // namespace
75
76AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog)
77{
78 ui->setupUi(this);
79
80 QString launcherName = BuildConfig.LAUNCHER_DISPLAYNAME;
81
82 setWindowTitle(tr("About %1").arg(launcherName));
83
84 QString chtml = getCreditsHtml();
85 ui->creditsText->setHtml(StringUtils::htmlListPatch(chtml));
86
87 QString lhtml = getLicenseHtml();
88 ui->licenseText->setHtml(StringUtils::htmlListPatch(lhtml));
89
90 ui->urlLabel->setOpenExternalLinks(true);
91
92 ui->icon->setPixmap(APPLICATION->logo().pixmap(64));
93 ui->title->setText(launcherName);
94
95 ui->versionLabel->setText(BuildConfig.printableVersionString());
96
97 if (!BuildConfig.BUILD_PLATFORM.isEmpty())
98 ui->platformLabel->setText(tr("Platform") + ": " + BuildConfig.BUILD_PLATFORM);
99 else
100 ui->platformLabel->setVisible(false);
101
102 if (!BuildConfig.GIT_COMMIT.isEmpty())
103 ui->commitLabel->setText(tr("Commit: %1").arg(BuildConfig.GIT_COMMIT));
104 else
105 ui->commitLabel->setVisible(false);
106
107 if (!BuildConfig.BUILD_DATE.isEmpty())
108 ui->buildDateLabel->setText(tr("Build date: %1").arg(BuildConfig.BUILD_DATE));
109 else
110 ui->buildDateLabel->setVisible(false);
111
112 if (!BuildConfig.VERSION_CHANNEL.isEmpty())
113 ui->channelLabel->setText(tr("Channel") + ": " + BuildConfig.VERSION_CHANNEL);
114 else
115 ui->channelLabel->setVisible(false);
116
117 QString urlText("<html><head/><body><p><a href=\"%1\">%1</a></p></body></html>");
118 ui->urlLabel->setText(urlText.arg(BuildConfig.LAUNCHER_GIT));
119
120 ui->copyLabel->setText(BuildConfig.LAUNCHER_COPYRIGHT);
121
122 connect(ui->closeButton, &QPushButton::clicked, this, &AboutDialog::close);
123
124 connect(ui->aboutQt, &QPushButton::clicked, &QApplication::aboutQt);
125}
126
127AboutDialog::~AboutDialog()
128{

Callers

nothing calls this directly

Calls 7

getCreditsHtmlFunction · 0.85
getLicenseHtmlFunction · 0.85
logoMethod · 0.80
setVisibleMethod · 0.80
setupUiMethod · 0.45
setTextMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected