6 #ifndef SWIFT_GUI_COMPONENTS_DOWNLOADCOMPONENT_H
7 #define SWIFT_GUI_COMPONENTS_DOWNLOADCOMPONENT_H
11 #include <QNetworkReply>
12 #include <QScopedPointer>
22 class CDownloadComponent;
40 SwiftInstaller = StartAfterDownload | ShutdownSwift
42 Q_DECLARE_FLAGS(Mode, ModeFlag)
57 bool setDownloadDirectory(
const QString &path);
60 bool triggerDownloadingOfFiles(
int delayMs = -1);
63 bool isDownloading()
const;
66 bool haveAllDownloadsCompleted()
const;
72 void setMode(Mode mode);
78 void cancelOngoingDownloads();
85 static constexpr std::chrono::milliseconds OverlayMsgTimeout { 5000 };
86 QScopedPointer<Ui::CDownloadComponent> ui;
87 const QFileDialog::Options m_fileDialogOptions { QFileDialog::ShowDirsOnly | QFileDialog::ReadOnly |
88 QFileDialog::DontResolveSymlinks };
92 QNetworkReply *m_reply =
nullptr;
95 void selectDownloadDirectory();
98 bool triggerDownloadingOfNextFile();
107 void lastFileDownloaded();
110 void startDownloadedExecutable();
113 bool existsDownloadDir()
const;
116 void openDownloadDir();
119 void resetDownloadDir();
128 void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
135 Q_DECLARE_METATYPE(swift::gui::components::CDownloadComponent::Mode)
137 Q_DECLARE_OPERATORS_FOR_FLAGS(swift::gui::components::CDownloadComponent::Mode)
Enable widget class for load indicator.
Using this class provides a QFrame with the overlay functionality already integrated.
@ ShutdownSwift
for installers, stop swift before running
@ StartAfterDownload
download, then install
@ JustDownload
download, that's it
void allDownloadsCompleted()
All downloads have been completed.
Streamable status message, e.g.
Value object encapsulating a list of remote files.
High level reusable GUI components.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.