| 74 | } // namespace |
| 75 | |
| 76 | AboutDialog::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 | |
| 127 | AboutDialog::~AboutDialog() |
| 128 | { |
nothing calls this directly
no test coverage detected