diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java b/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java index 1561d4ba4..72d74ab22 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java @@ -459,18 +459,6 @@ public void updateMuteButtonState() muteButton.setSelected(isAllMute); } - /** - * Returns true if the video button is selected, - * false - otherwise. - * - * @return true if the video button is selected, - * false - otherwise. - */ - public boolean isVideoButtonSelected() - { - return videoButton.isSelected(); - } - /** * Selects or unselects the video button in this call dialog. * @@ -535,16 +523,35 @@ public void enableButtons() ProtocolProviderService protocolProvider = call.getProtocolProvider(); - if (protocolProvider.getOperationSet( - OperationSetVideoTelephony.class) != null) + OperationSetVideoTelephony videoTelephony + = protocolProvider.getOperationSet( + OperationSetVideoTelephony.class); + + if (videoTelephony != null) { videoButton.setEnabled(true); + + // If the video was already enabled (for example in the case of + // direct video call) make sure the video button is selected. + if (videoTelephony.isLocalVideoAllowed(call) + && !videoButton.isSelected()) + setVideoButtonSelected(true); } - if (protocolProvider.getOperationSet( - OperationSetDesktopSharingServer.class) != null) + OperationSetDesktopSharingServer desktopSharing + = protocolProvider.getOperationSet( + OperationSetDesktopSharingServer.class); + + if (desktopSharing != null) { desktopSharingButton.setEnabled(true); + + // If the video was already enabled (for example in the case of + // direct desktop sharing call) make sure the video button is + // selected. + if (desktopSharing.isLocalVideoAllowed(call) + && !desktopSharingButton.isSelected()) + setDesktopSharingButtonSelected(true); } if (protocolProvider.getOperationSet(