Commit Graph
75519 Commits
Author SHA1 Message Date
Alexander Tkachev 052d8bf0ae GUI: Forbid using download directory in "Add Game" 2016-08-24 16:07:55 +06:00
Alexander Tkachev 458bfcec79 GUI: Fix DownloadDialog path creation
Was adding a path separator even when none is required.
2016-08-24 16:07:55 +06:00
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 71a326493b GUI: Initiate download in 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 d776b53971 GUI: Use RemoteBrowser's result in DownloadDialog
It now checks the selected local directory, and shows different
MessageDialogs to notify user of mistake or ambiguous situation.
2016-08-24 16:07:55 +06:00
Alexander Tkachev c32d6fa047 GUI: Add error message in RemoteBrowser
For the error callback case.
2016-08-24 16:07:55 +06:00
Alexander Tkachev 8972f28bc1 GUI: Add RemoteBrowser file list sorting
Because Dropbox has no means to specify files order.
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 6faf2c2617 GUI: Add RemoteBrowser parent directories remembering
No wait when "Go up" is pressed. These contents could be invalid,
though. In order to refresh contents, one has to go up one more time and
then get back inside (in root folder - just press "Go up" to refresh
it).
2016-08-24 16:07:55 +06:00
Alexander Tkachev 51a7232c73 GUI: Fix RemoteBrowser Request handling
Init with NULL, ignore callbacks, and such.
2016-08-24 16:07:55 +06:00
Alexander Tkachev 73bb2e20af GUI: Clean up in RemoteBrowser 2016-08-24 16:07:55 +06:00
Alexander Tkachev 4aa8e23ea2 GUI: Make RemoteBrowser show "Loading..." 2016-08-24 16:07:55 +06:00
Alexander Tkachev e388accda3 GUI: Fix "Go up"
OneDrive and Google Drive paths do not start with '/', so one was unable
to go up to root.
2016-08-24 16:07:55 +06:00
Alexander Tkachev 72b82bd2aa GUI: Add RemoteBrowserDialog
WIP. Tested with Dropbox.
2016-08-24 16:07:55 +06:00
Alexander Tkachev 97c0bbd238 GUI: Add DownloadDialog sketch 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óandAlexander Tkachev 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 2d3cfffa84 KYRA: Fix openSaveForWriting() to return OutSaveFile 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 ceb86a0dd8 CLOUD: Clarify calculatedChecksum's initial value 2016-08-24 16:07:55 +06:00
Peter BozsóandAlexander Tkachev 434b740f4d CLOUD: Remove a couple of unnecessary whitespaces 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