mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
feat: Show license and third party licenses in about dialog
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user