// SPDX-License-Identifier: MIT // // ES-DE Frontend // GuiOrphanedDataCleanup.h // // Removes orphaned game media, gamelist.xml entries and custom collections entries. // #ifndef ES_APP_GUIS_GUI_ORPHANED_DATA_CLEANUP_H #define ES_APP_GUIS_GUI_ORPHANED_DATA_CLEANUP_H #include "GuiComponent.h" #include "components/BusyComponent.h" #include "guis/GuiSettings.h" #include "views/ViewController.h" #include #include #include class GuiOrphanedDataCleanup : public GuiComponent { public: GuiOrphanedDataCleanup(std::function reloadCallback); ~GuiOrphanedDataCleanup(); void cleanupMediaFiles(); void cleanupGamelists(); void cleanupCollections(); void update(int deltaTime) override; void render(const glm::mat4& parentTrans) override; private: void onSizeChanged() override; bool input(InputConfig* config, Input input) override; std::vector getHelpPrompts() override; HelpStyle getHelpStyle() override { return ViewController::getInstance()->getViewHelpStyle(); } Renderer* mRenderer; NinePatchComponent mBackground; ComponentGrid mGrid; BusyComponent mBusyAnim; std::function mReloadCallback; std::shared_ptr mButtons; std::shared_ptr mButton1; std::shared_ptr mButton2; std::shared_ptr mButton3; std::shared_ptr mButton4; std::shared_ptr mTitle; std::shared_ptr mStatus; std::shared_ptr mDescriptionHeader; std::shared_ptr mDescription; std::shared_ptr mSystemProcessingHeader; std::shared_ptr mEntryCountHeader; std::shared_ptr mSystemProcessing; std::shared_ptr mEntryCount; std::shared_ptr mErrorHeader; std::shared_ptr mError; std::unique_ptr mThread; std::mutex mMutex; int mCursorPos; std::string mMediaDescription; std::string mGamelistDescription; std::string mCollectionsDescription; std::string mCurrentSystem; std::string mErrorMessage; std::string mMediaDirectory; std::vector mMediaTypes; std::atomic mIsProcessing; std::atomic mStopProcessing; std::atomic mCompleted; std::atomic mFailed; std::atomic mNeedsReloading; std::atomic mProcessedCount; bool mHasCustomCollections; bool mCaseSensitiveFilesystem; enum class CleanupType { MEDIA, GAMELISTS, COLLECTIONS }; CleanupType mCleanupType; }; #endif // ES_APP_GUIS_GUI_ORPHANED_DATA_CLEANUP_H