35 Commits

Author SHA1 Message Date
Eugene Sandulenko
355c4fa646 JANITORIAL: Remove more trailing spaces 2016-10-09 15:02:02 +02:00
Bastien Bouclet
ff217ea033 GUI: Don't show the "Open URL" button if there is no backend support 2016-09-10 07:46:52 +02:00
Thierry Crozat
1f2a50bcd3 CLOUD: Move openUrl to OSystem 2016-09-10 01:12:42 +01:00
Thierry Crozat
7ad922fb19 CLOUD: Improve some labels 2016-09-04 23:25:54 +01:00
Lothar Serra Mari
a7d1cc91da GUI: Replace _s() with _() in storagewizarddialog.cpp
This allows the translation of a few more strings
in the Cloud settings tab.

Thanks to sev- for the fix.
2016-09-04 19:56:26 +02:00
Thierry Crozat
1c0e4e8206 CLOUD: Disable the connect button initially as the code is empty
The connect button is enabled/disabled whenever the text in the
code widget is changed and it's validity assessed. But the initial
state was not correct.
2016-08-30 21:37:34 +01:00
Thierry Crozat
7edc96803e CLOUD: Fix crash when trying to connect without entering a code first 2016-08-30 21:37:34 +01: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
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
527ab4cdf6 GUI: Fix StorageWizardDialog warning
Removed extra comma in the enum.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
091ff83ed6 GUI: Add Storage providers logos
StorageWizardDialog now shows logo of the Storage being connected (in
modern highres theme).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
f39b6ed4ac GUI: Add Container in StorageWizardDialog
It now looks fine in both 640x400 and 320x200!
2016-08-24 16:07:55 +06:00
Alexander Tkachev
c74ba4652d GUI: Add "Paste" button in StorageWizardDialog
It pastes clipboard contents as code into 8 fields of that dialog.
(Clipboard support works with SDL2 only.)

"Open URL" and "Paste" buttons are placed in the left column under the
picture (because there is no room for 4 buttons in the bottom row).

Commit also adds "dropbox.bmp", which is just a square 115x115 picture.
Such pictures are would be used as Storages logos in that dialog.

In lowres there is no left column, so all 4 buttons are in the same row.
None of them are visible, because they are overflowed. Container has to
be added to continue working on them.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
86f7b75dd7 GUI: Fix SDL_Net-related errors
Checked by rebuilding ScummVM without SDL_Net in MinGW.

Also fixes StorageWizardDialog's warning about _stopServerOnClose.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
c9b819b577 GUI: Make Options dialog stop LocalServer on close
Commit also adds a fix for StorageWizardDialog, where LocalServer was
used even if USE_SDL_NET was undefined.
2016-08-24 16:07:55 +06:00
Eugene Sandulenko
53aa0c46f1 GUI: JANITORIAL: 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
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
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
33ca8d485c GUI: Fix StorageWizardDialog
It now shows a MessageDialog (its message label is hidden in some
cases).
2016-08-24 16:07:55 +06:00
Alexander Tkachev
2ae438327b GUI: Add "Open URL" button in StorageWizardDialog
It uses Networking::Browser::openUrl().
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
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
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
c2c2ba908f GUI: Hide StorageWizardDialog fields if server present 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
ceb86a0dd8 CLOUD: Clarify calculatedChecksum's initial value 2016-08-24 16:07:55 +06:00
Peter Bozsó
434b740f4d CLOUD: Remove a couple of unnecessary whitespaces 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
f571f3dd28 CLOUD: Add comments for StorageWizardDialog methods 2016-08-24 16:07:55 +06:00
Alexander Tkachev
a83e91e1ca CLOUD: Update StorageWizardDialog's code check
Now the code contains its own crc16 in it, plus the way checksum is
calculated has changed.

Some online tool calls this exact way of calculating crc16
"CRC16_CCITT_FALSE".
2016-08-24 16:07:55 +06:00
Alexander Tkachev
3db4915b66 CLOUD: Add checks in StorageWizardDialog
It now calculates the checksums for code pieces to determine whether
it's correct and CRC-32 for user to compare with one shown on site.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
9ee2eb4e60 GUI: Add EditText in StorageWizardDialog
One can enter the code, press 'Connect' button and get a working
Storage!
2016-08-24 16:07:55 +06:00
Alexander Tkachev
beb168a3a5 GUI: Add Cloud tab StorageWizardDialog
This is a dialog which guides user through Storage connection procedure.
2016-08-24 16:07:55 +06:00