| 132 | } // namespace |
| 133 | |
| 134 | AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) |
| 135 | { |
| 136 | ui->setupUi(this); |
| 137 | |
| 138 | QString launcherName = BuildConfig.LAUNCHER_DISPLAYNAME; |
| 139 | |
| 140 | setWindowTitle(tr("About %1").arg(launcherName)); |
| 141 | |
| 142 | QString chtml = getCreditsHtml(); |
| 143 | ui->creditsText->setHtml(StringUtils::htmlListPatch(chtml)); |
| 144 | |
| 145 | QString lhtml = getLicenseHtml(); |
| 146 | ui->licenseText->setHtml(StringUtils::htmlListPatch(lhtml)); |
| 147 | |
| 148 | ui->urlLabel->setOpenExternalLinks(true); |
| 149 | |
| 150 | ui->icon->setPixmap(APPLICATION->getThemedIcon("logo").pixmap(64)); |
| 151 | ui->title->setText(launcherName); |
| 152 | |
| 153 | ui->versionLabel->setText(BuildConfig.printableVersionString()); |
| 154 | |
| 155 | if (!BuildConfig.BUILD_PLATFORM.isEmpty()) |
| 156 | ui->platformLabel->setText(tr("Platform") + ": " + BuildConfig.BUILD_PLATFORM); |
| 157 | else |
| 158 | ui->platformLabel->setVisible(false); |
| 159 | |
| 160 | if (!BuildConfig.GIT_COMMIT.isEmpty()) |
| 161 | ui->commitLabel->setText(tr("Commit: %1").arg(BuildConfig.GIT_COMMIT)); |
| 162 | else |
| 163 | ui->commitLabel->setVisible(false); |
| 164 | |
| 165 | if (!BuildConfig.BUILD_DATE.isEmpty()) |
| 166 | ui->buildDateLabel->setText(tr("Build date: %1").arg(BuildConfig.BUILD_DATE)); |
| 167 | else |
| 168 | ui->buildDateLabel->setVisible(false); |
| 169 | |
| 170 | if (!BuildConfig.VERSION_CHANNEL.isEmpty()) |
| 171 | ui->channelLabel->setText(tr("Channel") + ": " + BuildConfig.VERSION_CHANNEL); |
| 172 | else |
| 173 | ui->channelLabel->setVisible(false); |
| 174 | |
| 175 | QString urlText("<html><head/><body><p><a href=\"%1\">%1</a></p></body></html>"); |
| 176 | ui->urlLabel->setText(urlText.arg(BuildConfig.LAUNCHER_GIT)); |
| 177 | |
| 178 | ui->copyLabel->setText(BuildConfig.LAUNCHER_COPYRIGHT); |
| 179 | |
| 180 | connect(ui->closeButton, SIGNAL(clicked()), SLOT(close())); |
| 181 | |
| 182 | connect(ui->aboutQt, &QPushButton::clicked, &QApplication::aboutQt); |
| 183 | } |
| 184 | |
| 185 | AboutDialog::~AboutDialog() |
| 186 | { |
nothing calls this directly
no test coverage detected