aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/dropbox
diff options
context:
space:
mode:
authorAlexander Tkachev2019-07-18 23:10:49 +0700
committerMatan Bareket2019-07-30 14:51:41 -0400
commit99c2418d1a270c4496b21d6d6c8035b6ef73e8a1 (patch)
tree6670b93b28b24080a8ec40286cbf49804cdd91d9 /backends/cloud/dropbox
parent31628d642881499f7d6833732b096c028087e14e (diff)
downloadscummvm-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/dropbox')
-rw-r--r--backends/cloud/dropbox/dropboxstorage.cpp8
-rw-r--r--backends/cloud/dropbox/dropboxstorage.h7
2 files changed, 12 insertions, 3 deletions
diff --git a/backends/cloud/dropbox/dropboxstorage.cpp b/backends/cloud/dropbox/dropboxstorage.cpp
index c12dec9968..5d8b9e0425 100644
--- a/backends/cloud/dropbox/dropboxstorage.cpp
+++ b/backends/cloud/dropbox/dropboxstorage.cpp
@@ -42,8 +42,8 @@ namespace Dropbox {
DropboxStorage::DropboxStorage(Common::String accessToken, bool unused): BaseStorage(accessToken, "") {}
-DropboxStorage::DropboxStorage(Common::String code): BaseStorage() {
- getAccessToken(code);
+DropboxStorage::DropboxStorage(Common::String code, Networking::ErrorCallback cb): BaseStorage() {
+ getAccessToken(code, cb);
}
DropboxStorage::~DropboxStorage() {}
@@ -112,5 +112,9 @@ DropboxStorage *DropboxStorage::loadFromConfig(Common::String keyPrefix) {
return new DropboxStorage(accessToken, true);
}
+void DropboxStorage::removeFromConfig(Common::String keyPrefix) {
+ ConfMan.removeKey(keyPrefix + "access_token", ConfMan.kCloudDomain);
+}
+
} // End of namespace Dropbox
} // End of namespace Cloud
diff --git a/backends/cloud/dropbox/dropboxstorage.h b/backends/cloud/dropbox/dropboxstorage.h
index bca83d2b5a..0b76bb5c4a 100644
--- a/backends/cloud/dropbox/dropboxstorage.h
+++ b/backends/cloud/dropbox/dropboxstorage.h
@@ -51,7 +51,7 @@ protected:
public:
/** This constructor uses OAuth code flow to get tokens. */
- DropboxStorage(Common::String code);
+ DropboxStorage(Common::String code, Networking::ErrorCallback cb);
virtual ~DropboxStorage();
/**
@@ -98,6 +98,11 @@ public:
* @return pointer to the newly created DropboxStorage or 0 if some problem occured.
*/
static DropboxStorage *loadFromConfig(Common::String keyPrefix);
+
+ /**
+ * Remove all DropboxStorage-related data from config.
+ */
+ static void removeFromConfig(Common::String keyPrefix);
};
} // End of namespace Dropbox