From fcd08e79185725cc7bd196ff01f5938dc73f99fa Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Wed, 23 May 2018 23:10:45 +0200 Subject: [PATCH] Ref T213, using about component in launcher --- src/swiftlauncher/swiftlauncher.cpp | 23 ++++-------- src/swiftlauncher/swiftlauncher.h | 3 -- src/swiftlauncher/swiftlauncher.ui | 56 ++++++++++++++--------------- 3 files changed, 35 insertions(+), 47 deletions(-) diff --git a/src/swiftlauncher/swiftlauncher.cpp b/src/swiftlauncher/swiftlauncher.cpp index 62c8bcb4d..adf116f8e 100644 --- a/src/swiftlauncher/swiftlauncher.cpp +++ b/src/swiftlauncher/swiftlauncher.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include 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 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); diff --git a/src/swiftlauncher/swiftlauncher.h b/src/swiftlauncher/swiftlauncher.h index d072dd308..e2b9741df 100644 --- a/src/swiftlauncher/swiftlauncher.h +++ b/src/swiftlauncher/swiftlauncher.h @@ -118,9 +118,6 @@ private: //! \sa CSwiftLauncher::displayLatestNews void loadLatestNews(); - //! Load credits and legal info - void loadAbout(); - //! Start the core void startSwiftCore(); diff --git a/src/swiftlauncher/swiftlauncher.ui b/src/swiftlauncher/swiftlauncher.ui index 6a88b2deb..6a55c08c7 100644 --- a/src/swiftlauncher/swiftlauncher.ui +++ b/src/swiftlauncher/swiftlauncher.ui @@ -88,7 +88,7 @@ - 2 + 4 6 @@ -99,7 +99,7 @@ 0 0 392 - 305 + 319 @@ -130,7 +130,7 @@ 0 0 392 - 305 + 319 @@ -195,7 +195,7 @@ 0 0 392 - 305 + 319 @@ -361,7 +361,7 @@ 0 0 392 - 305 + 319 @@ -442,8 +442,8 @@ 0 0 - 380 - 151 + 376 + 156 @@ -494,32 +494,27 @@ 0 0 392 - 305 + 319 &About (credits and license) + + 3 + + + 3 + + + 3 + + + 3 + - - - About swift - - - true - - - <!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> - - - true - - + @@ -548,7 +543,7 @@ p, li { white-space: pre-wrap; } 0 0 392 - 113 + 116 @@ -777,6 +772,12 @@ p, li { white-space: pre-wrap; }
blackgui/components/dbusserveraddressselector.h
1 + + BlackGui::Components::CAboutHtmlComponent + QFrame +
blackgui/components/abouthtmlcomponent.h
+ 1 +
tbr_LatestNews @@ -786,7 +787,6 @@ p, li { white-space: pre-wrap; } rb_SwiftCoreAudioOnGui rb_SwiftCoreAudioOnCore sa_DataUpdates - tbr_About tb_SwiftGui tb_SwiftCore tb_SwiftMappingTool