Commit Graph

6481 Commits

Author SHA1 Message Date
Thierry Crozat
8906868ee0 CLOUD: Use OSDMessageQueue to post OSD messages from the cloud thread 2016-10-29 15:13:32 +01:00
Ferdinand Thiessen
6075f5d24d BACKENDS: timidity: Get rid of gethostbyname, use getaddrinfo. 2016-10-25 13:17:55 +02:00
lubomyr
55f37714ca ANDROIDSDL: default storage-sdcard directory location getting direct from libSDL wrapper 2016-10-23 14:07:15 +03:00
lubomyr
a0c2fca8e4 ANDROIDSDL: back button re-mapped to F13 keycode. F13 keycode assigned to call scummvm in-game menu. CONTROL key now can be uses with games 2016-10-23 14:00:25 +03:00
Ori Avtalion
5280632b51 SDL: Fix typos 2016-10-22 21:16:21 +03:00
Marcus Comstedt
cd6f1e3f24 DC: Add Dreamcast specific clean target 2016-10-22 13:46:58 +02:00
Thierry Crozat
2882424306 IOS: Add support for filtering feature 2016-10-21 22:27:26 +01:00
Thierry Crozat
4a9446490a IOS: Disable idle timer while an engine is running 2016-10-20 22:38:14 +01:00
Bastien Bouclet
c1070e6929 CLOUD: Don't error out when PNG support is not enabled 2016-10-20 19:21:56 +02:00
Ori Avtalion
fc85eb461d SDL: Fix typo in function name 2016-10-18 19:24:51 +03:00
Thierry Crozat
58b2d0b317 UPDATES: Give feedback on OS X when using the Check now button
Checking updates from the menu was giving feedback when no update was
found, but checking updates from the Check now button in the options was
only giving feedback if a new version was found. Now it also tell us when
ScummVM is up to date.
2016-10-18 00:55:07 +01:00
Eugene Sandulenko
e8b70a4686 ALL: Fix compilation with disabled cloud but enabled libcurl 2016-10-17 18:55:22 +02:00
Thierry Crozat
5151bd99dd Merge pull request #847 from criezy/sdl-filtering
Add graphics linear filtering feature
2016-10-16 18:42:40 +01:00
Eugene Sandulenko
9db3a38466 PSP: Added release building script 2016-10-16 14:49:59 +02:00
Thierry Crozat
aa39a6ce4b SURFACESDL: Improve toggling filtering on/off
We don't need to recreate the window when turning filtering on or off.
Only the texture needs to be recreated.
2016-10-13 01:46:27 +01:00
Thierry Crozat
fd77916f86 SURFACESDL: Add hotkey to enable/disable filtering 2016-10-13 01:46:26 +01:00
Thierry Crozat
529a7ca26c OPENGLSDL: Add hotkey to enable/disable filtering
Crtl-Alt-f now enables/disables filtering instead of changing the
graphics mode. Since there is only one graphics mode now, a hotkey
to change it is a bit useless.
2016-10-13 01:46:26 +01:00
Thierry Crozat
3a69898729 SURFACESDL: Add support for filtering feature when using SDL2
This implements the request from ticket #9573: SDL1/2: Different
rendering/filtering?
2016-10-13 01:45:01 +01:00
Thierry Crozat
c6ce1c8002 OPENGL: Add support for filtering feature
This replaces the two graphics modes "OpenGL (No filtering)" and
"OpenGL". Now there is a single "OpenGL" mode and filtering is
controlled by the kFeatureFilteringMode.
2016-10-13 01:45:01 +01:00
Thierry Crozat
d0b2770243 OPENGLSDL: Make some OSD messages translatable
Also change some OSD messages to be the same or similar to
messages used by the Surface SDL code.
2016-10-13 01:15:38 +01:00
Eugene Sandulenko
1c2ed0c094 ANDROIDSDL: Update port settings 2016-10-10 23:35:41 +02:00
Eugene Sandulenko
cb4ec21d13 GCW0: Fixed wording in the README 2016-10-09 16:14:13 +02:00
Eugene Sandulenko
42a023b81f GCW0: Mention that only 320x240 games are supported 2016-10-09 16:05:28 +02:00
Eugene Sandulenko
355c4fa646 JANITORIAL: Remove more trailing spaces 2016-10-09 15:02:02 +02:00
Bastien Bouclet
7941e5d530 SDL: Switch to full screen updates when the OSD is transparent
Previous releases also did full screen updates for transparent OSD messages.
There should be no performance regression with that regard.

Computing smaller update rects is non trivial, but should be looked into if
performance is an issue for OSD icons.

