Commit Graph

240 Commits

Author SHA1 Message Date
Cameron Cawley
51949bbc9e RISCOS: Add RISC OS filesystem 2017-10-01 20:19:42 +02:00
Thierry Crozat
20e628cac3 SDL: Remove code for unused DoubleBufferSDLMixerManager 2017-09-12 21:46:20 +01:00
cpasjuste
70988527c6 PSP2: Add Playstation Vita (PSP2) support 2017-03-04 15:42:19 -06:00
Eugene Sandulenko
e8b70a4686 ALL: Fix compilation with disabled cloud but enabled libcurl 2016-10-17 18:55:22 +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
1f2a50bcd3 CLOUD: Move openUrl to OSystem 2016-09-10 01:12:42 +01: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
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
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
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ó
18fc113aa9 CLOUD: Add URL opening for OS X 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
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
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
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
d96cdacb38 CLOUD: Add BoxUploadRequest 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
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
b37b392fa0 CLOUD: Add BoxStorage sketch 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
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
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
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
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
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
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
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
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
Peter Bozsó
a8eebbe851 CLOUD: Get rid of CloudConfigHelper, use kCloudDomain where approriate 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
Alexander Tkachev
b29497effe CLOUD: Add GoogleDriveUploadRequest
Includes NetworkReadStream PATCH method and Headers remembering feature.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
e273e3d6e8 CLOUD: Add GoogleDrive download-related requests
GoogleDriveDownloadRequest, which resolves file id and then downloads it
with GoogleDriveStorage::downloadById().

GoogleDriveStreamFileRequest, which resolves file id and then returns
file stream with GoogleDriveStorage::streamFileById().

This commit also adds GoogleDriveStorage::streamFileById() itself.

A minor GoogleDriveResolveIdRequest fix added.

With these one can download files from Google Drive.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
d1d71afb07 CLOUD: Add GoogleDriveListDirectoryRequest
When listing directories, you get a list of StorageFiles, which path()
is actually Google Drive id. Thus, if you list a directory recursively,
you won't be able to determine whether all files are within one
directory or have some hierarchy. I'd fix that as soon as it would be
needed.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
b4b6ee0186 CLOUD: Add GoogleDriveCreateDirectory
Now we can create directories in Google Drive by path, not parent id +
directory name!
2016-08-24 16:07:55 +06:00
Alexander Tkachev
bb207ae513 CLOUD: Add GoogleDriveResolveIdRequest
GoogleDriveResolveIdRequest gets a lowercase path and searches for the
specified file's id. To do that it lists path's subdirectories one by
one with GoogleDriveListDirectoryByIdRequest.

GoogleDriveListDirectoryByIdRequest gets a Google Drive id and lists
that directory (not recursively).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
9d186929e1 CLOUD: Add CloudIcon
To achieve smoother animation, ConnectionManager's timer now is 20 times
more frequent.

I'm encountering some strange libcurl.dll segfault problem when I close
the application while some Requests are active. It's not
CloudIcon-related, so it's more likely related to this 20 FPS timer.
This problem shows up only in Visual Studio for me.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
da3b7bd8d9 CLOUD: Add GoogleDriveStorage
It has its own GoogleDriveTokenRefresher and knows how to do info().

This commit also contains JSON int -> long long int fix and
CurlJsonRequest '\n' -> ' ' fix.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
b3bf532211 CLOUD: Make CloudManager singleton
It's needed to ::destroy() it in main().
2016-08-24 16:07:55 +06:00
Alexander Tkachev
8cdde307f7 CLOUD: Add OneDriveCreateDirectoryRequest 2016-08-24 16:07:55 +06:00
Alexander Tkachev
4e7dec5500 CLOUD: Add DropboxCreateDirectoryRequest
Also add CloudManager::testFeature(), because syncSaves() now works fine
and I don't want to break it again and again with my testing requests.
2016-08-24 16:07:55 +06:00