Andrew Webster [Thu, 25 Jan 2018 20:23:08 +0000 (15:23 -0500)]
Use localstorage only to initialize settings map
This only reads from localstorage in order to initialize the settings
map. After initializaton, reads will return the value from the map.
When writing a value, the settings map and the local storage
are updated, unless the setting is a default value or derived from
the query string.
This has a few advantages:
1. Saved settings will not be overridden by settings specified in
the query string. This means a setting could be temporarily changed
using the query string, but once removed from the query string, the
setting would return back to what the user selected.
2. Default values will not be saved. If a user has always used
the default value for a setting, then they can move to a new version
with different defaults without clearing localstorage.
3. Changes made to localstorage in a session running in a different
window will not affect the settings in the current window (until
the page is refreshed).
Regarding eraseSetting:
It is possible that another tab could change the value, leading
to an unexpected value change in the tab that deletes. However,
this function is currently unused, so this will be evaluted if
and when it used.
Pierre Ossman [Thu, 25 Jan 2018 14:32:22 +0000 (15:32 +0100)]
Drop UI.rfb reference on all disconnects
We can be disconnected because of server reasons, not just because
someone clicked the disconnect button. Make sure we clean up the
reference and get a proper state in those cases as well.
Pierre Ossman [Thu, 25 Jan 2018 14:19:12 +0000 (15:19 +0100)]
Temporarily disable SVG favicon
Firefox currently has a bug where it prefers the SVG icon over a
more exact size. This results in a poorly rendered, downscaled icon.
So disable the SVG icon until this has been fixed.
Samuel Mannehed [Wed, 24 Jan 2018 12:00:48 +0000 (13:00 +0100)]
Apply translations on input type submit
Commit 3729976 only updated xgettext.html which generates the .pot file.
This commit also makes sure that the actual translations are applied to
the interface.
Samuel Mannehed [Fri, 12 Jan 2018 00:12:22 +0000 (01:12 +0100)]
Update interface on view only toggle
Instead of waiting for updateVisualState() to be called in order for the
interface to update, we can call it directly in updateViewOnly(). This
is a better placement logically as well. Another upside of this is that
we can call updateVisualState() earlier on connect, that allows for the
"connecting"-throbber to be shown quicker.
Samuel Mannehed [Tue, 12 Dec 2017 17:25:20 +0000 (18:25 +0100)]
Fix disconnect crash when screen doesn't exist
The function removeChild throws an exception when the element specified
doesn't exist. This can happen when opening the websocket throws an
exception during connect. Fixes issue #979
Samuel Mannehed [Tue, 12 Dec 2017 15:14:43 +0000 (16:14 +0100)]
Make error more specific at connection failure
The UI does after all have enough information to determine if the
disconnection event was received before or after we were connected. If
we were never connected at all, we should adapt the error message to
reflect this.
Pierre Ossman [Wed, 29 Nov 2017 15:37:35 +0000 (16:37 +0100)]
Forced cleanup of RFB objects in tests
We need to make sure RFB objects are properly disposed or they
might have event listeners and other stuff hanging around that can
influence subsequent tests.
Samuel Mannehed [Sat, 11 Nov 2017 00:59:13 +0000 (01:59 +0100)]
Dont overwrite more severe visible statuses
And only show the first error. This means that if UI.showStatus() is
called for a new error while one error is already showing, the new
error will not be shown. However, if a warning was showing and a new
error comes up, the warning will be overwritten.
Samuel Mannehed [Sat, 11 Nov 2017 00:48:47 +0000 (01:48 +0100)]
Abstract RFB errors to avoid sending strings
The API allowed strings to be passed from the RFB module to the
application using the disconnect reason. This caused problems since
the application didn't have control over translations for these
strings.
Most of the information being passed using this string was very
technical and not helpful to the end user. One exception to this was
the security result information regarding for example authentication
failures. The protocol allows the VNC server to pass a string
directly to the user in the security result.
So the disconnect reason is replaced by a boolean saying if the
disconnection was clean or not. And for the security result information
from the server, a new event has been added.
Samuel Mannehed [Fri, 10 Nov 2017 11:52:39 +0000 (12:52 +0100)]
Replace updatestate event with connect
Instead of exposing all the internal connection states, the RFB module
will now only send events on connect and on disconnect. This makes it
simpler for the application and gets rid of the double events that were
being sent on disconnect (previously updatestate and disconnect).
Pierre Ossman [Fri, 20 Oct 2017 14:46:36 +0000 (16:46 +0200)]
Integrate connect() in to constructor
An RFB object represents a single connection so it doesn't make
sense to have one without it trying to connect right away. Matches
the behaviour of other APIs, e.g. WebSocket.