// SPDX-License-Identifier: MIT // // ES-DE // GuiApplicationUpdater.h // // Installs application updates. // Used in conjunction with ApplicationUpdater. // #ifndef ES_APP_GUIS_GUI_APPLICATION_UPDATER_H #define ES_APP_GUIS_GUI_APPLICATION_UPDATER_H #include "ApplicationUpdater.h" #include "AsyncHandle.h" #include "GuiComponent.h" #include "HttpReq.h" #include "components/BusyComponent.h" #include "guis/GuiSettings.h" #include "views/ViewController.h" #include #include #include class GuiApplicationUpdater : public GuiComponent { public: GuiApplicationUpdater(); ~GuiApplicationUpdater(); void setDownloadPath(); bool downloadPackage(); bool installAppImage(); void update(int deltaTime) override; void render(const glm::mat4& parentTrans) override; private: void onSizeChanged() override; std::vector getHelpPrompts() override; HelpStyle getHelpStyle() override { if (ViewController::getInstance()->getState().viewing == ViewController::ViewMode::NOTHING) return HelpStyle(); else return ViewController::getInstance()->getViewHelpStyle(); } Renderer* mRenderer; BusyComponent mBusyAnim; NinePatchComponent mBackground; ComponentGrid mGrid; std::shared_ptr mButtons; std::shared_ptr mButton1; std::shared_ptr mButton2; std::shared_ptr mButton3; std::shared_ptr mTitle; std::shared_ptr mStatusHeader; std::shared_ptr mProcessStep1; std::shared_ptr mProcessStep2; std::shared_ptr mProcessStep3; std::shared_ptr mStatusMessageHeader; std::shared_ptr mStatusMessage; std::shared_ptr mChangelogMessage; std::unique_ptr mThread; std::unique_ptr mRequest; AsyncHandleStatus mStatus; std::mutex mMutex; std::string mMessage; ApplicationUpdater::Package mPackage; std::string mDownloadPackageFilename; std::atomic mDownloadPercentage; std::atomic mLinuxAppImage; std::atomic mAbortDownload; std::atomic mDownloading; std::atomic mReadyToInstall; bool mHasDownloaded; bool mInstalling; bool mHasInstalled; }; #endif // ES_APP_GUIS_GUI_APPLICATION_UPDATER_H