mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 07:53:36 +00:00
CLOUD: Add SaveLoadCloudSyncProgress enum
It's common for Save/Load dialogs and SavesSyncRequest.
This commit is contained in:
parent
9eb4aad7fd
commit
6c5a8f34ea
@ -27,16 +27,12 @@
|
||||
#include "common/json.h"
|
||||
#include "common/savefile.h"
|
||||
#include "common/system.h"
|
||||
#include "gui/saveload-dialog.h"
|
||||
|
||||
namespace Cloud {
|
||||
|
||||
const char *SavesSyncRequest::TIMESTAMPS_FILENAME = "timestamps";
|
||||
|
||||
enum {
|
||||
kSavesSyncProgressCmd = 'SSPR',
|
||||
kSavesSyncEndedCmd = 'SSEN'
|
||||
};
|
||||
|
||||
SavesSyncRequest::SavesSyncRequest(Storage *storage, Storage::BoolCallback callback, Networking::ErrorCallback ecb):
|
||||
Request(nullptr, ecb), CommandSender(nullptr), _storage(storage), _boolCallback(callback),
|
||||
_workingRequest(nullptr), _ignoreCallback(false) {
|
||||
@ -209,7 +205,7 @@ void SavesSyncRequest::directoryCreatedErrorCallback(Networking::ErrorResponse e
|
||||
void SavesSyncRequest::downloadNextFile() {
|
||||
if (_filesToDownload.empty()) {
|
||||
_currentDownloadingFile = StorageFile("", 0, 0, false); //so getFilesToDownload() would return an empty array
|
||||
sendCommand(kSavesSyncEndedCmd, 0);
|
||||
sendCommand(GUI::kSavesSyncEndedCmd, 0);
|
||||
uploadNextFile();
|
||||
return;
|
||||
}
|
||||
@ -217,7 +213,7 @@ void SavesSyncRequest::downloadNextFile() {
|
||||
_currentDownloadingFile = _filesToDownload.back();
|
||||
_filesToDownload.pop_back();
|
||||
|
||||
sendCommand(kSavesSyncProgressCmd, (int)(getDownloadingProgress() * 100));
|
||||
sendCommand(GUI::kSavesSyncProgressCmd, (int)(getDownloadingProgress() * 100));
|
||||
|
||||
///////
|
||||
debug("downloading %s (%d %%)", _currentDownloadingFile.name().c_str(), (int)(getProgress() * 100));
|
||||
|
@ -40,9 +40,6 @@
|
||||
namespace GUI {
|
||||
|
||||
enum {
|
||||
kSavesSyncProgressCmd = 'SSPR',
|
||||
kSavesSyncEndedCmd = 'SSEN',
|
||||
|
||||
kCancelSyncCmd = 'PDCS',
|
||||
kBackgroundSyncCmd = 'PDBS'
|
||||
};
|
||||
@ -198,15 +195,8 @@ void SaveLoadChooserDialog::handleCommand(CommandSender *sender, uint32 cmd, uin
|
||||
#endif // !DISABLE_SAVELOADCHOOSER_GRID
|
||||
|
||||
if (cmd == kSavesSyncProgressCmd || cmd == kSavesSyncEndedCmd) {
|
||||
Cloud::SavesSyncRequest *request = (Cloud::SavesSyncRequest *)sender;
|
||||
|
||||
//this dialog only gets these commands if the progress dialog was shown and user clicked "run in background"
|
||||
switch (cmd) {
|
||||
case kSavesSyncProgressCmd:
|
||||
case kSavesSyncEndedCmd:
|
||||
updateSaveList();
|
||||
break;
|
||||
}
|
||||
return updateSaveList();
|
||||
}
|
||||
|
||||
return Dialog::handleCommand(sender, cmd, data);
|
||||
|
@ -30,6 +30,11 @@
|
||||
|
||||
namespace GUI {
|
||||
|
||||
enum SaveLoadCloudSyncProgress {
|
||||
kSavesSyncProgressCmd = 'SSPR',
|
||||
kSavesSyncEndedCmd = 'SSEN'
|
||||
};
|
||||
|
||||
class SaveLoadCloudSyncProgressDialog : public Dialog { //protected?
|
||||
StaticTextWidget *_label;
|
||||
bool _close;
|
||||
|
Loading…
x
Reference in New Issue
Block a user