diff options
author | Alexander Tkachev | 2019-07-18 23:10:49 +0700 |
---|---|---|
committer | Matan Bareket | 2019-07-30 14:51:41 -0400 |
commit | 99c2418d1a270c4496b21d6d6c8035b6ef73e8a1 (patch) | |
tree | 6670b93b28b24080a8ec40286cbf49804cdd91d9 /backends/cloud/googledrive | |
parent | 31628d642881499f7d6833732b096c028087e14e (diff) | |
download | scummvm-rg350-99c2418d1a270c4496b21d6d6c8035b6ef73e8a1.tar.gz scummvm-rg350-99c2418d1a270c4496b21d6d6c8035b6ef73e8a1.tar.bz2 scummvm-rg350-99c2418d1a270c4496b21d6d6c8035b6ef73e8a1.zip |
GUI: Rewrite Cloud tab
- StorageWizardDialog is removed, along with bmps it was using;
- EditTextWidget now accepts custom font in constructor;
- ScrollContainer scrollbar now jumps to top when content height changes
so it's "overscrolled";
- IndexPageHandler now does not awaits for `code` GET-parameter, as
local webserver is no longer used to connect Storages;
- CloudManager and all corresponding Storages are updated to support
disconnecting and to notify about successful connection.
Diffstat (limited to 'backends/cloud/googledrive')
-rw-r--r-- | backends/cloud/googledrive/googledrivestorage.cpp | 9 | ||||
-rw-r--r-- | backends/cloud/googledrive/googledrivestorage.h | 7 |
2 files changed, 13 insertions, 3 deletions
diff --git a/backends/cloud/googledrive/googledrivestorage.cpp b/backends/cloud/googledrive/googledrivestorage.cpp index 67d157748a..a6e17e6ad3 100644 --- a/backends/cloud/googledrive/googledrivestorage.cpp +++ b/backends/cloud/googledrive/googledrivestorage.cpp @@ -46,8 +46,8 @@ namespace GoogleDrive { GoogleDriveStorage::GoogleDriveStorage(Common::String token, Common::String refreshToken): IdStorage(token, refreshToken) {} -GoogleDriveStorage::GoogleDriveStorage(Common::String code) { - getAccessToken(code); +GoogleDriveStorage::GoogleDriveStorage(Common::String code, Networking::ErrorCallback cb) { + getAccessToken(code, cb); } GoogleDriveStorage::~GoogleDriveStorage() {} @@ -231,6 +231,11 @@ GoogleDriveStorage *GoogleDriveStorage::loadFromConfig(Common::String keyPrefix) return new GoogleDriveStorage(accessToken, refreshToken); } +void GoogleDriveStorage::removeFromConfig(Common::String keyPrefix) { + ConfMan.removeKey(keyPrefix + "access_token", ConfMan.kCloudDomain); + ConfMan.removeKey(keyPrefix + "refresh_token", ConfMan.kCloudDomain); +} + Common::String GoogleDriveStorage::getRootDirectoryId() { return "root"; } diff --git a/backends/cloud/googledrive/googledrivestorage.h b/backends/cloud/googledrive/googledrivestorage.h index 21e027c4a7..db47e7cd3c 100644 --- a/backends/cloud/googledrive/googledrivestorage.h +++ b/backends/cloud/googledrive/googledrivestorage.h @@ -58,7 +58,7 @@ protected: public: /** This constructor uses OAuth code flow to get tokens. */ - GoogleDriveStorage(Common::String code); + GoogleDriveStorage(Common::String code, Networking::ErrorCallback cb); virtual ~GoogleDriveStorage(); /** @@ -106,6 +106,11 @@ public: */ static GoogleDriveStorage *loadFromConfig(Common::String keyPrefix); + /** + * Remove all GoogleDriveStorage-related data from config. + */ + static void removeFromConfig(Common::String keyPrefix); + virtual Common::String getRootDirectoryId(); Common::String accessToken() const { return _token; } |