Update UI to display details on error

This commit is contained in:
Pengfei
2021-09-10 23:12:14 +08:00
parent 1e78eefa03
commit c9d7dc0d6e
5 changed files with 39 additions and 17 deletions
+4 -2
View File
@@ -17,6 +17,8 @@ public:
using ExecuteFunc = std::function<bool(Core::SDMCImporter&, const Core::ContentSpecifier&,
const Common::ProgressCallback&)>;
using AbortFunc = std::function<void(Core::SDMCImporter&)>;
// (content, error log)
using FailedContentList = std::vector<std::pair<Core::ContentSpecifier, std::string>>;
explicit MultiJob(QObject* parent, Core::SDMCImporter& importer,
std::vector<Core::ContentSpecifier> contents, ExecuteFunc execute_func,
@@ -26,7 +28,7 @@ public:
void run() override;
void Cancel();
std::vector<Core::ContentSpecifier> GetFailedContents() const;
FailedContentList GetFailedContents() const;
signals:
/**
@@ -48,7 +50,7 @@ private:
std::atomic_bool cancelled{false};
Core::SDMCImporter& importer;
std::vector<Core::ContentSpecifier> contents;
std::vector<Core::ContentSpecifier> failed_contents;
FailedContentList failed_contents;
ExecuteFunc execute_func;
AbortFunc abort_func;
};