mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-09 14:41:21 +00:00
Merge 1.1.0 changes back to master.
This commit is contained in:
@@ -28,6 +28,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
var ManagedClient = $injector.get('ManagedClient');
|
||||
var ManagedClientState = $injector.get('ManagedClientState');
|
||||
var ManagedFilesystem = $injector.get('ManagedFilesystem');
|
||||
var Protocol = $injector.get('Protocol');
|
||||
var ScrollState = $injector.get('ScrollState');
|
||||
|
||||
// Required services
|
||||
@@ -251,7 +252,15 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
*
|
||||
* @type ScrollState
|
||||
*/
|
||||
scrollState : new ScrollState()
|
||||
scrollState : new ScrollState(),
|
||||
|
||||
/**
|
||||
* The current desired values of all editable connection parameters as
|
||||
* a set of name/value pairs, including any changes made by the user.
|
||||
*
|
||||
* @type {Object.<String, String>}
|
||||
*/
|
||||
connectionParameters : {}
|
||||
|
||||
};
|
||||
|
||||
@@ -260,6 +269,16 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
$scope.menu.shown = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Applies any changes to connection parameters made by the user within the
|
||||
* Guacamole menu.
|
||||
*/
|
||||
$scope.applyParameterChanges = function applyParameterChanges() {
|
||||
angular.forEach($scope.menu.connectionParameters, function sendArgv(value, name) {
|
||||
ManagedClient.setArgument($scope.client, name, value);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* The client which should be attached to the client UI.
|
||||
*
|
||||
@@ -490,12 +509,20 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
|
||||
});
|
||||
|
||||
// Update client state/behavior as visibility of the Guacamole menu changes
|
||||
$scope.$watch('menu.shown', function menuVisibilityChanged(menuShown, menuShownPreviousState) {
|
||||
|
||||
// Send clipboard data if menu is hidden
|
||||
if (!menuShown && menuShownPreviousState)
|
||||
// Send clipboard and argument value data once menu is hidden
|
||||
if (!menuShown && menuShownPreviousState) {
|
||||
$scope.$broadcast('guacClipboard', $scope.client.clipboardData);
|
||||
|
||||
$scope.applyParameterChanges();
|
||||
}
|
||||
|
||||
// Obtain snapshot of current editable connection parameters when menu
|
||||
// is opened
|
||||
else if (menuShown)
|
||||
$scope.menu.connectionParameters = ManagedClient.getArgumentModel($scope.client);
|
||||
|
||||
// Disable client keyboard if the menu is shown
|
||||
$scope.client.clientProperties.keyboardEnabled = !menuShown;
|
||||
|
||||
@@ -872,6 +899,11 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
// Set client-specific menu actions
|
||||
$scope.clientMenuActions = [ DISCONNECT_MENU_ACTION ];
|
||||
|
||||
/**
|
||||
* @borrows Protocol.getNamespace
|
||||
*/
|
||||
$scope.getProtocolNamespace = Protocol.getNamespace;
|
||||
|
||||
/**
|
||||
* The currently-visible filesystem within the filesystem menu, if the
|
||||
* filesystem menu is open. If no filesystem is currently visible, this
|
||||
|
Reference in New Issue
Block a user