mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
[Updater] Trigger download from dialog "download and install"
This commit is contained in:
committed by
Mat Sutcliffe
parent
881ec39043
commit
c187c701d5
@@ -73,6 +73,16 @@ namespace BlackGui
|
|||||||
return (vCurrentChannelPlatform > vCurrent);
|
return (vCurrentChannelPlatform > vCurrent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CUpdateInfoComponent::triggerDownload()
|
||||||
|
{
|
||||||
|
QPointer<CUpdateInfoComponent> myself(this);
|
||||||
|
QTimer::singleShot(10, this, [ = ]
|
||||||
|
{
|
||||||
|
if (!myself) { return; }
|
||||||
|
ui->pb_DownloadInstaller->click();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void CUpdateInfoComponent::requestLoadOfSetup()
|
void CUpdateInfoComponent::requestLoadOfSetup()
|
||||||
{
|
{
|
||||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace BlackGui
|
|||||||
explicit CUpdateInfoComponent(QWidget *parent = nullptr);
|
explicit CUpdateInfoComponent(QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! Dtor
|
//! Dtor
|
||||||
virtual ~CUpdateInfoComponent();
|
virtual ~CUpdateInfoComponent() override;
|
||||||
|
|
||||||
//! Is there a new version available return version, else empty string
|
//! Is there a new version available return version, else empty string
|
||||||
BlackMisc::Db::CArtifact getLatestAvailablePilotClientArtifactForSelection() const;
|
BlackMisc::Db::CArtifact getLatestAvailablePilotClientArtifactForSelection() const;
|
||||||
@@ -47,6 +47,9 @@ namespace BlackGui
|
|||||||
//! Is there a new version available?
|
//! Is there a new version available?
|
||||||
bool isNewPilotClientVersionAvailable() const;
|
bool isNewPilotClientVersionAvailable() const;
|
||||||
|
|
||||||
|
//! Trigger download
|
||||||
|
void triggerDownload();
|
||||||
|
|
||||||
//! Current distribution
|
//! Current distribution
|
||||||
BlackMisc::Db::CDistribution getCurrentDistribution() const { return this->getSelectedOrDefaultDistribution(); }
|
BlackMisc::Db::CDistribution getCurrentDistribution() const { return this->getSelectedOrDefaultDistribution(); }
|
||||||
|
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ namespace BlackGui
|
|||||||
const CDistribution distribution = ui->comp_UpdateInfo->getCurrentDistribution();
|
const CDistribution distribution = ui->comp_UpdateInfo->getCurrentDistribution();
|
||||||
if (!distribution.hasDownloadUrls()) { return QDialog::Rejected; }
|
if (!distribution.hasDownloadUrls()) { return QDialog::Rejected; }
|
||||||
|
|
||||||
// in future, start download and close application
|
ui->comp_UpdateInfo->triggerDownload();
|
||||||
// for now, just open URL
|
return r;
|
||||||
QDesktopServices::openUrl(distribution.getDownloadUrls().getRandomUrl());
|
|
||||||
return QDialog::Rejected;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CUpdateInfoDialog::event(QEvent *event)
|
bool CUpdateInfoDialog::event(QEvent *event)
|
||||||
|
|||||||
Reference in New Issue
Block a user