mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +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
|
||||
|
||||
@@ -33,6 +33,9 @@ namespace BlackGui::Components
|
||||
//! Init values
|
||||
void init();
|
||||
|
||||
void loadSwiftLicense();
|
||||
void loadThirdPartyLicenses();
|
||||
|
||||
QScopedPointer<Ui::CAboutDialog> ui;
|
||||
};
|
||||
} // ns
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>320</width>
|
||||
<height>258</height>
|
||||
<width>666</width>
|
||||
<height>748</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
@@ -61,6 +61,30 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_swiftLicense">
|
||||
<property name="title">
|
||||
<string>swift license</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="tbr_swiftLicense"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_ThirdPartyLicenses">
|
||||
<property name="title">
|
||||
<string>Third-Party licenses</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="tbr_ThirdPartyLicenses"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="bb_AboutDialog">
|
||||
<property name="orientation">
|
||||
|
||||
Reference in New Issue
Block a user