Fixes #9598
2016-10-03 07:31:18 +02:00
Tarek Soliman
a6d3b61d32 MAEMO: Update debian/changelog 2016-09-28 20:44:30 -05:00
Marcus Comstedt
efebb327d9 DC: Fix indentation 2016-09-28 16:11:08 +02:00
Marcus Comstedt
95ad63e992 DC: Ignore case for VM filenames 2016-09-27 13:06:15 +02:00
Marcus Comstedt
4aacc41fff DC: Implement atexit handling for plugins 2016-09-27 13:06:15 +02:00
Marcus Comstedt
9c235b3d6e DC: Update versions of dependencies in README
The new GCC and Newlib are required for correct atexit handling
in plugins.  The new Ronin is required to support the Newlib upgrade,
and also for custom filename handling on VM saves.
2016-09-27 13:06:15 +02:00
Eugene Sandulenko
53790e7497 RELEASE: This is 1.10.0git 2016-09-26 20:57:54 +02:00
Eugene Sandulenko
c73d66adb5 Merge pull request #834 from lubomyr/master
ANDROIDSDL: fixed switching to capital letter
2016-09-23 17:07:54 +02:00
lubomyr
a7ec02d887 ANDROIDSDL: fixed switching to capital letter 2016-09-21 14:09:00 +03:00
lubomyr
6ffc90412c SDL: mapKey changed as virtual function 2016-09-20 19:48:14 +03:00
Bastien Bouclet
5e133cdd34 OPENGL: Make sure the cloud icon is cleared immediatly after it is hidden 2016-09-18 17:55:09 +02:00
Bastien Bouclet
0f9583e4ca SDL: Make sure the cloud icon is cleared immediatly after it is hidden 2016-09-18 17:55:09 +02:00
Bastien Bouclet
75599a4c25 OPENGL: Remove multithread support from displayActivityIconOnOSD
It is no longer being called by another thread.
2016-09-18 17:55:09 +02:00
Bastien Bouclet
1a1a5b5f69 CLOUD: Change the cloud icon to be updated by the main thread
The cloud manager registers itself as an event source as a mean to be polled
periodically by the GUI or engine code. The periodical polling is used to
update the OSD icon indicating background sync activity.

