mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
Remove broken launcher news widget
The links for news are broken. As most announcements are published via Discord nowadays, remove it for now.
This commit is contained in:
@@ -59,11 +59,6 @@ namespace BlackCore::Data
|
|||||||
"https://swift.fir-berlin.de/shared"
|
"https://swift.fir-berlin.de/shared"
|
||||||
};
|
};
|
||||||
|
|
||||||
m_newsUrls = CUrlList
|
|
||||||
{
|
|
||||||
"https://blog.swift-project.net/?__print__=1",
|
|
||||||
"https://dev.swift-project.org/phame/blog/view/1/?__print__=1"
|
|
||||||
};
|
|
||||||
m_onlineHelpUrls = CUrlList
|
m_onlineHelpUrls = CUrlList
|
||||||
{
|
{
|
||||||
"https://datastore.swift-project.org/page/swifthelpdispatcher.html",
|
"https://datastore.swift-project.org/page/swifthelpdispatcher.html",
|
||||||
@@ -262,11 +257,6 @@ namespace BlackCore::Data
|
|||||||
return setup;
|
return setup;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CUrlList &CGlobalSetup::getSwiftLatestNewsUrls() const
|
|
||||||
{
|
|
||||||
return m_newsUrls;
|
|
||||||
}
|
|
||||||
|
|
||||||
CServerList CGlobalSetup::getPredefinedServersPlusHardcodedServers() const
|
CServerList CGlobalSetup::getPredefinedServersPlusHardcodedServers() const
|
||||||
{
|
{
|
||||||
static const CServerList hardcoded(
|
static const CServerList hardcoded(
|
||||||
@@ -320,9 +310,6 @@ namespace BlackCore::Data
|
|||||||
% u"Bootstrap URLs: "
|
% u"Bootstrap URLs: "
|
||||||
% getSwiftBootstrapFileUrls().toQString(i18n)
|
% getSwiftBootstrapFileUrls().toQString(i18n)
|
||||||
% separator
|
% separator
|
||||||
% u"News URLs: "
|
|
||||||
% getSwiftLatestNewsUrls().toQString(i18n)
|
|
||||||
% separator
|
|
||||||
% u"Help URLs: "
|
% u"Help URLs: "
|
||||||
% m_onlineHelpUrls.toQString(i18n)
|
% m_onlineHelpUrls.toQString(i18n)
|
||||||
% separator;
|
% separator;
|
||||||
@@ -388,7 +375,6 @@ namespace BlackCore::Data
|
|||||||
case IndexBootstrapFileUrls: return QVariant::fromValue(this->getSwiftBootstrapFileUrls());
|
case IndexBootstrapFileUrls: return QVariant::fromValue(this->getSwiftBootstrapFileUrls());
|
||||||
case IndexUpdateInfoFileUrls: return QVariant::fromValue(this->getSwiftUpdateInfoFileUrls());
|
case IndexUpdateInfoFileUrls: return QVariant::fromValue(this->getSwiftUpdateInfoFileUrls());
|
||||||
case IndexSharedUrls: return QVariant::fromValue(m_sharedUrls);
|
case IndexSharedUrls: return QVariant::fromValue(m_sharedUrls);
|
||||||
case IndexNewsUrls: return QVariant::fromValue(m_newsUrls);
|
|
||||||
case IndexOnlineHelpUrls: return QVariant::fromValue(m_onlineHelpUrls);
|
case IndexOnlineHelpUrls: return QVariant::fromValue(m_onlineHelpUrls);
|
||||||
case IndexCrashReportServerUrl: return QVariant::fromValue(m_crashReportServerUrl);
|
case IndexCrashReportServerUrl: return QVariant::fromValue(m_crashReportServerUrl);
|
||||||
case IndexWasLoadedFromWeb: return QVariant::fromValue(m_wasLoadedFromWeb);
|
case IndexWasLoadedFromWeb: return QVariant::fromValue(m_wasLoadedFromWeb);
|
||||||
@@ -420,7 +406,6 @@ namespace BlackCore::Data
|
|||||||
case IndexVatsimBookings: m_vatsimBookingsUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
|
case IndexVatsimBookings: m_vatsimBookingsUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
|
||||||
case IndexVatsimMetars: m_vatsimMetarsUrls = variant.value<CUrlList>(); break;
|
case IndexVatsimMetars: m_vatsimMetarsUrls = variant.value<CUrlList>(); break;
|
||||||
case IndexSharedUrls: m_sharedUrls = variant.value<CUrlList>(); break;
|
case IndexSharedUrls: m_sharedUrls = variant.value<CUrlList>(); break;
|
||||||
case IndexNewsUrls: m_newsUrls = variant.value<CUrlList>(); break;
|
|
||||||
case IndexOnlineHelpUrls: m_onlineHelpUrls = variant.value<CUrlList>(); break;
|
case IndexOnlineHelpUrls: m_onlineHelpUrls = variant.value<CUrlList>(); break;
|
||||||
case IndexCrashReportServerUrl: m_crashReportServerUrl = variant.value<CUrl>(); break;
|
case IndexCrashReportServerUrl: m_crashReportServerUrl = variant.value<CUrl>(); break;
|
||||||
case IndexWasLoadedFromWeb: m_wasLoadedFromWeb = variant.toBool(); break;
|
case IndexWasLoadedFromWeb: m_wasLoadedFromWeb = variant.toBool(); break;
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ namespace BlackCore::Data
|
|||||||
IndexSwiftDbFiles,
|
IndexSwiftDbFiles,
|
||||||
IndexBootstrapFileUrls,
|
IndexBootstrapFileUrls,
|
||||||
IndexUpdateInfoFileUrls,
|
IndexUpdateInfoFileUrls,
|
||||||
IndexNewsUrls,
|
|
||||||
IndexOnlineHelpUrls,
|
IndexOnlineHelpUrls,
|
||||||
IndexCrashReportServerUrl,
|
IndexCrashReportServerUrl,
|
||||||
IndexWasLoadedFromWeb,
|
IndexWasLoadedFromWeb,
|
||||||
@@ -182,9 +181,6 @@ namespace BlackCore::Data
|
|||||||
//! VATSIM data file URLs
|
//! VATSIM data file URLs
|
||||||
const BlackMisc::Network::CUrlList &getVatsimDataFileUrls() const { return m_vatsimDataFileUrls; }
|
const BlackMisc::Network::CUrlList &getVatsimDataFileUrls() const { return m_vatsimDataFileUrls; }
|
||||||
|
|
||||||
//! Locations of swift DB news
|
|
||||||
const BlackMisc::Network::CUrlList &getSwiftLatestNewsUrls() const;
|
|
||||||
|
|
||||||
//! Help page URL
|
//! Help page URL
|
||||||
//! \remark working URL evaluated at runtime, based on getOnlineHelpUrls
|
//! \remark working URL evaluated at runtime, based on getOnlineHelpUrls
|
||||||
BlackMisc::Network::CUrl getHelpPageUrl(const QString &context = {}) const;
|
BlackMisc::Network::CUrl getHelpPageUrl(const QString &context = {}) const;
|
||||||
@@ -254,7 +250,6 @@ namespace BlackCore::Data
|
|||||||
BlackMisc::Network::CUrlList m_vatsimStatusFileUrls; //!< Status file, where to find the VATSIM files (METAR, data, ATIS, other status files)
|
BlackMisc::Network::CUrlList m_vatsimStatusFileUrls; //!< Status file, where to find the VATSIM files (METAR, data, ATIS, other status files)
|
||||||
BlackMisc::Network::CUrlList m_vatsimDataFileUrls; //!< Overall VATSIM data file / merely for bootstrapping the first time
|
BlackMisc::Network::CUrlList m_vatsimDataFileUrls; //!< Overall VATSIM data file / merely for bootstrapping the first time
|
||||||
BlackMisc::Network::CUrlList m_sharedUrls; //!< where we can obtain shared info files such as bootstrap, ..
|
BlackMisc::Network::CUrlList m_sharedUrls; //!< where we can obtain shared info files such as bootstrap, ..
|
||||||
BlackMisc::Network::CUrlList m_newsUrls; //!< where we can obtain latest news
|
|
||||||
BlackMisc::Network::CUrlList m_onlineHelpUrls; //!< online help URLs
|
BlackMisc::Network::CUrlList m_onlineHelpUrls; //!< online help URLs
|
||||||
BlackMisc::Network::CServerList m_predefinedServers; //!< Predefined servers loaded from setup file
|
BlackMisc::Network::CServerList m_predefinedServers; //!< Predefined servers loaded from setup file
|
||||||
BlackMisc::Network::CUrl m_ncepGlobalForecastSystemUrl; //!< NCEP GFS url 0.5 degree resolution
|
BlackMisc::Network::CUrl m_ncepGlobalForecastSystemUrl; //!< NCEP GFS url 0.5 degree resolution
|
||||||
@@ -281,7 +276,6 @@ namespace BlackCore::Data
|
|||||||
BLACK_METAMEMBER(vatsimBookingsUrl),
|
BLACK_METAMEMBER(vatsimBookingsUrl),
|
||||||
BLACK_METAMEMBER(vatsimMetarsUrls),
|
BLACK_METAMEMBER(vatsimMetarsUrls),
|
||||||
BLACK_METAMEMBER(sharedUrls),
|
BLACK_METAMEMBER(sharedUrls),
|
||||||
BLACK_METAMEMBER(newsUrls),
|
|
||||||
BLACK_METAMEMBER(onlineHelpUrls),
|
BLACK_METAMEMBER(onlineHelpUrls),
|
||||||
BLACK_METAMEMBER(predefinedServers),
|
BLACK_METAMEMBER(predefinedServers),
|
||||||
BLACK_METAMEMBER(development),
|
BLACK_METAMEMBER(development),
|
||||||
|
|||||||
@@ -231,33 +231,9 @@ void CSwiftLauncher::mouseReleaseEvent(QMouseEvent *event)
|
|||||||
QDialog::mouseReleaseEvent(event);
|
QDialog::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSwiftLauncher::displayLatestNews(QNetworkReply *reply)
|
|
||||||
{
|
|
||||||
QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(reply);
|
|
||||||
if (nwReply->error() == QNetworkReply::NoError)
|
|
||||||
{
|
|
||||||
const QString html = nwReply->readAll().trimmed();
|
|
||||||
if (html.isEmpty()) { return; }
|
|
||||||
CLogMessage(this).info(u"Received news from '%1'") << nwReply->url().toString();
|
|
||||||
ui->tbr_LatestNews->setHtml(html); // causes QFSFileEngine::open: No file name specified
|
|
||||||
constexpr qint64 newNews = 72 * 3600 * 1000;
|
|
||||||
const qint64 deltaT = CNetworkUtils::lastModifiedSinceNow(nwReply.data());
|
|
||||||
if (deltaT > 0 && deltaT < newNews)
|
|
||||||
{
|
|
||||||
ui->tb_Launcher->setCurrentWidget(ui->pg_LatestNewsAndAbout);
|
|
||||||
ui->tw_LatestNewsAbout->setCurrentWidget(ui->tb_LatestNews);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CLogMessage(this).warning(u"Error received news from '%1'") << nwReply->url().toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CSwiftLauncher::updateInfoAvailable()
|
void CSwiftLauncher::updateInfoAvailable()
|
||||||
{
|
{
|
||||||
this->setHeaderInfo(ui->comp_UpdateInfo->getLatestAvailablePilotClientArtifactForSelection());
|
this->setHeaderInfo(ui->comp_UpdateInfo->getLatestAvailablePilotClientArtifactForSelection());
|
||||||
this->loadLatestNews();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSwiftLauncher::init()
|
void CSwiftLauncher::init()
|
||||||
@@ -276,7 +252,6 @@ void CSwiftLauncher::init()
|
|||||||
ui->lbl_HeaderInfo->setVisible(false);
|
ui->lbl_HeaderInfo->setVisible(false);
|
||||||
ui->sw_SwiftLauncher->setCurrentWidget(ui->pg_SwiftLauncherMain);
|
ui->sw_SwiftLauncher->setCurrentWidget(ui->pg_SwiftLauncherMain);
|
||||||
ui->tb_Launcher->setCurrentWidget(ui->pg_CoreMode);
|
ui->tb_Launcher->setCurrentWidget(ui->pg_CoreMode);
|
||||||
ui->tw_LatestNewsAbout->setCurrentWidget(ui->tb_LatestNews);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSwiftLauncher::initStyleSheet()
|
void CSwiftLauncher::initStyleSheet()
|
||||||
@@ -293,22 +268,6 @@ void CSwiftLauncher::initStyleSheet()
|
|||||||
this->setStyleSheet(s);
|
this->setStyleSheet(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSwiftLauncher::loadLatestNews()
|
|
||||||
{
|
|
||||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
|
||||||
|
|
||||||
CFailoverUrlList newsUrls(sGui->getGlobalSetup().getSwiftLatestNewsUrls());
|
|
||||||
const CUrl newsUrl(newsUrls.obtainNextWorkingUrl(true, 10 * 1000));
|
|
||||||
// const CUrl newsUrl("https://dev.swift-project.org/phame/blog/view/1/?__print__=1");
|
|
||||||
|
|
||||||
if (newsUrl.isEmpty())
|
|
||||||
{
|
|
||||||
CLogMessage(this).warning(u"No working news URL in %1") << newsUrls.toQString();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
sGui->getFromNetwork(newsUrl, { this, &CSwiftLauncher::displayLatestNews});
|
|
||||||
}
|
|
||||||
|
|
||||||
void CSwiftLauncher::initLogDisplay()
|
void CSwiftLauncher::initLogDisplay()
|
||||||
{
|
{
|
||||||
CLogHandler::instance()->install(true);
|
CLogHandler::instance()->install(true);
|
||||||
|
|||||||
@@ -131,10 +131,6 @@ private:
|
|||||||
//! Set header info
|
//! Set header info
|
||||||
void setHeaderInfo(const BlackMisc::Db::CArtifact &latestArtifact);
|
void setHeaderInfo(const BlackMisc::Db::CArtifact &latestArtifact);
|
||||||
|
|
||||||
//! Latest news
|
|
||||||
//! \sa CSwiftLauncher::displayLatestNews
|
|
||||||
void loadLatestNews();
|
|
||||||
|
|
||||||
//! Executaable for core
|
//! Executaable for core
|
||||||
bool setSwiftCoreExecutable();
|
bool setSwiftCoreExecutable();
|
||||||
|
|
||||||
@@ -159,9 +155,6 @@ private:
|
|||||||
//! Check for other swift applications, if so show message box
|
//! Check for other swift applications, if so show message box
|
||||||
bool warnAboutOtherSwiftApplications();
|
bool warnAboutOtherSwiftApplications();
|
||||||
|
|
||||||
//! Display latest news
|
|
||||||
void displayLatestNews(QNetworkReply *reply);
|
|
||||||
|
|
||||||
//! Distribution info is available
|
//! Distribution info is available
|
||||||
void updateInfoAvailable();
|
void updateInfoAvailable();
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
<property name="tabSpacing">
|
<property name="tabSpacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="pg_LatestNewsAndAbout">
|
<widget class="QWidget" name="pg_About">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -103,39 +103,6 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="label">
|
<attribute name="label">
|
||||||
<string>Latest &news and about</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QVBoxLayout" name="vl_LatestNewsAndAbout">
|
|
||||||
<item>
|
|
||||||
<widget class="QTabWidget" name="tw_LatestNewsAbout">
|
|
||||||
<property name="currentIndex">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="tb_LatestNews">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>News</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QVBoxLayout" name="vl_LatestNews">
|
|
||||||
<item>
|
|
||||||
<widget class="QTextBrowser" name="tbr_LatestNews">
|
|
||||||
<property name="documentTitle">
|
|
||||||
<string>Latest news</string>
|
|
||||||
</property>
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="placeholderText">
|
|
||||||
<string>Latest news will go here</string>
|
|
||||||
</property>
|
|
||||||
<property name="openExternalLinks">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="tb_About">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>About</string>
|
<string>About</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="vl_About">
|
<layout class="QVBoxLayout" name="vl_About">
|
||||||
@@ -144,10 +111,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="pg_WindowType">
|
<widget class="QWidget" name="pg_WindowType">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
@@ -928,8 +891,6 @@
|
|||||||
<tabstop>pb_DumpDir</tabstop>
|
<tabstop>pb_DumpDir</tabstop>
|
||||||
<tabstop>pb_P3DConfigDirs</tabstop>
|
<tabstop>pb_P3DConfigDirs</tabstop>
|
||||||
<tabstop>pb_FSXConfigDirs</tabstop>
|
<tabstop>pb_FSXConfigDirs</tabstop>
|
||||||
<tabstop>tw_LatestNewsAbout</tabstop>
|
|
||||||
<tabstop>tbr_LatestNews</tabstop>
|
|
||||||
<tabstop>tb_BackToMain</tabstop>
|
<tabstop>tb_BackToMain</tabstop>
|
||||||
<tabstop>rb_WindowNormal</tabstop>
|
<tabstop>rb_WindowNormal</tabstop>
|
||||||
<tabstop>rb_WindowFrameless</tabstop>
|
<tabstop>rb_WindowFrameless</tabstop>
|
||||||
|
|||||||
Reference in New Issue
Block a user