mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
Make DownloadDialog more intuitive and robust
This commit is contained in:
@@ -54,7 +54,7 @@ namespace BlackGui
|
|||||||
connect(ui->tb_CancelDownload, &QToolButton::pressed, this, &CDownloadComponent::cancelOngoingDownloads);
|
connect(ui->tb_CancelDownload, &QToolButton::pressed, this, &CDownloadComponent::cancelOngoingDownloads);
|
||||||
connect(ui->pb_Download, &QPushButton::pressed, [ = ] { this->triggerDownloadingOfFiles(); });
|
connect(ui->pb_Download, &QPushButton::pressed, [ = ] { this->triggerDownloadingOfFiles(); });
|
||||||
connect(ui->pb_OpenDownloadDir, &QPushButton::pressed, this, &CDownloadComponent::openDownloadDir);
|
connect(ui->pb_OpenDownloadDir, &QPushButton::pressed, this, &CDownloadComponent::openDownloadDir);
|
||||||
connect(ui->pb_DoIt, &QPushButton::pressed, this, &CDownloadComponent::startDownloadedExecutable);
|
connect(ui->pb_Launch, &QPushButton::pressed, this, &CDownloadComponent::startDownloadedExecutable);
|
||||||
}
|
}
|
||||||
|
|
||||||
CDownloadComponent::~CDownloadComponent()
|
CDownloadComponent::~CDownloadComponent()
|
||||||
@@ -99,6 +99,8 @@ namespace BlackGui
|
|||||||
|
|
||||||
bool CDownloadComponent::triggerDownloadingOfFiles(int delayMs)
|
bool CDownloadComponent::triggerDownloadingOfFiles(int delayMs)
|
||||||
{
|
{
|
||||||
|
ui->pb_Download->setEnabled(false);
|
||||||
|
ui->pb_Launch->setEnabled(false);
|
||||||
if (m_remoteFiles.isEmpty()) { return false; }
|
if (m_remoteFiles.isEmpty()) { return false; }
|
||||||
if (!m_waitingForDownload.isEmpty()) { return false; }
|
if (!m_waitingForDownload.isEmpty()) { return false; }
|
||||||
if (delayMs > 0)
|
if (delayMs > 0)
|
||||||
@@ -162,6 +164,7 @@ namespace BlackGui
|
|||||||
ui->le_StartedNumber->clear();
|
ui->le_StartedNumber->clear();
|
||||||
ui->le_StartedUrl->clear();
|
ui->le_StartedUrl->clear();
|
||||||
this->showFileInfo();
|
this->showFileInfo();
|
||||||
|
ui->pb_Download->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CDownloadComponent::triggerDownloadingOfNextFile()
|
bool CDownloadComponent::triggerDownloadingOfNextFile()
|
||||||
@@ -255,6 +258,8 @@ namespace BlackGui
|
|||||||
QTimer::singleShot(0, this, [ = ]
|
QTimer::singleShot(0, this, [ = ]
|
||||||
{
|
{
|
||||||
if (!myself || !sGui || sGui->isShuttingDown()) { return; }
|
if (!myself || !sGui || sGui->isShuttingDown()) { return; }
|
||||||
|
myself->ui->pb_Download->setEnabled(true);
|
||||||
|
myself->ui->pb_Launch->setEnabled(true);
|
||||||
this->allDownloadsCompleted();
|
this->allDownloadsCompleted();
|
||||||
});
|
});
|
||||||
this->startDownloadedExecutable();
|
this->startDownloadedExecutable();
|
||||||
|
|||||||
@@ -6,117 +6,47 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>450</width>
|
<width>438</width>
|
||||||
<height>310</height>
|
<height>298</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>450</width>
|
|
||||||
<height>250</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Download files</string>
|
<string>Download files</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gl_DownloadComponent" columnstretch="1,3,1,1,1">
|
<layout class="QGridLayout" name="gl_DownloadComponent" columnstretch="1,0,0,0,0">
|
||||||
<item row="0" column="3">
|
<item row="6" column="0">
|
||||||
<widget class="QToolButton" name="tb_CancelDownload">
|
<widget class="QLabel" name="lbl_Actions">
|
||||||
<property name="toolTip">
|
<property name="sizePolicy">
|
||||||
<string>cancel downloading</string>
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>...</string>
|
<string>Actions:</string>
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../../blackmisc/blackmisc.qrc">
|
|
||||||
<normaloff>:/diagona/icons/diagona/icons/cross-circle.png</normaloff>:/diagona/icons/diagona/icons/cross-circle.png</iconset>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="0" column="0">
|
||||||
<widget class="QLineEdit" name="le_DownloadDir">
|
<widget class="QLabel" name="lbl_Info">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Info:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1" colspan="3">
|
||||||
|
<widget class="QLineEdit" name="le_Completed">
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_Started">
|
|
||||||
<property name="text">
|
|
||||||
<string>Started:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_Completed">
|
|
||||||
<property name="text">
|
|
||||||
<string>Completed:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_DownloadDirectory">
|
|
||||||
<property name="text">
|
|
||||||
<string>Directory:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="10" column="0">
|
|
||||||
<spacer name="vs_DownloadComponent">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="1" colspan="4">
|
|
||||||
<widget class="QProgressBar" name="prb_Current">
|
|
||||||
<property name="maximum">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="4">
|
|
||||||
<widget class="QPushButton" name="pb_OpenDownloadDir">
|
|
||||||
<property name="text">
|
|
||||||
<string>open</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1" colspan="3">
|
|
||||||
<widget class="QLineEdit" name="le_Started">
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_Current">
|
|
||||||
<property name="text">
|
|
||||||
<string>Current:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="3">
|
|
||||||
<widget class="QToolButton" name="tb_ResetDownloadDir">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Reset download directory</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../../blackmisc/blackmisc.qrc">
|
|
||||||
<normaloff>:/diagona/icons/diagona/icons/arrow-circle-225-left.png</normaloff>:/diagona/icons/diagona/icons/arrow-circle-225-left.png</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
<item row="1" column="2">
|
||||||
<widget class="QToolButton" name="tb_DialogDownloadDir">
|
<widget class="QToolButton" name="tb_DialogDownloadDir">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@@ -134,8 +64,53 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1" colspan="3">
|
<item row="0" column="4">
|
||||||
<widget class="QLineEdit" name="le_Completed">
|
<widget class="QPushButton" name="pb_Download">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>93</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>download and install</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>download</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="4">
|
||||||
|
<widget class="QPushButton" name="pb_Launch">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Launch</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1" colspan="4">
|
||||||
|
<widget class="QLineEdit" name="le_StartedUrl">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1" colspan="4">
|
||||||
|
<widget class="QLineEdit" name="le_CompletedUrl">
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -151,27 +126,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1" colspan="4">
|
|
||||||
<widget class="QLineEdit" name="le_CompletedUrl">
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_Total">
|
|
||||||
<property name="text">
|
|
||||||
<string>Total:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="lbl_Info">
|
|
||||||
<property name="text">
|
|
||||||
<string>Info:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="4">
|
<item row="2" column="4">
|
||||||
<widget class="QLineEdit" name="le_StartedNumber">
|
<widget class="QLineEdit" name="le_StartedNumber">
|
||||||
<property name="maxLength">
|
<property name="maxLength">
|
||||||
@@ -182,20 +136,71 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1" colspan="4">
|
<item row="0" column="3">
|
||||||
<widget class="QLineEdit" name="le_StartedUrl">
|
<widget class="QToolButton" name="tb_CancelDownload">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>cancel downloading</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../blackmisc/blackmisc.qrc">
|
||||||
|
<normaloff>:/diagona/icons/diagona/icons/cross-circle.png</normaloff>:/diagona/icons/diagona/icons/cross-circle.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="4">
|
||||||
|
<widget class="QPushButton" name="pb_OpenDownloadDir">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>open</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLineEdit" name="le_DownloadDir">
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="4">
|
<item row="8" column="0">
|
||||||
<widget class="QPushButton" name="pb_Download">
|
<widget class="QLabel" name="lbl_Total">
|
||||||
<property name="toolTip">
|
<property name="sizePolicy">
|
||||||
<string>download and install</string>
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>download</string>
|
<string>Total:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="1" colspan="4">
|
||||||
|
<widget class="QProgressBar" name="prb_Current">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="3">
|
||||||
|
<widget class="QToolButton" name="tb_ResetDownloadDir">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Reset download directory</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../blackmisc/blackmisc.qrc">
|
||||||
|
<normaloff>:/diagona/icons/diagona/icons/arrow-circle-225-left.png</normaloff>:/diagona/icons/diagona/icons/arrow-circle-225-left.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -206,31 +211,28 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="4">
|
<item row="2" column="1" colspan="3">
|
||||||
<widget class="QLineEdit" name="le_CompletedNumber">
|
<widget class="QLineEdit" name="le_Started">
|
||||||
<property name="maxLength">
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="7" column="0">
|
||||||
<widget class="QLabel" name="lbl_Actions">
|
<widget class="QLabel" name="lbl_Current">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Actions:</string>
|
<string>Current:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1" colspan="3">
|
<item row="6" column="1" colspan="3">
|
||||||
<widget class="QFrame" name="fr_Checkboxes">
|
<widget class="QFrame" name="fr_Checkboxes">
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="hl_Checkboxes">
|
<layout class="QHBoxLayout" name="hl_Checkboxes">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
@@ -246,13 +248,25 @@
|
|||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="cb_StartAfterDownload">
|
<widget class="QCheckBox" name="cb_StartAfterDownload">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>start after download</string>
|
<string>launch after download</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="cb_Shutdown">
|
<widget class="QCheckBox" name="cb_Shutdown">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>shutdown</string>
|
<string>shutdown</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -261,10 +275,52 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="4">
|
<item row="1" column="0">
|
||||||
<widget class="QPushButton" name="pb_DoIt">
|
<widget class="QLabel" name="lbl_DownloadDirectory">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>do it</string>
|
<string>Directory:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="lbl_Completed">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Completed:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="lbl_Started">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Started:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="4">
|
||||||
|
<widget class="QLineEdit" name="le_CompletedNumber">
|
||||||
|
<property name="maxLength">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CDownloadDialog::setDownloadFile(const CRemoteFile &remoteFile)
|
void CDownloadDialog::setDownloadFile(const CRemoteFile &remoteFile)
|
||||||
{
|
{
|
||||||
|
setWindowTitle("Downloading " + remoteFile.getName());
|
||||||
ui->comp_Download->setDownloadFile(remoteFile);
|
ui->comp_Download->setDownloadFile(remoteFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,13 +61,21 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CDownloadDialog::accept()
|
void CDownloadDialog::accept()
|
||||||
{
|
{
|
||||||
ui->comp_Download->triggerDownloadingOfFiles();
|
if (! ui->comp_Download->haveAllDownloadsCompleted())
|
||||||
}
|
{
|
||||||
|
const QString msg = QStringLiteral("Download ongoing. Do you want to abort it?");
|
||||||
void CDownloadDialog::reject()
|
QMessageBox::StandardButton reply = QMessageBox::question(this, "Abort?", msg, QMessageBox::Yes | QMessageBox::No);
|
||||||
|
if (reply == QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
ui->comp_Download->cancelOngoingDownloads();
|
ui->comp_Download->cancelOngoingDownloads();
|
||||||
this->done(CDownloadDialog::Rejected);
|
this->done(CDownloadDialog::Rejected);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->done(CDownloadDialog::Accepted);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -56,9 +56,6 @@ namespace BlackGui
|
|||||||
//! \copydoc QDialog::accept
|
//! \copydoc QDialog::accept
|
||||||
virtual void accept() override;
|
virtual void accept() override;
|
||||||
|
|
||||||
//! \copydoc QDialog::reject
|
|
||||||
virtual void reject() override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::CDownloadDialog> ui;
|
QScopedPointer<Ui::CDownloadDialog> ui;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,20 +2,6 @@
|
|||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CDownloadDialog</class>
|
<class>CDownloadDialog</class>
|
||||||
<widget class="QDialog" name="CDownloadDialog">
|
<widget class="QDialog" name="CDownloadDialog">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>425</width>
|
|
||||||
<height>265</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>425</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Download files</string>
|
<string>Download files</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -33,14 +19,7 @@
|
|||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="BlackGui::Components::CDownloadComponent" name="comp_Download">
|
<widget class="BlackGui::Components::CDownloadComponent" name="comp_Download"/>
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>225</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="bb_DownloadDialog">
|
<widget class="QDialogButtonBox" name="bb_DownloadDialog">
|
||||||
@@ -48,7 +27,10 @@
|
|||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Abort|QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Close</set>
|
||||||
|
</property>
|
||||||
|
<property name="centerButtons">
|
||||||
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -66,33 +48,17 @@
|
|||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>bb_DownloadDialog</sender>
|
<sender>bb_DownloadDialog</sender>
|
||||||
<signal>accepted()</signal>
|
<signal>clicked(QAbstractButton*)</signal>
|
||||||
<receiver>CDownloadDialog</receiver>
|
<receiver>CDownloadDialog</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
<x>248</x>
|
<x>102</x>
|
||||||
<y>254</y>
|
<y>36</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel">
|
<hint type="destinationlabel">
|
||||||
<x>157</x>
|
<x>102</x>
|
||||||
<y>274</y>
|
<y>28</y>
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>bb_DownloadDialog</sender>
|
|
||||||
<signal>rejected()</signal>
|
|
||||||
<receiver>CDownloadDialog</receiver>
|
|
||||||
<slot>reject()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>316</x>
|
|
||||||
<y>260</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>286</x>
|
|
||||||
<y>274</y>
|
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
m_downloadDialog->setMode(CDownloadComponent::SwiftInstaller);
|
m_downloadDialog->setMode(CDownloadComponent::SwiftInstaller);
|
||||||
m_downloadDialog->setDownloadFile(artifact.asRemoteFile());
|
m_downloadDialog->setDownloadFile(artifact.asRemoteFile());
|
||||||
m_downloadDialog->showAndStartDownloading();
|
m_downloadDialog->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user