diff options
Diffstat (limited to 'gui/saveload-dialog.h')
-rw-r--r-- | gui/saveload-dialog.h | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/gui/saveload-dialog.h b/gui/saveload-dialog.h index 31f28f6452..43721aa270 100644 --- a/gui/saveload-dialog.h +++ b/gui/saveload-dialog.h @@ -30,6 +30,25 @@ namespace GUI { +#if defined(USE_CLOUD) && defined(USE_LIBCURL) +enum SaveLoadCloudSyncProgress { + kSavesSyncProgressCmd = 'SSPR', + kSavesSyncEndedCmd = 'SSEN' +}; + +class SaveLoadCloudSyncProgressDialog : public Dialog { //protected? + StaticTextWidget *_label, *_percentLabel; + SliderWidget *_progressBar; + bool _close; +public: + SaveLoadCloudSyncProgressDialog(bool canRunInBackground); + virtual ~SaveLoadCloudSyncProgressDialog(); + + virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); + virtual void handleTickle(); +}; +#endif + #define kSwitchSaveLoadDialog -2 // TODO: We might want to disable the grid based save/load chooser for more @@ -53,13 +72,21 @@ class SaveLoadChooserDialog : protected Dialog { public: SaveLoadChooserDialog(const Common::String &dialogName, const bool saveMode); SaveLoadChooserDialog(int x, int y, int w, int h, const bool saveMode); + virtual ~SaveLoadChooserDialog(); virtual void open(); + virtual void close(); virtual void reflowLayout(); virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); +#if defined(USE_CLOUD) && defined(USE_LIBCURL) + virtual void runSaveSync(bool hasSavepathOverride); +#endif + + virtual void handleTickle(); + #ifndef DISABLE_SAVELOADCHOOSER_GRID virtual SaveLoadChooserType getType() const = 0; #endif // !DISABLE_SAVELOADCHOOSER_GRID @@ -70,6 +97,19 @@ public: protected: virtual int runIntern() = 0; + /** Common function to refresh the list on the screen. */ + virtual void updateSaveList(); + + /** + * Common function to get saves list from MetaEngine. + * + * It also checks whether there are some locked saves + * because of saves sync and adds such saves as locked + * slots. User sees these slots, but is unable to save + * or load from these. + */ + virtual void listSaves(); + const bool _saveMode; const MetaEngine *_metaEngine; bool _delSupport; @@ -78,6 +118,8 @@ protected: bool _saveDateSupport; bool _playTimeSupport; Common::String _target; + bool _dialogWasShown; + SaveStateList _saveList; #ifndef DISABLE_SAVELOADCHOOSER_GRID ButtonWidget *_listButton; @@ -106,6 +148,8 @@ public: virtual void open(); virtual void close(); +protected: + virtual void updateSaveList(); private: virtual int runIntern(); @@ -118,10 +162,8 @@ private: StaticTextWidget *_time; StaticTextWidget *_playtime; - SaveStateList _saveList; String _resultString; - void updateSaveList(); void updateSelection(bool redraw); }; @@ -164,13 +206,13 @@ public: protected: virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); virtual void handleMouseWheel(int x, int y, int direction); + virtual void updateSaveList(); private: virtual int runIntern(); uint _columns, _lines; uint _entriesPerPage; uint _curPage; - SaveStateList _saveList; ButtonWidget *_nextButton; ButtonWidget *_prevButton; |