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 /gui | |
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 'gui')
-rw-r--r-- | gui/options.cpp | 35 | ||||
-rw-r--r-- | gui/options.h | 7 | ||||
-rw-r--r-- | gui/themes/scummmodern/scummmodern_layout.stx | 24 |
3 files changed, 65 insertions, 1 deletions
diff --git a/gui/options.cpp b/gui/options.cpp index df457a89e8..b0a7968b2d 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -1273,6 +1273,17 @@ GlobalOptionsDialog::GlobalOptionsDialog() new ButtonWidget(tab, "GlobalOptions_Cloud.StorageButton", _("Storage:"), 0, kChooseStorageCmd); _curStorage = new StaticTextWidget(tab, "GlobalOptions_Cloud.CurStorage", CloudMan.getStorageName()); + + new StaticTextWidget(tab, "GlobalOptions_Cloud.StorageUsernameDesc", _("Username:"), _("Username used by this storage")); + _storageUsername = new StaticTextWidget(tab, "GlobalOptions_Cloud.StorageUsernameLabel", "<none>"); + + new StaticTextWidget(tab, "GlobalOptions_Cloud.StorageUsedSpaceDesc", _("Used space:"), _("Space used by ScummVM on this storage")); + _storageUsedSpace = new StaticTextWidget(tab, "GlobalOptions_Cloud.StorageUsedSpaceLabel", "0 bytes"); + + new StaticTextWidget(tab, "GlobalOptions_Cloud.StorageLastSyncDesc", _("Last sync time:"), _("When this storage did last saves sync")); + _storageLastSync = new StaticTextWidget(tab, "GlobalOptions_Cloud.StorageLastSyncLabel", "<never>"); + + setupCloudTab(); #endif // Activate the first tab @@ -1550,6 +1561,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3 if (CloudMan.switchStorage(storageIndex)) { _curStorage->setLabel(CloudMan.getStorageName()); //automatically saves in the config if switched successfully + setupCloudTab(); } else { bool anotherStorageIsWorking = CloudMan.isWorking(); Common::String message = _("Failed to change cloud storage!"); @@ -1621,4 +1633,27 @@ void GlobalOptionsDialog::reflowLayout() { OptionsDialog::reflowLayout(); } +#ifdef USE_CLOUD +void GlobalOptionsDialog::setupCloudTab() { + uint32 index = CloudMan.getStorageIndex(); + if (_storageUsername) { + Common::String username = CloudMan.getStorageUsername(index); + if (username == "") username = _("<none>"); + _storageUsername->setLabel(username); + } + if (_storageUsedSpace) { + uint64 usedSpace = CloudMan.getStorageUsedSpace(index); + _storageUsedSpace->setLabel(Common::String::format(_("%llu bytes"), usedSpace)); + } + if (_storageLastSync) { + Common::String sync = CloudMan.getStorageLastSync(index); + if (sync == "") { + if (CloudMan.isSyncing()) sync = _("<right now>"); + else sync = _("<never>"); + } + _storageLastSync->setLabel(sync); + } +} +#endif + } // End of namespace GUI diff --git a/gui/options.h b/gui/options.h index feb77859e8..228a415b92 100644 --- a/gui/options.h +++ b/gui/options.h @@ -244,9 +244,14 @@ protected: #ifdef USE_CLOUD // - // Misc controls + // Cloud controls // StaticTextWidget *_curStorage; + StaticTextWidget *_storageUsername; + StaticTextWidget *_storageUsedSpace; + StaticTextWidget *_storageLastSync; + + void setupCloudTab(); #endif }; diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx index 693be090e8..093eeba522 100644 --- a/gui/themes/scummmodern/scummmodern_layout.stx +++ b/gui/themes/scummmodern/scummmodern_layout.stx @@ -548,6 +548,30 @@ height = 'Globals.Line.Height' /> </layout> + <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'> + <widget name = 'StorageUsernameDesc' + type = 'OptionsLabel' + /> + <widget name = 'StorageUsernameLabel' + height = 'Globals.Line.Height' + /> + </layout> + <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'> + <widget name = 'StorageUsedSpaceDesc' + type = 'OptionsLabel' + /> + <widget name = 'StorageUsedSpaceLabel' + height = 'Globals.Line.Height' + /> + </layout> + <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'> + <widget name = 'StorageLastSyncDesc' + type = 'OptionsLabel' + /> + <widget name = 'StorageLastSyncLabel' + height = 'Globals.Line.Height' + /> + </layout> </layout> </dialog> |