mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-19 20:25:29 +08:00
refs #709, fixed initial version displayed
(was not called when data were not updated)
This commit is contained in:
@@ -40,6 +40,11 @@ namespace BlackCore
|
|||||||
return CBuildConfig::isBetaTest() ? getLatestVersionBeta() : getLatestVersionStable();
|
return CBuildConfig::isBetaTest() ? getLatestVersionBeta() : getLatestVersionStable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString CUpdateInfo::getChannel() const
|
||||||
|
{
|
||||||
|
return CBuildConfig::isBetaTest() ? "beta" : "stable";
|
||||||
|
}
|
||||||
|
|
||||||
bool CUpdateInfo::hasSameType(const CUpdateInfo &otherDownload) const
|
bool CUpdateInfo::hasSameType(const CUpdateInfo &otherDownload) const
|
||||||
{
|
{
|
||||||
return this->isDevelopment() == otherDownload.isDevelopment();
|
return this->isDevelopment() == otherDownload.isDevelopment();
|
||||||
@@ -136,6 +141,5 @@ namespace BlackCore
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ namespace BlackCore
|
|||||||
//! Latest version
|
//! Latest version
|
||||||
QString getLatestVersion() const;
|
QString getLatestVersion() const;
|
||||||
|
|
||||||
|
//! Version channel (Beta, Stable)
|
||||||
|
QString getChannel() const;
|
||||||
|
|
||||||
//! Last supported version stable
|
//! Last supported version stable
|
||||||
const QString &getLastSupportedVersionStable() const { return m_lastSupportedVersionStable; }
|
const QString &getLastSupportedVersionStable() const { return m_lastSupportedVersionStable; }
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ CSwiftLauncher::CSwiftLauncher(QWidget *parent) :
|
|||||||
connect(ui->tb_BackToMain, &QToolButton::pressed, this, &CSwiftLauncher::ps_showMainPage);
|
connect(ui->tb_BackToMain, &QToolButton::pressed, this, &CSwiftLauncher::ps_showMainPage);
|
||||||
|
|
||||||
// use version signal as trigger for completion
|
// use version signal as trigger for completion
|
||||||
|
this->ps_loadedUpdateInfo(true); // defaults from settings, overridden by signal/slot when changed
|
||||||
connect(sGui, &CApplication::updateInfoAvailable, this, &CSwiftLauncher::ps_loadedUpdateInfo);
|
connect(sGui, &CApplication::updateInfoAvailable, this, &CSwiftLauncher::ps_loadedUpdateInfo);
|
||||||
|
|
||||||
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_L), this, SLOT(ps_showLogPage()));
|
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_L), this, SLOT(ps_showLogPage()));
|
||||||
@@ -307,7 +308,7 @@ void CSwiftLauncher::ps_loadedUpdateInfo(bool success)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CUpdateInfo updateInfo(this->m_updateInfo.getThreadLocal());
|
const CUpdateInfo updateInfo(this->m_updateInfo.get());
|
||||||
const QString latestVersion(updateInfo.getLatestVersion()) ; // need to get this from somewhere
|
const QString latestVersion(updateInfo.getLatestVersion()) ; // need to get this from somewhere
|
||||||
CFailoverUrlList downloadUrls(updateInfo.getDownloadUrls());
|
CFailoverUrlList downloadUrls(updateInfo.getDownloadUrls());
|
||||||
bool newVersionAvailable = CVersion::isNewerVersion(latestVersion) && !downloadUrls.isEmpty();
|
bool newVersionAvailable = CVersion::isNewerVersion(latestVersion) && !downloadUrls.isEmpty();
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QToolBox" name="tb_Launcher">
|
<widget class="QToolBox" name="tb_Launcher">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="tabSpacing">
|
<property name="tabSpacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
@@ -116,8 +116,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>199</width>
|
<width>355</width>
|
||||||
<height>63</height>
|
<height>301</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="label">
|
<attribute name="label">
|
||||||
@@ -181,8 +181,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>277</width>
|
<width>341</width>
|
||||||
<height>222</height>
|
<height>309</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="label">
|
<attribute name="label">
|
||||||
@@ -406,104 +406,140 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>283</width>
|
<width>355</width>
|
||||||
<height>198</height>
|
<height>301</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="label">
|
<attribute name="label">
|
||||||
<string>Check for updates</string>
|
<string>Check for updates</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gl_Updates">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
<item row="5" column="1">
|
<item>
|
||||||
<widget class="QWidget" name="wi_NoNewVersion" native="true">
|
<widget class="QFrame" name="fr_SoftwareUpdates">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<property name="frameShape">
|
||||||
<item>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
<widget class="QLabel" name="blb_NoNewVersion">
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="le_CurrentVersion">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lbl_CurrentVersion">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>You are running the latest version!</string>
|
<string>This version:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QLabel" name="lbl_LatestVersion">
|
||||||
|
<property name="text">
|
||||||
|
<string>Latest version:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1" colspan="3">
|
||||||
|
<widget class="QWidget" name="wi_NoNewVersion" native="true">
|
||||||
|
<layout class="QVBoxLayout" name="vl_NoNewVersion">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_NoNewVersion">
|
||||||
|
<property name="text">
|
||||||
|
<string>You are running the latest version!</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
|
<widget class="QLineEdit" name="le_LatestVersion">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1" colspan="3">
|
||||||
|
<widget class="QWidget" name="wi_NewVersionAvailable" native="true">
|
||||||
|
<layout class="QVBoxLayout" name="vl_NewVersionAvailable">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_NewVersion">
|
||||||
|
<property name="text">
|
||||||
|
<string>New version available</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_NewVersionUrl">
|
||||||
|
<property name="text">
|
||||||
|
<string>URL goes here</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1" colspan="2">
|
||||||
|
<widget class="QPushButton" name="pb_CheckForUpdates">
|
||||||
|
<property name="text">
|
||||||
|
<string>check for updates</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item>
|
||||||
<widget class="QWidget" name="wi_NewVersionAvailable" native="true">
|
<widget class="QFrame" name="fr_DataUpdates">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<property name="frameShape">
|
||||||
<item>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
<widget class="QLabel" name="lbl_NewVersionText">
|
</property>
|
||||||
<property name="text">
|
<property name="frameShadow">
|
||||||
<string>A new version is available here:</string>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="lbl_NewVersionUrl">
|
|
||||||
<property name="text">
|
|
||||||
<string>http://www.foobar.com</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_CurrentVersion">
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_LatestVersion">
|
|
||||||
<property name="text">
|
|
||||||
<string>Latest version:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_CurrentVersion">
|
|
||||||
<property name="text">
|
|
||||||
<string>This version:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QPushButton" name="pb_CheckForUpdates">
|
|
||||||
<property name="text">
|
|
||||||
<string>check for updates</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="le_LatestVersion">
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="1">
|
|
||||||
<spacer name="vs_Updates">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
|
<zorder>fr_SoftwareUpdates</zorder>
|
||||||
|
<zorder>lbl_NoNewVersion</zorder>
|
||||||
|
<zorder>fr_DataUpdates</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="pg_CreditsLicense">
|
<widget class="QWidget" name="pg_CreditsLicense">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>98</width>
|
<width>355</width>
|
||||||
<height>88</height>
|
<height>301</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="label">
|
<attribute name="label">
|
||||||
@@ -738,8 +774,8 @@ p, li { white-space: pre-wrap; }
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="swiftlauncher.qrc"/>
|
|
||||||
<include location="../blackmisc/blackmisc.qrc"/>
|
<include location="../blackmisc/blackmisc.qrc"/>
|
||||||
|
<include location="swiftlauncher.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
<buttongroups>
|
<buttongroups>
|
||||||
|
|||||||
Reference in New Issue
Block a user