Commit Graph

6038 Commits

Author SHA1 Message Date
Alexander Tkachev
ddb1a6ccb6 GUI: Upgrade DownloadDialog
It now shows the remote and local directories and a progress bar.

Storage now shows OSD messages on download success and failure.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
b8ee9d4e7d CLOUD: Add FolderDownload-related methods in Storage
CloudManager's shortcuts are added too.

The idea is to keep FolderDownload request within Storage, and provide
necessary means to access it. The download is started and cancelled
through the DownloadDialog.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
10250af251 CLOUD: Fix CloudManager's methods
Were not returning created Request.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
dc0a956172 CLOUD: Add CloudManager::downloadFolder() 2016-08-24 16:07:55 +06:00
Alexander Tkachev
a37c639986 CLOUD: Make Google Drive sort files list
GoogleDriveListDirectoryByIdRequest now uses "orderBy" field to specify
that we want the commonly used "alphabetical, folders first" order.

That's mostly needed for RemoteBrowserDialog, because Requests don't
care about the order, and this one is more user-friendly.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
acce1c89ab CLOUD: Fix saves sync
Tested that on actual unix system and found out a few minor bugs related
to paths.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
f3a392359b CLOUD: Fix finishSuccess() warning 2016-08-24 16:07:55 +06:00
Alexander Tkachev
fa3ea83165 CLOUD: Fix some warnings
Mostly on format string
2016-08-24 16:07:55 +06:00
Peter Bozsó
cff183536b CLOUD: Fix crash on exiting ScummVM while ConnMan is active 2016-08-24 16:07:55 +06:00
Alexander Tkachev
4c381dafa3 CLOUD: Delete the incomplete file (when downloading) 2016-08-24 16:07:55 +06:00
Alexander Tkachev
65e87c6c70 CLOUD: Update save's timestamp on rewrite
This commit moves save/load timestamps static methods into
DefaultSaveFileManager and fixes a few related bugs.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
aee713141b CLOUD: Make OutSaveFile start saves sync
It had to become a proxy class in order to do that.
finalize() starts the saves sync.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
81106b0444 CLOUD: Update local server's style.css 2016-08-24 16:07:55 +06:00
Alexander Tkachev
8484273f36 CLOUD: Fix "-Wcast-qual"
The passed buffer is not changed, so could be `const`.

You might see that `postFields.c_str()` is `buffer`. Yet, as it's
`postFields`, it's used for POST in curl_easy_setopt(), which copies the
passed buffer. When `buffer` is used for upload, it's an actual bytes
buffer, kept in CurlRequest.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
caa53d9f6c CLOUD: Fix "-Wconversion-null"
That `false` came from TranslationManager's function, which was
returning bool, not a pointer. Somehow missed that line.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
39eb76f8c2 CLOUD: Fix "zero-length format string" warning 2016-08-24 16:07:55 +06:00
Alexander Tkachev
04cef8928c CLOUD: Fix "type qualifiers ignored" warning 2016-08-24 16:07:55 +06:00
Alexander Tkachev
b908b286b9 CLOUD: Fix "signed/unsigned integers" warning
The "comparison between signed and unsigned integer expressions" one.

Note that in UploadRequests size() and pos() are acutally signed,
because they could return -1. This commit implies that Requests are
working with such Streams which doesn't.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
1addefad7e CLOUD: Use correct redirect_uris
Usage of #ifdef there (and in StorageWizardDialog) means that ScummVM
doesn't support both local webserver and scummvm.org paths at the same
time. It's either built with SDL_net (thus supporting localhost path) or
without it (thus using scummvm.org).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
6ac69729d5 CLOUD: Add some mutexes in LocalWebserver 2016-08-24 16:07:55 +06:00
Alexander Tkachev
5e70f64e10 CLOUD: Embed cloud icons as byte arrays 2016-08-24 16:07:55 +06:00
Alexander Tkachev
a56c7a3bd6 CLOUD: Update IndexPageHandler to search wwwroot.zip
Now it also searches for that in themepath, not with SearchMan only.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
c2c2ba908f GUI: Hide StorageWizardDialog fields if server present 2016-08-24 16:07:55 +06:00
Alexander Tkachev
5176eaba81 CLOUD: Add wwwroot
wwwroot.zip contains ScummVM local webserver's resources, such as
template html pages, styles and images.

One can make it from wwwroot directory contents by running
make_archive.py script.