Also move the cloud icon from ConnectionManager to CloudManager,
allowing to decouple icon handling from network connections updates.
2016-09-18 17:54:12 +02:00
Thierry Crozat
a87a702eb2 ALL: Homogeneize use of 'saved game' in messages 2016-09-18 16:40:34 +01:00
Eugene Sandulenko
e51dcbb153 Merge pull request #830 from lubomyr/master
ANDROIDSDL: set default gfx_mode to 2x
2016-09-18 17:39:22 +02:00
lubomyr
c325f813b9 ANDROIDSDL: set default gfx_mode to 2x 2016-09-18 14:06:49 +02:00
Thierry Crozat
c42dfbc496 BACKEND: When removing a save files also remove entry from timestamps file 2016-09-18 05:51:57 +01:00
Thierry Crozat
33d1c55866 BACKENDS: Ignore timestamps for inexistent files in DefaultSaveFileManager
This fixes a bug in the synchronisation of the save files to the cloud when
the timestamps file contains entries for files that do no longer exist. In such
a case the synchronisation would fail.
2016-09-18 05:31:29 +01:00
Thierry Crozat
1fd4dbfdce SDL: Ignore outdated SDL resize event in OpenGL mode
Those outdated resize events are sent from SDL_DestroyWindow when the
window is fullscreen and doesn't have the SDL_WINDOW_FULLSCREEN_DESKTOP
flag (thus Surface SDL is not affected). Switching resolutions in fullscreen, or
switching from fullscreen to windowed will therefore cause a resize event to
be received with the former fullscreen resolution after we have already setup
the window to use the new resolution. If we don't ignore this event we end up
with a texture size and a window size that are not consistent and for example
see only a part of the texture (if the old resolution is bigger than the new one.
2016-09-18 04:23:37 +01:00
Thierry Crozat
973df9d2fd CLOUD: Fix compilation for integer constant too large for 'long' type
Hopefully all ports we have support LL constants. Otherwise we will
have to find a different way to fix this.
2016-09-17 21:45:46 +01:00
lubomyr
cc945d6105 ANDROIDSDL: default config key browser_lastpath changed to '/storage' 2016-09-16 18:07:45 +02:00
Thierry Crozat
2d651fd0f4 OPENGL: Fix dereferencing null pointer in OpenGLGraphicsManager
This fixes a crash when calling displayActivityIconOnOSD with a
NULL icon, which is used to remove the current activity icon.
2016-09-13 22:58:13 +01:00
Bastien Bouclet
2f41b9fcfd BACKENDS: Provide an empty implementation for displayActivityIconOnOSD in BaseBackend 2016-09-13 22:23:53 +02:00
Bastien Bouclet
0802bbd8ee OSYSTEM: Remove the API allowing to draw to the OSD surface directly 2016-09-13 20:41:26 +02:00
Bastien Bouclet
9cbaad6140 SDL: Switch the OpenGL renderer to use small textures to draw the OSD 2016-09-13 20:41:26 +02:00
Bastien Bouclet
05bc82b622 SDL: Switch the surface renderer to use small surfaces for OSD drawing 2016-09-13 20:33:42 +02:00
Bastien Bouclet
4d68b93aba CLOUD: Switch to the new OSD API 2016-09-13 20:29:09 +02:00
Bastien Bouclet
521ba2cb8a OSYSTEM: Introduce a method allowing to draw a background activity icon 2016-09-13 20:25:13 +02:00
Bastien Bouclet
6234b93813 SDL: Add a fixme regarding the encoding of the string returned by getTextFromClipboard 2016-09-13 09:21:51 +02:00
Bastien Bouclet
9e502bf9aa SDL: Plug a memory leak in OSystem_SDL::getTextFromClipboard 2016-09-13 09:19:53 +02:00
Thierry Crozat
1f2a50bcd3 CLOUD: Move openUrl to OSystem 2016-09-10 01:12:42 +01:00
Thierry Crozat
fa5a5bf865 CLOUD: Move wwwroot archive to dists and script to devtools
Both the data used to generate the archive and the archive itself
were moved to dists/ instead of being in backends/.

The script was also improved to optionally take a path as a command
line argument to indicate where the wwwroot data are instead of
assuming they are in the working directory.

Finally a 'wwwroot' make target was also added to invoke the python script and generate the archive.
with the expected path to
2016-09-06 00:43:25 +01:00
Thierry Crozat
77357ff71a CLOUD: Fix looking for the wwwroot.zip archive
If the themepath was defined but the wwwroot.zip file was not in
that path, looking for it failed as it never reached the part of the
code using SearchMan to look for it.
2016-09-05 23:39:59 +01:00
Thierry Crozat
d853240eee CLOUD: Do not error out when loading icon if OSD format is not 2 or 4 Bpp
Graphics::TransparentSurface::convertTo() errors out when the destination
format is not 2 or 4 Bpp. But in the case of the cloud icon we can recover
from it. So just print a warning and don't close the application.
2016-09-05 21:59:34 +01:00
Thierry Crozat
a8cb3c8404 OPENGL: Implement getOSDFormat and copyRectToOSD 2016-09-05 21:40:45 +01:00
Thierry Crozat
65d3c15b01 OPENGL: Add missing USE_OSD defined checks around OSD code 2016-09-05 21:21:32 +01:00
Eugene Sandulenko
23e2a61d4e SDL: Move mouse in SDL2 only when window has focus. 2016-09-04 16:48:50 +02:00
Thierry Crozat
29535c0a55 SDL: Do not forbid time.h symbols when FORBIDDEN_SYMBOL_EXCEPTION_time_h is defined
This hopefully fixes a regression from 848c5c3.
2016-09-04 02:26:27 +01:00
Thierry Crozat
848c5c3f84 Merge pull request #810 from tsoliman/sdl2-macports
SDL: Fix build with MacPorts SDL2
2016-09-03 23:08:04 +01:00
Thierry Crozat
a2a985368c BUILD: Tie the SDL_net version to the SDL version
This means that when using SDL 1.2 we use SDL_net 1.2, but when
using SDL 2 we now use SLD_net 2 as well. Both versions work
properly and there is not code change needed in ScummVM.

This change is because SDL_net depends on SDL, and using
SDL_net 1.2 with SDL 2 means we can end up needing to link with
both the SDL and SDL2 libraries.
2016-09-03 23:07:21 +01:00
Eugene Sandulenko
8e8199f6af LINUXMOTO: Fix OSD performance when OSD is not drawn 2016-09-03 21:30:55 +02:00
Eugene Sandulenko
57ae1cb89d GPH: Fix OSD performance when OSD is not drawn 2016-09-03 21:30:40 +02:00
Eugene Sandulenko
c2f5c48068 DINGUX: Fix OSD performance when OSD is not drawn 2016-09-03 21:30:04 +02:00
Eugene Sandulenko
b8ee5322f4 JANITORIAL: Remove trailing whitespaces 2016-09-03 21:20:16 +02:00
Eugene Sandulenko
7910123446 SDL: Optimize OSD drawing 2016-09-03 21:20:02 +02:00
Eugene Sandulenko
fab199d37e JANITORIAL: Make GPL headers uniform 2016-09-03 12:46:38 +02:00
Eugene Sandulenko
e93b52416f LINUXMOTO: Adapt to OSD changes 2016-09-03 10:18:47 +02:00
Eugene Sandulenko
58096d909f GPH: Fix formatting 2016-09-03 10:18:47 +02:00
Eugene Sandulenko
2fa97f20e8 DINGUX: Adapt to new OSD changes 2016-09-03 10:18:47 +02:00
Bastien Bouclet
25bf68c39a BACKENDS: Remove extra line returns in warnings 2016-09-03 07:14:16 +02:00
Eugene Sandulenko
2d39f75b7d GPH: Attempt to fix OSD 2016-09-02 23:57:13 +02:00
Alexander Tkachev
489489b127 PS2: Fix Ps2SaveFileManager
* updateSavefilesList() stub;
* openRawFile();
* Common::OutSaveFile in openForLoading().
2016-08-31 14:12:45 +06:00
Alexander Tkachev
ac93dd99fe DC: Add RoninCDFileNode::create()
Returns false, as we don't create files/directories on CD.
2016-08-31 13:46:43 +06:00
Alexander Tkachev
a6bcd207fc DC: Fix VMSaveManager
* updateSavefilesList() stub;
* openRawFile();
* Common::OutSaveFile in openForSaving();
* OutVMSave derived from WriteStream.
2016-08-31 13:39:09 +06:00
Alexander Tkachev
7f913c831d DS, N64: Fix openForSaving()
Fails to build because OutSaveFile's name should've been qualified.
2016-08-31 12:38:40 +06:00
Alexander Tkachev
9d6ae2a33f DS, N64: Fix SaveFileManagers
Added updateSavefilesList() and openRawFile() stubs. It should build
fine now, I guess.
2016-08-31 12:33:57 +06:00
Alexander Tkachev
153f06b324 N64: Fix OutSaveFile error
OutSaveFile was just a typedef of WriteStream once, but now it's not.
These Out*Save classes are then wrapped with OutSaveFile, so it should
be OK to derive them from WriteStream instead of OutSaveFile.
2016-08-31 12:07:53 +06:00
Thierry Crozat
f490fb811a OSX: Implement clipboard support
There was already an implementation using SDL2 in the SDL backend,
but this way we have it available also when using the SDL 1.
2016-08-30 21:37:34 +01:00
Willem Jan Palenstijn
fb592a0dbd BACKENDS: Rename variable shadowing function 2016-08-30 21:53:21 +02:00
Willem Jan Palenstijn
d60879b535 SDL: Fix const cast 2016-08-30 21:52:27 +02:00
Eugene Sandulenko
6a081212f1 CLOUD: Fix Windows cross-compilation 2016-08-30 21:29:22 +02:00
Bastien Bouclet
b00cb955d9 BACKENDS: Use open instead of creat to create files
creat is not defined on the PS3. Also close the file descriptor.
2016-08-30 21:19:59 +02:00
Alexander Tkachev
6b0766dc92 Merge branch 'master' of https://github.com/scummvm/scummvm 2016-08-30 21:08:06 +06:00
Alexander Tkachev
f8fe150130 CLOUD: Fix Webserver's usage of DefaultSaveFileManager
concatWithSavesPath() is only defined when curl is used, but was used in
Webserver even when curl is unavailable.
2016-08-30 21:08:02 +06:00
Eugene Sandulenko
111dc18ef3 Merge pull request #433 from klusark/assets
ANDROID: Update the asset archive code to use AAssets
2016-08-30 15:14:12 +02:00
Eugene Sandulenko
bfbfbd3e1a Merge pull request #788 from Tkachov/cloud
ALL: Add Cloud storage support
2016-08-30 13:54:12 +02:00
Eugene Sandulenko
f9f55d1af3 ANDROIDSDL: Fix menu button 2016-08-29 19:37:25 +02:00
Alexander Tkachev
368f664c81 COMMON: Fix WriteStream::pos() once again
MemoryReadWriteStream now returns int32, not uint32. It actually doesn't
ever return -1 to indicate that an error occured, so uint32 was a better
choice, but that's what is used in WriteStream base class now.

That method is abstract, so that's also why OutSaveFile had to override
it.
2016-08-24 16:24:16 +06:00
Peter Bozsó
02a997e468 CLOUD: Remove unused includes 2016-08-24 16:07:55 +06:00
Alexander Tkachev
97cf2be7ef CLOUD: Update LocalWebserver
Reader now reads headers into stream, and some checks are added there
and in UploadFileClientHandler, so if headers are too long, they are
treated as bad request.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
dc02a789b6 CLOUD: Use forbidden combinations
I accidentally tried "folder../" instead "folder/../" and understood
that I made "folder../" forbidden too, though it's a valid folder name.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
8a1cca896e CLOUD: Update handlers
Now if there is no "rootpath" specified, it's not even listed by
FilesPageHandler and ListAjaxHandler. And, of course, not available to
use anywhere else.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
acfa1d1f10 CLOUD: Handle paths in marked places
Paths containing '../' are forbidden to use in Files Manager. There is
also a special inner black list of paths which are not used and a check
that specified path is under "savepath" or "rootpath" (from "cloud"
domain).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
dd9e5a95dc CLOUD: Mark places where path handling is needed 2016-08-24 16:07:55 +06:00
Alexander Tkachev
126fe9c845 CLOUD: Add "minimal mode" in LocalWebserver
StorageWizardDialog now runs LocalWebserver in "minimal mode" for
security reasons. In this mode server uses only those handlers which
state to support it.

There are two handlers which support minimal mode: IndexPageHandler
(which handles `code` requests needed by StorageWizardDialog) and
ResourceHandler (which provides inner resources like `style.css` or
`logo.png` from `wwwroot.zip` archive).
2016-08-24 16:07:55 +06:00
Peter Bozsó
a1de322c18 CLOUD: Use overriden handle() instead of ClientHandlerCallback in page handlers
Using a dedicated callback object for this was an unnecessary overhead.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
712410496e CLOUD: Fix UploadFileClientHandler
It now redirects user on success not only when file was the last field
in the content, but also when it was uploaded already and Handler worked
further to search for more files.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
4f0c071e53 CLOUD: Add custom User-Agent
Full version is used like in Eugene's Google Analytics stub. Plus, on
PS3 that string contains "PlayStation", and that would be cool to know
that ScummVM+libcurl+PS3 work together.
2016-08-24 16:07:55 +06:00
Eugene Sandulenko
0558ba423c CLOUD: Fix warnings 2016-08-24 16:07:55 +06:00
Peter Bozsó
64b361b335 CLOUD: Move determineMimeType to ResourceHandler 2016-08-24 16:07:55 +06:00
Peter Bozsó
b68bd78b44 CLOUD: Remove unused removePathHandler(), make addPathHandler() private 2016-08-24 16:07:55 +06:00
Alexander Tkachev
37859a9203 CLOUD: Fix Requests
Remove unnecessary JSON warnings, fix a few places.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
bb529e6fd0 CLOUD: Update SavesSyncRequest
Add JSON checks in the callback.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
d5aca1f4fa CLOUD: Update OneDriveUploadRequest
More JSON checks.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
fc8e29d583 CLOUD: Update OneDrive
Added JSON checks.

New jsonContainsObject() method added to CurlJsonRequest.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
d34b9b91ad CLOUD: Update GoogleDriveUploadRequest
JSON checks in callback.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
a381e06fda CLOUD: Update GoogleDriveStorage
More JSON checks in callbacks.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
b3aa9f663f CLOUD: Update DropboxUploadRequest
JSON checks.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
364c74df93 CLOUD: Update DropboxStorage
JSON checks added.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
6be736b5ed CLOUD: Update Dropbox Requests
Adding more JSON checks there.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
a2e0199727 CLOUD: Update BoxUploadRequest
More JSON checks there.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
166d1121e5 CLOUD: Update TokenRefreshers
Box's, Google Drive's and OneDrive's token refreshing requests have more
JSON checks now.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
9d96d40b3d CLOUD: Add JSON-related checks in BoxStorage 2016-08-24 16:07:55 +06:00
Alexander Tkachev
2c34864a06 CLOUD: Fix UploadFileClientHandler
A few possible memory leaks about `_contentStream` there.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
46dda5fce0 CLOUD: Update NetworkReadStream
It now uses both CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION.
The latter is available in new libcurl (>= 7.32.0) only, thus the former
is added for older versions support.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
0b97aff866 CLOUD: Minor TODO fix 2016-08-24 16:07:55 +06:00
Alexander Tkachev
6dd10f3a68 CLOUD: Add KEY/SECRET override code
The following constants must be defined if ENABLE_RELEASE is:
* RELEASE_DROPBOX_KEY,
* RELEASE_DROPBOX_SECRET,
* RELEASE_ONEDRIVE_KEY,
* RELEASE_ONEDRIVE_SECRET,
* RELEASE_GOOGLE_DRIVE_KEY,
* RELEASE_GOOGLE_DRIVE_SECRET,
* RELEASE_BOX_KEY,
* RELEASE_BOX_SECRET.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
b9bba9bd4b ALL: Move Clipboard support to OSystem
Commit adds kFeatureClipboardSupport. hasTextInClipboard() and
getTextFromClipboard().

OSystem_SDL has this feature if SDL2 is used.

EditableWidget and StorageWizardDialog use g_system to access clipboard
now.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
15c6772ff7 ALL: Fix debug, warning and error usage
Added prefixes, used debug(9).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
d57e0c89b5 CLOUD: #define all OAuth2/API-related URLs 2016-08-24 16:07:55 +06:00
Alexander Tkachev
f3959e1401 CLOUD: Upload ListDirectory Requests
Lots of checks to avoid JSON-related segfaults added.
2016-08-24 16:07:55 +06:00
Eugene Sandulenko
f95073f008 CLOUD: JANITORIAL: More whitespace fixes 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
eb268cd14f CLOUD: Fix warning 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
d57fca4665 CLOUD: JANITORIAL: Fix code formatting 2016-08-24 16:07:55 +06:00
Alexander Tkachev
cccfe7c247 CLOUD: Update BoxListDirectoryByIdRequest
It now uses special CurlJsonRequest static methods to check whether JSON
is an object, has a string or integer parameter.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
43c940c985 CLOUD: Updated BoxListDirectoryByIdRequest
It now checks for all keys in JSON to avoid segfaults and prints
warnings if passed keys are missing or have wrong types.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
7c9912e3d8 CLOUD: Fix IndexPageHandler warning 2016-08-24 16:07:55 +06:00
Eugene Sandulenko
876b8616af CLOUD: Fix format warning 2016-08-24 16:07:55 +06:00
Alexander Tkachev
758f46ddf0 CLOUD: Fix FolderDownloadRequest TODO 2016-08-24 16:07:55 +06:00
Alexander Tkachev
a30d0d1994 CLOUD: Update DownloadRequest's TODO
We need a way to reopen DumpFile if we want DownloadRequest to support
restarting.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
5f9beb76cd CLOUD: Fix HTTP response code TODOs 2016-08-24 16:07:55 +06:00
Alexander Tkachev
bd8f2ed825 CLOUD: Fix some TODOs in CloudManager
"No Storage connected!" error message is passed to the error callback
now when there is no Storage connected to the CloudManager.
2016-08-24 16:07:55 +06:00
Peter Bozsó
8c62993769 CLOUD: Remove remove() from BoxStorage 2016-08-24 16:07:55 +06:00
Alexander Tkachev
efebb5b90d CLOUD: Remove DropboxStorage::remove() 2016-08-24 16:07:55 +06:00
Peter Bozsó
9254df2d96 CLOUD: Fix code formatting 2016-08-24 16:07:55 +06:00
Alexander Tkachev
772d8ee42b CLOUD: Fix redirect_uri selection code
Now it's not hardcoded based on USE_SDL_NET, but one or another value is
used depending on currently selected LocalWebserver's port.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
438ba985a4 JANITORIAL: Remove spaces at the end of the line
I knew there were some, but I wanted to fix them once, instead of doing
it all the time.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
01161ae7dd CLOUD: Do some refactoring/cleanup in Networking 2016-08-24 16:07:55 +06:00
Alexander Tkachev
b180c73675 CLOUD: Do some refactoring/cleanup
Nothing really major.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
a449ddce15 CLOUD: Fix Cppcheck warnings 2016-08-24 16:07:55 +06:00
Alexander Tkachev
85f4c69fc9 CLOUD: Update StorageWizardDialog
It now hides code fields not just when built with SDL_Net, but also when
LocalWebserver's using default port.

So that's why NETWORKING_LOCALWEBSERVER_ENABLE_PORT_OVERRIDE is defined
in localwebserver.h now.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
39865e6e6c CLOUD: Add port override for LocalWebserver
It's enabled only when NETWORKING_LOCALWEBSERVER_ENABLE_PORT_OVERRIDE is
defined.

It's not defined, because override means we have to reconfigure our
redirect links somehow to use the override port.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
b1264df120 CLOUD: Check whether Storage is working when replacing it
We do that in CloudManager::replaceStorage(), but I've tried to
eliminate such possibility by adding a check in the StorageWizardDialog.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
f743b31963 CLOUD: Fix CloudManager::connectStorage() memory leak 2016-08-24 16:07:55 +06:00
Alexander Tkachev
0200694dd0 CLOUD: Fix backends/module.mk
MinGW failed to compile with the latest fix.

Checked this fix with create_project for MSVC, MinGW's make, make under
kubuntu and while building Android apk.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
e833c8f65c CLOUD: Add OSD warning when can't start LocalWebserver 2016-08-24 16:07:55 +06:00
Alexander Tkachev
1d78d20fcf CLOUD: Fix Dropbox and Google Drive UploadRequests
Possible segfault there too.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
ab0f2d1a03 CLOUD: Fix OneDriveUploadRequest
Segfault when given stream is nullptr.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
6753c18d6f CLOUD: Add default SavesSync callbacks
With OSD messages indicating whether saves sync is complete, cancelled
or failed.
2016-08-24 16:07:55 +06:00
Peter Bozsó
8e9d106658 CLOUD: Fix makefile 2016-08-24 16:07:55 +06:00
Alexander Tkachev
a13e03e988 CLOUD: Add Networking::Connection::isLimited()
`false` everywhere by default, but works on Android (`true` if not
Wi-Fi).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
0c1c274abd CLOUD: Fix OneDriveUploadRequest
OneDrive doesn't accept empty files, so UploadRequest just skips such.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
d0c54cdd64 CLOUD: Fix DropboxCreateDirectoryRequest
It now calls success callback with `false` on Dropbox's
"path/conflict/folder", indicating that the directory already exists.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
55568d757c CLOUD: Move Dropbox to API v2
We had a few places where their deprecated API v1 was used.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
36b381e411 CLOUD: Make "/create" support AJAX
Now creating directories doesn't refresh the "/filesAJAX" page.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
da229dd84c CLOUD: Add "ajax" parameter for "/create" and "/upload"
If it's set, these redirect to "/filesAJAX" instead of "/files".
2016-08-24 16:07:55 +06:00
Alexander Tkachev
e6caa482e1 CLOUD: Add messages in "/filesAJAX" 2016-08-24 16:07:55 +06:00
Alexander Tkachev
cd6d45ecf8 CLOUD: Minor "/filesAJAX" fix 2016-08-24 16:07:55 +06:00
Alexander Tkachev
6442dad710 CLOUD: Add "breadcrumbs" in "/filesAJAX" 2016-08-24 16:07:55 +06:00
Alexander Tkachev
09ae2f7593 CLOUD: Add "/filesAJAX" sketch
It works already, but still requires some polishing.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
5163fb4e02 CLOUD: Add ListAjaxHandler
"/list" now returns JSON with directory information. Would be used in
AJAX-based Files Manager.
2016-08-24 16:07:55 +06:00
Peter Bozsó
b616cc3d57 CLOUD: Fix indentation in openurl-osx.cpp 2016-08-24 16:07:55 +06:00
Peter Bozsó
18fc113aa9 CLOUD: Add URL opening for OS X 2016-08-24 16:07:55 +06:00
Alexander Tkachev
6c0f491c4f CLOUD: Add "Index of" label in server's "/files" 2016-08-24 16:07:55 +06:00
Alexander Tkachev
ded8cdf0a0 CLOUD: Add openurl-android.cpp 2016-08-24 16:07:55 +06:00
Alexander Tkachev
06ccfd4b9a CLOUD: Add icons in "/files" list 2016-08-24 16:07:55 +06:00
Alexander Tkachev
626d85ea49 CLOUD: Fix module.mk for openurl-default.o
It's now added to all the backends manually.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
1b56f59add GUI: Update DownloadDialog
It now has download size and speed labels.

Commit also fixes minor mistake in ConnMan.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
c431ae6d84 CLOUD: Calculate FolderDownload download speed 2016-08-24 16:07:55 +06:00
Alexander Tkachev
85adefdb86 CLOUD: Update FolderDownloadRequest::getProgress()
It now is based on downloaded size, not number of files.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
479c76bbd2 CLOUD: Fix IdDownloadRequest
Wrong value was returned in getProgress() on nullptr there.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
0ca7917093 CLOUD: Update FolderDownloadRequest
It now keeps track of downloaded bytes.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
ca33c0a0a8 CLOUD: Fix FolderDownloadRequest
It now sends kDownloadEndedCmd on success without waiting to be
destructed.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
d863dad055 CLOUD: Fix FolderDownloadRequest::getProgress()
Now it doesn't stop on 100 % on last file and it ignores the
directories, so it doesn't "jump" suddenly as there are no directories
to skip.
2016-08-24 16:07:55 +06:00
Peter Bozsó
7951a2ea16 CLOUD: Rename _files to _pendingFiles in FolderDownloadRequest 2016-08-24 16:07:55 +06:00
Alexander Tkachev
d8a43cf290 CLOUD: Add openUrl() for POSIX 2016-08-24 16:07:55 +06:00
Alexander Tkachev
990dee3c4f CLOUD: Add Networking::Browser::openUrl() sketch
Only Windows' shellExecute() now.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
dfd68306de CLOUD: Upgrade FolderDownloadRequest::getProgress()
Now NetworkReadStream, which is used in DownloadRequest, which is used
in FolderDownloadRequest, returns progress information provided by
libcurl.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
e25338ec24 CLOUD: Update CurlJsonRequest
Uses dynamically allocated buffer now.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
1a53dccf51 CLOUD: Update DownloadRequest
It now uses a dynamically allocated 1 MB buffer.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
b4e9e35e07 CLOUD: Cleanup in Storages 2016-08-24 16:07:55 +06:00
Alexander Tkachev
0b5bd18d85 CLOUD: Update GoogleDriveStorage
It now derives from IdStorage, so lots of GoogleDrive*Request classes
are removed and replaced with generic IdStorage*Request ones.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
5cbb3e8705 CLOUD: Add Storage::uploadStreamSupported()
Box uses POST multipart/form requests for uploading. Such requests could
be sent with libcurl if we either have a file available or a buffer with
this file's contents.

SavesSyncRequest was using Storage::upload(ReadStream *), which couldn't
be implemented in BoxStorage. Thus I've added a method to test whether
such upload is supported and, if it's not, SavesSyncRequest uses the
other.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
d96cdacb38 CLOUD: Add BoxUploadRequest 2016-08-24 16:07:55 +06:00
Alexander Tkachev
db72fa34d6 CLOUD: Update NetworkReadStream and CurlRequest
Now those support POST multipart/form upload.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
16ed625dfe CLOUD: Remove BoxStorage::streamFileById debug() call 2016-08-24 16:07:55 +06:00
Alexander Tkachev
19ae61dffc CLOUD: Add IdDownloadRequest and IdStreamFileRequest
Used for downloading files in Box.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
34ee1d29d5 CLOUD: Fix Storage::streamFile() 2016-08-24 16:07:55 +06:00
Alexander Tkachev
d943d7c3a8 CLOUD: Add IdCreateDirectoryRequest
Box gets createDirectoryWithParentId(), so now creating directories
works there.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
2b3caf1efa CLOUD: Add IdStorage
This is a special base class for Storages which are using ids instead of
paths in their APIs, like Box or Google Drive.

This commit makes Box derived from IdStorage.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
e0a6b2135d CLOUD: Add BoxListDirectoryRequest
And used in it BoxResolveIdRequest.

TODO: make some generic ResolveIdRequest and ListDirectoryRequest for
id-based storages. It's really similar, I just had to change a few
details in GoogleDrive ListDirectory and ResolveId requests.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
eb269e137f CLOUD: Add BoxListDirectoryByIdRequest
Similarly to Google Drive, Box uses only ids of files. That means id
resolving would be slow.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
85f1ce8ece CLOUD: Add BoxTokenRefresher and BoxStorage::info()
BoxTokenRefresher does refresh if HTTP 401 is returned by the server.

To test refresher, BoxStorage::info() was added.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
0a43dad629 CLOUD: Redirect to "/files" from "/"
"/" is used to receive "?code", but when there is no such parameter
passed, it's safe to redirect user to the "/files".
2016-08-24 16:07:55 +06:00
Alexander Tkachev
b37b392fa0 CLOUD: Add BoxStorage sketch 2016-08-24 16:07:55 +06:00
Alexander Tkachev
5c60cd14c2 CLOUD: Add LocalWebserver::resolveAddress()
Works on Linux too. And, well, I'm bad in adding backends, so it's just
#ifdefed there.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
389c669a47 CLOUD: Add "directory" form for webserver "/upload"
The attribute is Chrome-only.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
29e6020574 CLOUD: Update "/files" hardcoded response template 2016-08-24 16:07:55 +06:00
Alexander Tkachev
3064b44b92 CLOUD: Switch to "multiple" files uploading
Still doesn't support directories uploading.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
12518ed0bf CLOUD: Fix gradient on LocalWebserver's pages
It was starting over every 100vh (each screen).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
35b2471290 CLOUD: Fix '\' encoding back 2016-08-24 16:07:55 +06:00
Alexander Tkachev
30430b379f CLOUD: Fix Client's buffer 2016-08-24 16:07:55 +06:00
Alexander Tkachev
36b0069e95 CLOUD: Cleanup in Handlers
Simplified some stuff here and there by using HandlerUtils static
methods.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
f1830645d0 CLOUD: Cleanup in LocalWebserver 2016-08-24 16:07:55 +06:00
Alexander Tkachev
34dd84f429 CLOUD: More cleanup in Client 2016-08-24 16:07:55 +06:00
Alexander Tkachev
d1b5a64020 CLOUD: Cleanup in Reader and Client 2016-08-24 16:07:55 +06:00
Alexander Tkachev
7fcdcc10cb CLOUD: Cleanup in UploadFileClientHandler
Adds Client::noMoreContent() and Reader::noMoreContent(), which return
true when whole client's request was read.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
abae5c4371 CLOUD: Cleanup in UploadFileHandler 2016-08-24 16:07:55 +06:00
Alexander Tkachev
e4bb7c4e75 CLOUD: Add UploadFileClientHandler
Now Client reads the first headers block, then LocalWebserver decides
which Handler to use. In case of "/upload", UploadFileHandler is used.

But now it only knows the "path" parameter. If that's valid, actual
UploadFileClientHandler is created, which reads the contents of the
request and, when finds there  an "upload_file" field, starts saving it
in the directory specified by "path".

With that we don't need temp files approach from Reader class.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
a424ebbc28 CLOUD: Fix quotes encoding 2016-08-24 16:07:55 +06:00
Alexander Tkachev
eaa5fb1759 CLOUD: Put "/upload" "path" parameter in the URL 2016-08-24 16:07:55 +06:00
Alexander Tkachev
f0fc18d2ee CLOUD: Add UploadFileHandler 2016-08-24 16:07:55 +06:00
Alexander Tkachev
f3ee9e3272 CLOUD: Fix minor Reader-related bugs 2016-08-24 16:07:55 +06:00
Alexander Tkachev
b69cc3effb CLOUD: Update Reader to delete temp files 2016-08-24 16:07:55 +06:00
Alexander Tkachev
bca05b2720 CLOUD: Save files fields into temp files
Instead of keeping them in memory. Temp file name is generated to point
into ScummVM's working directory. That means that if user wanted to
upload file to the place with sufficient size, it would instead be
uploaded to ScummVM's working directory. Yet it's too early to parse the
target directory, so there is no way to generate temp file name within
that directory.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
80cc3469e7 CLOUD: Add Reader::readOneByteInStream() 2016-08-24 16:07:55 +06:00
Alexander Tkachev
83957c9666 CLOUD: Determine file's name in POST 2016-08-24 16:07:55 +06:00
Alexander Tkachev
c82ed40fdd CLOUD: Move method/path/etc info in Reader
Query parameters are now parsed once and then just searched in the
HashMap.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
f91bb39192 CLOUD: Use Reader in Client
Instead of copy-pasting it I'm just "integrating" it in.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
589b4cd457 CLOUD: Use "multipart/form-data" in upload form 2016-08-24 16:07:55 +06:00
Alexander Tkachev
bb67b81d04 CLOUD: Update Reader to support pausing
That means that if current buffer is over, reader will stop reading and
it's safe to call readResponse() again, so it would continue from the
place it left.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
79b39bf0d0 CLOUD: Add Reader sketch
That should be part of the Client, I guess. Reader is not ready to
continue reading from place it stopped, but it already works as it
should for the case when whole content is available.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
4d88f51de9 CLOUD: Add query parameters URL encoding
In local webserver's links.

Fixed URL decoding to understand '+', by the way. Firefox sends these
instead of spaces and "%2B" instead of '+'.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
89a1a54982 CLOUD: Update GetClientHandler's buffer
It's not static now and it's increased to 1 MB.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
b40bfaa046 CLOUD: Add "/download" handler
Now one can download files from the device through browser!
2016-08-24 16:07:55 +06:00
Alexander Tkachev
8a9d126152 CLOUD: Move "/create" to separate Handler
It does redirect to "/files" on success, so user doesn't even see the
strange "/create" URL at all.

This commit is for keeping these handlers small, not making one
(FilesPageHandler in this case) do everything.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
ab4361a76b CLOUD: Make "/create" work
One can now create directories through browser.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
48e3fff6bc CLOUD: Refactor LocalWebserver
Its handlers are now more compact. This commit moves Handler classes in
handlers\ directory.

ResourceHandler ignores "hidden" files in the archive, and these are
used as markup templates in IndexPageHandler and FilesPageHandler.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
627bda9d82 COMMON: Add replace(String, String, String)
Searches for a substring in the string and replaces it with the other
string.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
e47b6c04b3 CLOUD: Make "/files" list directories
Including both virtual "/root" and "/saves" ones.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
c409d29f66 CLOUD: Add "/files" handler
Shows the page with controls, but doesn't actually list the directories,
create the specified ones or allows to upload files yet.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
eae57728d1 CLOUD: Resolve local machine's IP 2016-08-24 16:07:55 +06:00
Alexander Tkachev
e601c39802 CLOUD: Make "Run server" button active
It should show the real server's IP over there, but that doesn't work
yet.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
3da38ca60b CLOUD: Replace USE_CLOUD with USE_LIBCURL
In most cases that's the right one to check. USE_CLOUD is defined when
either USE_LIBCURL or USE_SDL_NET are, which means if there is no curl,
USE_CLOUD still could be defined and linking errors would appear.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
1cfdb96616 CLOUD: Fix FolderDownloadRequest
Actually, I'm not completely sure, but this fixed the segfault when user
closes ScummVM during the download. Even if that's not a fix, these
lines must be in this method anyway.
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
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