Disable the local video button if no camera is available.

cusax-fix
Yana Stamcheva 15 years ago
parent 0092783633
commit dc89798125

@ -287,6 +287,7 @@ service.gui.NEW_MESSAGE=New message
service.gui.NEW_NAME=New name
service.gui.NEW_STATUS_MESSAGE=New status message
service.gui.NO=No
service.gui.NO_CAMERA_AVAILABLE=No camera available
service.gui.NO_AVAILABLE_ROOMS=The list of rooms for this server is currently not available.
service.gui.NO_CONTACTS_FOUND=No matching contacts found. Press Ctrl+Enter to call {0} or use the buttons below.
service.gui.NO_MESSAGE=No message

@ -22,6 +22,8 @@
import net.java.sip.communicator.impl.gui.main.call.conference.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.neomedia.*;
import net.java.sip.communicator.service.neomedia.device.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
@ -527,7 +529,14 @@ public void enableButtons()
= protocolProvider.getOperationSet(
OperationSetVideoTelephony.class);
if (videoTelephony != null)
MediaDevice videoDevice = GuiActivator.getMediaService()
.getDefaultDevice( MediaType.VIDEO,
MediaUseCase.CALL);
// If the video telephony is supported and the default video device
// isn't null, i.e. there's an available camera to the video we
// enable the video button.
if (videoTelephony != null && videoDevice != null)
{
videoButton.setEnabled(true);
@ -537,6 +546,9 @@ public void enableButtons()
&& !videoButton.isSelected())
setVideoButtonSelected(true);
}
else if (videoDevice == null)
videoButton.setToolTipText(GuiActivator.getResources()
.getI18NString("service.gui.NO_CAMERA_AVAILABLE"));
OperationSetDesktopSharingServer desktopSharing
= protocolProvider.getOperationSet(

Loading…
Cancel
Save