mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T213, using about component in launcher
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <QStringBuilder>
|
||||
#include <QDesktopServices>
|
||||
#include <QShortcut>
|
||||
#include <QPointer>
|
||||
#include <qcompilerdetection.h>
|
||||
|
||||
using namespace BlackConfig;
|
||||
@@ -82,7 +83,12 @@ CSwiftLauncher::CSwiftLauncher(QWidget *parent) :
|
||||
// auto launch wizard
|
||||
if (sGui->isInstallerOptionSet())
|
||||
{
|
||||
QTimer::singleShot(2500, this, &CSwiftLauncher::startWizard);
|
||||
const QPointer<CSwiftLauncher> myself(this);
|
||||
QTimer::singleShot(2500, this, [ = ]
|
||||
{
|
||||
if (!myself) { return; }
|
||||
myself->startWizard();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +155,6 @@ void CSwiftLauncher::updateInfoAvailable()
|
||||
{
|
||||
this->setHeaderInfo(ui->comp_UpdateInfo->getLatestAvailablePilotClientArtifactForSelection());
|
||||
this->loadLatestNews();
|
||||
this->loadAbout();
|
||||
}
|
||||
|
||||
void CSwiftLauncher::mousePressEvent(QMouseEvent *event)
|
||||
@@ -197,20 +202,6 @@ void CSwiftLauncher::loadLatestNews()
|
||||
sGui->getFromNetwork(newsUrl, { this, &CSwiftLauncher::displayLatestNews});
|
||||
}
|
||||
|
||||
void CSwiftLauncher::loadAbout()
|
||||
{
|
||||
// workaround:
|
||||
// 1) Only reading as HTML gives proper formatting
|
||||
// 2) Reading the file resource fails (likely because of the style sheet)
|
||||
static const QString html = CFileUtils::readFileToString(CDirectoryUtils::aboutFilePath());
|
||||
static const QString legalDir = sGui->getGlobalSetup().getLegalDirectoryUrl().getFullUrl();
|
||||
|
||||
// make links absolute
|
||||
static const QString htmlFixed = QString(html).
|
||||
replace(QLatin1String("href=\"./"), "href=\"" + legalDir);
|
||||
ui->tbr_About->setHtml(htmlFixed);
|
||||
}
|
||||
|
||||
void CSwiftLauncher::initLogDisplay()
|
||||
{
|
||||
CLogHandler::instance()->install(true);
|
||||
|
||||
Reference in New Issue
Block a user