mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 13:36:48 +08:00
Ref T203, download component (generic file download)
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "updateinfocomponent.h"
|
||||
#include "ui_updateinfocomponent.h"
|
||||
#include "installxswiftbusdialog.h"
|
||||
#include "downloaddialog.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackmisc/network/networkutils.h"
|
||||
#include "blackmisc/db/distributionlist.h"
|
||||
@@ -130,6 +131,31 @@ namespace BlackGui
|
||||
m_installXSwiftBusDialog->show();
|
||||
}
|
||||
|
||||
void CUpdateInfoComponent::downloadInstallerDialog()
|
||||
{
|
||||
const CUpdateInfo update(m_updateInfo.get());
|
||||
const QString currentVersion = ui->cb_ArtifactsPilotClient->currentText();
|
||||
const CArtifact artifact = update.getArtifactsPilotClient().findFirstByVersionOrDefault(currentVersion);
|
||||
|
||||
if (!m_downloadDialog)
|
||||
{
|
||||
m_downloadDialog.reset(new CDownloadDialog(this));
|
||||
m_downloadDialog->setModal(true);
|
||||
}
|
||||
|
||||
const CRemoteFile rf = artifact.asRemoteFile();
|
||||
if (rf.getUrl().isHavingHtmlSuffix())
|
||||
{
|
||||
QDesktopServices::openUrl(rf.getUrl());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_downloadDialog->setMode(CDownloadComponent::SwiftInstaller);
|
||||
m_downloadDialog->setDownloadFile(artifact.asRemoteFile());
|
||||
m_downloadDialog->showAndStartDownloading();
|
||||
}
|
||||
}
|
||||
|
||||
void CUpdateInfoComponent::saveSettings()
|
||||
{
|
||||
const QString channel = this->getSelectedOrDefaultDistribution().getChannel();
|
||||
|
||||
Reference in New Issue
Block a user