diff options
Diffstat (limited to 'gui/saveload-dialog.cpp')
-rw-r--r-- | gui/saveload-dialog.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp index 6d343c88ed..2f10182006 100644 --- a/gui/saveload-dialog.cpp +++ b/gui/saveload-dialog.cpp @@ -35,6 +35,7 @@ #include "gui/widgets/edittext.h" #include "graphics/scaler.h" +#include <common/savefile.h> namespace GUI { @@ -201,12 +202,9 @@ void SaveLoadChooserDialog::handleCommand(CommandSender *sender, uint32 cmd, uin //this dialog only gets these commands if the progress dialog was shown and user clicked "run in background" switch (cmd) { - case kSavesSyncProgressCmd: - //TODO: unlock that save which was downloaded - break; - + case kSavesSyncProgressCmd: case kSavesSyncEndedCmd: - //TODO: ? + updateSaveList(); break; } } @@ -237,6 +235,7 @@ void SaveLoadChooserDialog::handleTickle() { } CloudMan.setSyncTarget(this); _dialogWasShown = true; + updateSaveList(); } } Dialog::handleTickle(); @@ -259,6 +258,11 @@ void SaveLoadChooserDialog::reflowLayout() { Dialog::reflowLayout(); } +void SaveLoadChooserDialog::updateSaveList() { + Common::Array<Common::String> files = CloudMan.getSyncingFiles(); //returns empty array if not syncing + g_system->getSavefileManager()->updateSavefilesList(files); +} + #ifndef DISABLE_SAVELOADCHOOSER_GRID void SaveLoadChooserDialog::addChooserButtons() { if (_listButton) { @@ -570,6 +574,7 @@ void SaveLoadChooserSimple::close() { } void SaveLoadChooserSimple::updateSaveList() { + SaveLoadChooserDialog::updateSaveList(); _saveList = _metaEngine->listSaves(_target.c_str()); int curSlot = 0; @@ -631,6 +636,7 @@ void SaveLoadChooserSimple::updateSaveList() { } _list->setList(saveNames, &colors); + draw(); } // SaveLoadChooserGrid implementation @@ -726,6 +732,13 @@ void SaveLoadChooserGrid::handleMouseWheel(int x, int y, int direction) { } } +void SaveLoadChooserGrid::updateSaveList() { + SaveLoadChooserDialog::updateSaveList(); + _saveList = _metaEngine->listSaves(_target.c_str()); + updateSaves(); + draw(); +} + void SaveLoadChooserGrid::open() { SaveLoadChooserDialog::open(); |