mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +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);
|
||||
|
||||
@@ -118,9 +118,6 @@ private:
|
||||
//! \sa CSwiftLauncher::displayLatestNews
|
||||
void loadLatestNews();
|
||||
|
||||
//! Load credits and legal info
|
||||
void loadAbout();
|
||||
|
||||
//! Start the core
|
||||
void startSwiftCore();
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
<item>
|
||||
<widget class="QToolBox" name="tb_Launcher">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="tabSpacing">
|
||||
<number>6</number>
|
||||
@@ -99,7 +99,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>392</width>
|
||||
<height>305</height>
|
||||
<height>319</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
@@ -130,7 +130,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>392</width>
|
||||
<height>305</height>
|
||||
<height>319</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
@@ -195,7 +195,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>392</width>
|
||||
<height>305</height>
|
||||
<height>319</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
@@ -361,7 +361,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>392</width>
|
||||
<height>305</height>
|
||||
<height>319</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
@@ -442,8 +442,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>380</width>
|
||||
<height>151</height>
|
||||
<width>376</width>
|
||||
<height>156</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vl_DataUpdatesScrollArea">
|
||||
@@ -494,32 +494,27 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>392</width>
|
||||
<height>305</height>
|
||||
<height>319</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
<string>&About (credits and license)</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="vl_Credits">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="tbr_About">
|
||||
<property name="documentTitle">
|
||||
<string>About swift</string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><title>About swift</title><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Credits will go here</p></body></html></string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="BlackGui::Components::CAboutHtmlComponent" name="comp_AboutHTML"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -548,7 +543,7 @@ p, li { white-space: pre-wrap; }
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>392</width>
|
||||
<height>113</height>
|
||||
<height>116</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
@@ -777,6 +772,12 @@ p, li { white-space: pre-wrap; }
|
||||
<header>blackgui/components/dbusserveraddressselector.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CAboutHtmlComponent</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/components/abouthtmlcomponent.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>tbr_LatestNews</tabstop>
|
||||
@@ -786,7 +787,6 @@ p, li { white-space: pre-wrap; }
|
||||
<tabstop>rb_SwiftCoreAudioOnGui</tabstop>
|
||||
<tabstop>rb_SwiftCoreAudioOnCore</tabstop>
|
||||
<tabstop>sa_DataUpdates</tabstop>
|
||||
<tabstop>tbr_About</tabstop>
|
||||
<tabstop>tb_SwiftGui</tabstop>
|
||||
<tabstop>tb_SwiftCore</tabstop>
|
||||
<tabstop>tb_SwiftMappingTool</tabstop>
|
||||
|
||||
Reference in New Issue
Block a user