diff options
author | Alexander Tkachev | 2016-06-09 12:41:51 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 4ff1ed5fe9ba86ccf5d7ad72dab8286c70ab7af3 (patch) | |
tree | d05cc848f163ff241c3ae333e14d1325cccd84f8 /backends/cloud | |
parent | 90ae7b7337ece337cfd6ed2eabcef4f42a3abe7a (diff) | |
download | scummvm-rg350-4ff1ed5fe9ba86ccf5d7ad72dab8286c70ab7af3.tar.gz scummvm-rg350-4ff1ed5fe9ba86ccf5d7ad72dab8286c70ab7af3.tar.bz2 scummvm-rg350-4ff1ed5fe9ba86ccf5d7ad72dab8286c70ab7af3.zip |
GUI: Add Cloud tab information labels
And corresponding stub implementations in CloudManager.
Diffstat (limited to 'backends/cloud')
-rw-r--r-- | backends/cloud/cloudmanager.cpp | 18 | ||||
-rw-r--r-- | backends/cloud/cloudmanager.h | 26 |
2 files changed, 43 insertions, 1 deletions
diff --git a/backends/cloud/cloudmanager.cpp b/backends/cloud/cloudmanager.cpp index a9baac5d02..cb7e6f7cb3 100644 --- a/backends/cloud/cloudmanager.cpp +++ b/backends/cloud/cloudmanager.cpp @@ -132,7 +132,7 @@ Common::StringArray CloudManager::listStorages() const { } bool CloudManager::switchStorage(uint32 index) { - if (index < 0 || index > _storages.size()) { + if (index >= _storages.size()) { warning("CloudManager::switchStorage: invalid index passed"); return false; } @@ -148,6 +148,22 @@ bool CloudManager::switchStorage(uint32 index) { return true; } +Common::String CloudManager::getStorageUsername(uint32 index) { + if (index >= _storages.size()) return ""; + return _storages[index]->name(); //TODO +} + +uint64 CloudManager::getStorageUsedSpace(uint32 index) { + if (index >= _storages.size()) return 0; + return 0; //return _storages[index]->usedSpace(); //TODO +} + +Common::String CloudManager::getStorageLastSync(uint32 index) { + if (index >= _storages.size()) return ""; + if (_storages[index]->isSyncing()) return ""; + return _storages[index]->name(); //->lastSyncDate(); //TODO +} + void CloudManager::printBool(Storage::BoolResponse response) const { debug("bool = %s", (response.value ? "true" : "false")); } diff --git a/backends/cloud/cloudmanager.h b/backends/cloud/cloudmanager.h index 7e8cfd68a3..9956a92824 100644 --- a/backends/cloud/cloudmanager.h +++ b/backends/cloud/cloudmanager.h @@ -104,6 +104,32 @@ public: bool switchStorage(uint32 index); /** + * Return username used by Storage. + * + * @param Storage's index. + * @returns username or "" if index is invalid (no such Storage). + */ + Common::String getStorageUsername(uint32 index); + + /** + * Return space used by Storage. + * + * @param Storage's index. + * @returns used space in bytes or 0 if index is invalid (no such Storage). + */ + uint64 getStorageUsedSpace(uint32 index); + + /** + * Return Storage's last sync date. + * + * @param Storage's index. + * @returns last sync date or "" if index is invalid (no such Storage). + It also returns "" if there never was any sync + or if storage is syncing right now. + */ + Common::String getStorageLastSync(uint32 index); + + /** * Starts saves syncing process in currently active storage if there is any. */ SavesSyncRequest *syncSaves(Cloud::Storage::BoolCallback callback = nullptr, Networking::ErrorCallback errorCallback = nullptr); |