It's added to scummvm.rc, so it's included in the executable (it works
with MinGW, but I was unable to do that in VS yet).

IndexPageHandler is the one who returns these resources. It uses
index.html for "/". I'm replacing "{message}" with translated message,
so that's the way I thought the templates should work.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
43071c0972 CLOUD: Update LocalWebserver
* fix handling connections;
* fix idling strategy;
* add setClientGetHandler() for SeekableReadStream;
* add determineMimeType().
2016-08-24 16:07:55 +06:00
Alexander Tkachev
0def9c50a7 CLOUD: Fix Client
Cleanup in open()
2016-08-24 16:07:55 +06:00
Alexander Tkachev
5ac3adbd4f CLOUD: Add IndexPageHandler
This commit also adds LocalWebserver's stopOnIdle().
That means server is not stopped immediately, but only when all clients
are served.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
733d998e6a CLOUD: Minor Client fix 2016-08-24 16:07:55 +06:00
Alexander Tkachev
3946f23d17 CLOUD: Prepare code for path handlers
LocalWebserver would storage the handlers.

Client now has methods like path() or query() to access different parts
of the request.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
892c1bf84c CLOUD: Add HTTP response codes in GetClientHandler 2016-08-24 16:07:55 +06:00
Alexander Tkachev
6e1b667dd6 CLOUD: Minor Client fix 2016-08-24 16:07:55 +06:00
Alexander Tkachev
13c54f6685 CLOUD: Add GetClientHandler
That ClientHandler is made for responding GET requests. It calculates
stream's length, it allows to specify response code and headers, it can
be used to transfer any ReadStream.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
99c51380fd CLOUD: Add ClientState::BAD_REQUEST 2016-08-24 16:07:55 +06:00
Alexander Tkachev
6126435b64 CLOUD: Add Networking::Client
Keeps current client's state
2016-08-24 16:07:55 +06:00
Alexander Tkachev
0af97e59bc CLOUD: Add LocalWebserver
Available as LocalServer singleton. It's being started and stopped by
StorageWizardDialog. It doesn't handle clients yet, though.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
9f7bea156a CLOUD: Init SDL_Net 2016-08-24 16:07:55 +06:00
Peter Bozsó
c1ffb09fb0 CLOUD: Fix configuration handling in CloudManager 2016-08-24 16:07:55 +06:00
Peter Bozsó
a8eebbe851 CLOUD: Get rid of CloudConfigHelper, use kCloudDomain where approriate 2016-08-24 16:07:55 +06:00
Alexander Tkachev
8a84263d2b CLOUD: Do saves sync on Storage connect 2016-08-24 16:07:55 +06:00
Alexander Tkachev
0aea8db7e1 CLOUD: Make Storage::savesSync() restart
If Storage::syncSaves() is called when sync is running, another sync
would be automatically scheduled in the end of the current one.

That could be helpful when we want to specify that we changed something
during sync (created new save slot, for example).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
ca0b58513d CLOUD: Add CloudConfigHelper to module.mk 2016-08-24 16:07:55 +06:00
Peter Bozsó
219e565c32 CLOUD: Introduce CloudConfigHelper 2016-08-24 16:07:55 +06:00
Peter Bozsó
bfc5cab9e8 CLOUD: Fix end of namespace comment in CloudManager 2016-08-24 16:07:55 +06:00
Peter Bozsó
fd6be018a3 CLOUD: Fix include in CloudManager 2016-08-24 16:07:55 +06:00
Peter Bozsó
fc3e7dec1a CLOUD: Introduce kStoragePrefix in CloudManager 2016-08-24 16:07:55 +06:00
Peter Bozsó
98788a5e7d CLOUD: Remove unnecessary blank lines in switch statement 2016-08-24 16:07:55 +06:00
Peter Bozsó
1403cf006c CLOUD: Make enum StorageIDs' name singular 2016-08-24 16:07:55 +06:00
Peter Bozsó
c068b74f30 CLOUD: Force handling of all StorageIDs values in CloudManager::getStorageConfigName() 2016-08-24 16:07:55 +06:00
Alexander Tkachev
dbafbf2569 CLOUD: Fix getAccessToken()
KEY and SECRET should now load before getAccessToken() uses them, so it
should work now.
2016-08-24 16:07:55 +06:00
Peter Bozsó
2a2beaebc5 Fix DropboxStorage::codeFlowComplete() 2016-08-24 16:07:55 +06:00