diff options
Diffstat (limited to 'src/updater.h')
| -rw-r--r-- | src/updater.h | 47 |
1 files changed, 47 insertions, 0 deletions
| diff --git a/src/updater.h b/src/updater.h new file mode 100644 index 0000000..2d2f746 --- /dev/null +++ b/src/updater.h | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | #ifndef UPDATER_H_809E7381 | ||
| 2 | #define UPDATER_H_809E7381 | ||
| 3 | |||
| 4 | #include <filesystem> | ||
| 5 | #include <set> | ||
| 6 | #include <string> | ||
| 7 | |||
| 8 | #include <wx/wxprec.h> | ||
| 9 | |||
| 10 | #ifndef WX_PRECOMP | ||
| 11 | #include <wx/wx.h> | ||
| 12 | #endif | ||
| 13 | |||
| 14 | class wxWebRequest; | ||
| 15 | class wxWebRequestEvent; | ||
| 16 | |||
| 17 | class Updater : public wxEvtHandler { | ||
| 18 | public: | ||
| 19 | explicit Updater(wxFrame* parent); | ||
| 20 | |||
| 21 | void Cleanup(); | ||
| 22 | |||
| 23 | void CheckForUpdates(bool invisible); | ||
| 24 | |||
| 25 | private: | ||
| 26 | enum class UpdateState { | ||
| 27 | GetVersionInvisible, | ||
| 28 | GetVersionManual, | ||
| 29 | GetPackage, | ||
| 30 | }; | ||
| 31 | |||
| 32 | void OnWebRequestState(wxWebRequestEvent& event); | ||
| 33 | |||
| 34 | void ProcessVersionFile(std::string data); | ||
| 35 | |||
| 36 | void InstallUpdate(std::string url, std::string checksum, | ||
| 37 | std::vector<std::filesystem::path> files, | ||
| 38 | std::vector<std::filesystem::path> deletedFiles); | ||
| 39 | |||
| 40 | bool DownloadWithProgress(wxWebRequest& request); | ||
| 41 | |||
| 42 | wxFrame* parent_; | ||
| 43 | UpdateState update_state_ = UpdateState::GetVersionInvisible; | ||
| 44 | std::string package_path_; | ||
| 45 | }; | ||
| 46 | |||
| 47 | #endif /* end of include guard: UPDATER_H_809E7381 */ | ||
