feat: Show license and third party licenses in about dialog

This commit is contained in:
Lars Toenning
2024-06-10 22:00:23 +02:00
parent 49d4bd12d1
commit 4a81fc400a
3 changed files with 53 additions and 2 deletions

View File

@@ -6,14 +6,26 @@
#include "blackgui/guiapplication.h"
#include "blackgui/guiutility.h"
#include "blackmisc/fileutils.h"
namespace BlackGui::Components
{
CAboutDialog::CAboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::CAboutDialog)
{
ui->setupUi(this);
const QPointer<CAboutDialog> myself(this);
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
this->init();
QTimer::singleShot(0, this, [=] {
if (!myself) { return; }
myself->loadSwiftLicense();
});
QTimer::singleShot(0, this, [=] {
if (!myself) { return; }
myself->loadThirdPartyLicenses();
});
}
CAboutDialog::~CAboutDialog()
@@ -29,4 +41,16 @@ namespace BlackGui::Components
ui->pte_Info->appendPlainText("\nScreen info follows:\n----");
ui->pte_Info->appendPlainText(CGuiUtility::screenInformation("\n"));
}
void CAboutDialog::loadSwiftLicense()
{
const QString html = BlackMisc::CFileUtils::readFileToString(BlackMisc::CSwiftDirectories::legalDirectory() + "/LicenseRef-swift-pilot-client-1.html");
ui->tbr_swiftLicense->setHtml(html);
}
void CAboutDialog::loadThirdPartyLicenses()
{
const QString html = BlackMisc::CFileUtils::readFileToString(BlackMisc::CSwiftDirectories::legalDirectory() + "/3rdparty.html");
ui->tbr_ThirdPartyLicenses->setHtml(html);
}
} // ns