mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
Ref T213, using about component in launcher
This commit is contained in:
@@ -30,6 +30,7 @@
|
|||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
|
#include <QPointer>
|
||||||
#include <qcompilerdetection.h>
|
#include <qcompilerdetection.h>
|
||||||
|
|
||||||
using namespace BlackConfig;
|
using namespace BlackConfig;
|
||||||
@@ -82,7 +83,12 @@ CSwiftLauncher::CSwiftLauncher(QWidget *parent) :
|
|||||||
// auto launch wizard
|
// auto launch wizard
|
||||||
if (sGui->isInstallerOptionSet())
|
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->setHeaderInfo(ui->comp_UpdateInfo->getLatestAvailablePilotClientArtifactForSelection());
|
||||||
this->loadLatestNews();
|
this->loadLatestNews();
|
||||||
this->loadAbout();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSwiftLauncher::mousePressEvent(QMouseEvent *event)
|
void CSwiftLauncher::mousePressEvent(QMouseEvent *event)
|
||||||
@@ -197,20 +202,6 @@ void CSwiftLauncher::loadLatestNews()
|
|||||||
sGui->getFromNetwork(newsUrl, { this, &CSwiftLauncher::displayLatestNews});
|
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()
|
void CSwiftLauncher::initLogDisplay()
|
||||||
{
|
{
|
||||||
CLogHandler::instance()->install(true);
|
CLogHandler::instance()->install(true);
|
||||||
|
|||||||
@@ -118,9 +118,6 @@ private:
|
|||||||
//! \sa CSwiftLauncher::displayLatestNews
|
//! \sa CSwiftLauncher::displayLatestNews
|
||||||
void loadLatestNews();
|
void loadLatestNews();
|
||||||
|
|
||||||
//! Load credits and legal info
|
|
||||||
void loadAbout();
|
|
||||||
|
|
||||||
//! Start the core
|
//! Start the core
|
||||||
void startSwiftCore();
|
void startSwiftCore();
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QToolBox" name="tb_Launcher">
|
<widget class="QToolBox" name="tb_Launcher">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="tabSpacing">
|
<property name="tabSpacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>392</width>
|
<width>392</width>
|
||||||
<height>305</height>
|
<height>319</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="label">
|
<attribute name="label">
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>392</width>
|
<width>392</width>
|
||||||
<height>305</height>
|
<height>319</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="label">
|
<attribute name="label">
|
||||||
@@ -195,7 +195,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>392</width>
|
<width>392</width>
|
||||||
<height>305</height>
|
<height>319</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="label">
|
<attribute name="label">
|
||||||
@@ -361,7 +361,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>392</width>
|
<width>392</width>
|
||||||
<height>305</height>
|
<height>319</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="label">
|
<attribute name="label">
|
||||||
@@ -442,8 +442,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>380</width>
|
<width>376</width>
|
||||||
<height>151</height>
|
<height>156</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="vl_DataUpdatesScrollArea">
|
<layout class="QVBoxLayout" name="vl_DataUpdatesScrollArea">
|
||||||
@@ -494,32 +494,27 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>392</width>
|
<width>392</width>
|
||||||
<height>305</height>
|
<height>319</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="label">
|
<attribute name="label">
|
||||||
<string>&About (credits and license)</string>
|
<string>&About (credits and license)</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="vl_Credits">
|
<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>
|
<item>
|
||||||
<widget class="QTextBrowser" name="tbr_About">
|
<widget class="BlackGui::Components::CAboutHtmlComponent" name="comp_AboutHTML"/>
|
||||||
<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>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -548,7 +543,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>392</width>
|
<width>392</width>
|
||||||
<height>113</height>
|
<height>116</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="label">
|
<attribute name="label">
|
||||||
@@ -777,6 +772,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<header>blackgui/components/dbusserveraddressselector.h</header>
|
<header>blackgui/components/dbusserveraddressselector.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::Components::CAboutHtmlComponent</class>
|
||||||
|
<extends>QFrame</extends>
|
||||||
|
<header>blackgui/components/abouthtmlcomponent.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>tbr_LatestNews</tabstop>
|
<tabstop>tbr_LatestNews</tabstop>
|
||||||
@@ -786,7 +787,6 @@ p, li { white-space: pre-wrap; }
|
|||||||
<tabstop>rb_SwiftCoreAudioOnGui</tabstop>
|
<tabstop>rb_SwiftCoreAudioOnGui</tabstop>
|
||||||
<tabstop>rb_SwiftCoreAudioOnCore</tabstop>
|
<tabstop>rb_SwiftCoreAudioOnCore</tabstop>
|
||||||
<tabstop>sa_DataUpdates</tabstop>
|
<tabstop>sa_DataUpdates</tabstop>
|
||||||
<tabstop>tbr_About</tabstop>
|
|
||||||
<tabstop>tb_SwiftGui</tabstop>
|
<tabstop>tb_SwiftGui</tabstop>
|
||||||
<tabstop>tb_SwiftCore</tabstop>
|
<tabstop>tb_SwiftCore</tabstop>
|
||||||
<tabstop>tb_SwiftMappingTool</tabstop>
|
<tabstop>tb_SwiftMappingTool</tabstop>
|
||||||
|
|||||||
Reference in New Issue
Block a user