Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUACAMOLE-1896: Refresh connection parameters when focused client updates. #938

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,18 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams

});

// Automatically update connection parameters that have been modified
// for the current focused client
$scope.$on('guacClientArgumentsUpdated', function focusedClientChanged(event, focusedClient) {

// Update available connection parameters, if the updated arguments are
// for the current focused client - otherwise ignore them
if ($scope.focusedClient && $scope.focusedClient === focusedClient)
$scope.menu.connectionParameters = focusedClient ?
ManagedClient.getArgumentModel(focusedClient) : {};

});

// Update page icon when thumbnail changes
$scope.$watch('focusedClient.thumbnail.canvas', function thumbnailChanged(canvas) {
iconService.setIcons(canvas);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ angular.module('client').directive('guacTiledClients', [function guacTiledClient
$scope.$emit('guacClientFocused', focusedClient);
});

// Notify whenever arguments of currently-focused client changes
$scope.$watch('getFocusedClient().arguments', function focusedClientParametersChanged() {
jmuehlner marked this conversation as resolved.
Show resolved Hide resolved
$scope.$emit('guacClientArgumentsUpdated', $scope.getFocusedClient());
}, true);

/**
* Returns a callback for guacClick that assigns or updates keyboard
* focus to the given client, allowing that client to receive and
Expand Down