1/*
2 * Copyright (C) 2020-2022 Roy Qu (royqh1979@gmail.com)
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#include "aboutdialog.h"
18#include "ui_aboutdialog.h"
19#include "../systemconsts.h"
20#include "../utils.h"
21#include "../settings.h"
22#include <QDebug>
23
24AboutDialog::AboutDialog(QWidget *parent) :
25 QDialog(parent),
26 ui(new Ui::AboutDialog)
27{
28 setWindowFlag(Qt::WindowContextHelpButtonHint,false);
29 ui->setupUi(this);
30 ui->lblTitle->setText(ui->lblTitle->text() + tr("Version: ") + REDPANDA_CPP_VERSION);
31
32#ifdef __GNUC__
33 ui->lblQt->setText(ui->lblQt->text()
34 .arg(qVersion())
35 .arg(QString("GCC %1.%2")
36 .arg(__GNUC__)
37 .arg(__GNUC_MINOR__)));
38#else
39 ui->lblQt->setText(ui->lblQt->text()
40 .arg(qVersion())
41 .arg(tr("Non-GCC Compiler")));
42#endif
43 ui->lblCompileTime->setText(ui->lblCompileTime->text()
44 .arg(__DATE__, __TIME__));
45
46 QString website="https://sourceforge.net/projects/redpanda-cpp/";
47 if (pSettings->environment().language()=="zh_CN") {
48 website = "https://royqh1979.gitee.io/redpandacpp/";
49 }
50 ui->lblHomepage->setText(tr("Website: <a href=\"%1\">%1</a>").arg(website));
51}
52
53AboutDialog::~AboutDialog()
54{
55 delete ui;
56}
57