2020-01-18 11:38:54 +01:00
|
|
|
// Copyright (C) 2019-2020 Jakub Melka
|
2019-11-10 14:17:54 +01:00
|
|
|
//
|
2020-12-20 19:03:58 +01:00
|
|
|
// This file is part of Pdf4Qt.
|
2019-11-10 14:17:54 +01:00
|
|
|
//
|
2020-12-20 19:03:58 +01:00
|
|
|
// Pdf4Qt is free software: you can redistribute it and/or modify
|
2019-11-10 14:17:54 +01:00
|
|
|
// it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
2020-12-20 19:03:58 +01:00
|
|
|
// Pdf4Qt is distributed in the hope that it will be useful,
|
2019-11-10 14:17:54 +01:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
2020-12-20 19:03:58 +01:00
|
|
|
// along with Pdf4Qt. If not, see <https://www.gnu.org/licenses/>.
|
2019-11-10 14:17:54 +01:00
|
|
|
|
|
|
|
#include "pdfaboutdialog.h"
|
|
|
|
#include "ui_pdfaboutdialog.h"
|
|
|
|
|
|
|
|
#include "pdfutils.h"
|
2019-12-22 16:33:50 +01:00
|
|
|
#include "pdfwidgetutils.h"
|
2019-11-10 14:17:54 +01:00
|
|
|
|
2019-12-22 16:33:50 +01:00
|
|
|
namespace pdfviewer
|
|
|
|
{
|
|
|
|
|
|
|
|
PDFAboutDialog::PDFAboutDialog(QWidget* parent) :
|
2019-11-10 14:17:54 +01:00
|
|
|
QDialog(parent),
|
|
|
|
ui(new Ui::PDFAboutDialog)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
2020-12-20 16:36:07 +01:00
|
|
|
QString html = ui->copyrightLabel->text();
|
|
|
|
html.replace("PdfForQtViewer", QApplication::applicationDisplayName());
|
|
|
|
ui->copyrightLabel->setText(html);
|
|
|
|
|
2019-11-10 14:17:54 +01:00
|
|
|
std::vector<pdf::PDFDependentLibraryInfo> infos = pdf::PDFDependentLibraryInfo::getLibraryInfo();
|
|
|
|
|
|
|
|
ui->tableWidget->setColumnCount(4);
|
|
|
|
ui->tableWidget->setRowCount(static_cast<int>(infos.size()));
|
|
|
|
ui->tableWidget->setHorizontalHeaderLabels(QStringList() << tr("Library") << tr("Version") << tr("License") << tr("URL"));
|
|
|
|
ui->tableWidget->setEditTriggers(QTableWidget::NoEditTriggers);
|
|
|
|
ui->tableWidget->setSelectionMode(QTableView::SingleSelection);
|
|
|
|
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
|
|
|
|
|
|
|
for (int i = 0; i < infos.size(); ++i)
|
|
|
|
{
|
|
|
|
const pdf::PDFDependentLibraryInfo& info = infos[i];
|
|
|
|
ui->tableWidget->setItem(i, 0, new QTableWidgetItem(info.library));
|
|
|
|
ui->tableWidget->setItem(i, 1, new QTableWidgetItem(info.version));
|
|
|
|
ui->tableWidget->setItem(i, 2, new QTableWidgetItem(info.license));
|
|
|
|
ui->tableWidget->setItem(i, 3, new QTableWidgetItem(info.url));
|
|
|
|
}
|
2019-12-22 16:33:50 +01:00
|
|
|
|
2020-02-23 18:59:54 +01:00
|
|
|
pdf::PDFWidgetUtils::scaleWidget(this, QSize(750, 600));
|
2019-11-10 14:17:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
PDFAboutDialog::~PDFAboutDialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
2019-12-22 16:33:50 +01:00
|
|
|
|
|
|
|
} // namespace viewer
|