diff --git a/resources/images/images.properties b/resources/images/images.properties index 7b9e6a3f7..5a902db11 100644 --- a/resources/images/images.properties +++ b/resources/images/images.properties @@ -225,6 +225,8 @@ service.gui.buttons.LOCAL_VIDEO_BUTTON=resources/images/impl/gui/buttons/localVi service.gui.buttons.LOCAL_VIDEO_BUTTON_PRESSED=resources/images/impl/gui/buttons/localVideoButtonPressed.png service.gui.buttons.SHOW_LOCAL_VIDEO_BUTTON=resources/images/impl/gui/buttons/showHideLocalVideo.png service.gui.buttons.SHOW_LOCAL_VIDEO_BUTTON_PRESSED=resources/images/impl/gui/buttons/showHideLocalVideoPressed.png +service.gui.buttons.SHOW_HIDE_PEERS_BUTTON=resources/images/impl/gui/buttons/showHidePeers.png +service.gui.buttons.SHOW_HIDE_PEERS_BUTTON_PRESSED=resources/images/impl/gui/buttons/showHidePeersPressed.png service.gui.buttons.TRANSFER_CALL_BUTTON=resources/images/impl/gui/buttons/transferCallButton.png service.gui.buttons.SECURE_BUTTON_ON=resources/images/impl/gui/buttons/secureOn.png service.gui.buttons.SECURE_BUTTON_OFF=resources/images/impl/gui/buttons/secureOff.png diff --git a/resources/images/impl/gui/buttons/showHidePeers.png b/resources/images/impl/gui/buttons/showHidePeers.png new file mode 100644 index 000000000..c036d7f7d Binary files /dev/null and b/resources/images/impl/gui/buttons/showHidePeers.png differ diff --git a/resources/images/impl/gui/buttons/showHidePeersPressed.png b/resources/images/impl/gui/buttons/showHidePeersPressed.png new file mode 100644 index 000000000..c221ba156 Binary files /dev/null and b/resources/images/impl/gui/buttons/showHidePeersPressed.png differ diff --git a/resources/languages/resources.properties b/resources/languages/resources.properties index 72a9e5ab1..9a4252d56 100644 --- a/resources/languages/resources.properties +++ b/resources/languages/resources.properties @@ -581,6 +581,7 @@ service.gui.MUTE_BUTTON_TOOL_TIP=Toggle Mute or hold button to adjust microphone service.gui.RECORD_BUTTON_TOOL_TIP=Toggle Record service.gui.LOCAL_VIDEO_BUTTON_TOOL_TIP=Toggle Video service.gui.SHOW_LOCAL_VIDEO_BUTTON_TOOL_TIP=Show/hide local video +service.gui.SHOW_HIDE_PEERS_TOOL_TIP=Show/hide call participants list service.gui.TRANSFER_BUTTON_TOOL_TIP=Transfer Call service.gui.TRANSFER_TO=Transfer to... service.gui.SECURITY_INFO=Security information diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java index ec743cd83..b4549adec 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java @@ -37,6 +37,8 @@ import org.jitsi.util.event.*; import org.osgi.framework.*; +import sun.security.provider.*; + /** * The dialog created for a given call. * @@ -154,6 +156,20 @@ public class CallPanel private static final String HIDE_VIDEO_BUTON_PROP = "net.java.sip.communicator.impl.gui.main.call.HIDE_VIDEO_BUTTON"; + /** + * Property to disable the button, which shows/hides participants in video + * conferences. + */ + private static final String HIDE_PEERS_LIST_BUTON_PROP + = "net.java.sip.communicator.impl.gui.main.call.HIDE_PEERS_LIST_BUTTON"; + + /** + * Indicates if the participants list in a video conference is visible by + * default. + */ + private static final String PEERS_LIST_HIDDEN_PROP + = "net.java.sip.communicator.impl.gui.main.call.PEERS_LIST_HIDDEN"; + /** * Property to disable the desktop sharing button. */ @@ -330,6 +346,12 @@ public class CallPanel */ private ShowHideVideoButton showHideVideoButton; + /** + * The button, which shows / hides the participants list in a video + * conference. + */ + private ShowHidePeersButton showHidePeersButton; + /** * The title of this call container. */ @@ -960,6 +982,12 @@ private void doUpdateSettingsPanelInEventDispatchThread( } } + if (showHidePeersButton != null) + { + showHidePeersButton.setVisible(isConference + && CallManager.isVideoStreaming(callConference)); + } + // The desktop sharing button depends on the operation set desktop // sharing server. if(desktopSharingButton != null) @@ -1350,6 +1378,9 @@ private void initButtonIndexes() videoButton.setIndex(11); if (showHideVideoButton != null) showHideVideoButton.setIndex(12); + if (showHidePeersButton != null) + showHidePeersButton.setIndex(13); + chatButton.setIndex(19); if (infoButton != null) @@ -1523,6 +1554,14 @@ private void initializeUserInterfaceHierarchy() videoButton = new LocalVideoButton(aCall); } + if (isButtonEnabled(HIDE_PEERS_LIST_BUTON_PROP)) + { + // If the PEERS_LIST_HIDDEN_PROP isn't specified we show the list + // by default. + showHidePeersButton = new ShowHidePeersButton(this, + isButtonEnabled(PEERS_LIST_HIDDEN_PROP)); + } + localLevel = new InputVolumeControlButton( aCall, @@ -1580,6 +1619,8 @@ private void initializeUserInterfaceHierarchy() settingsPanel.add(transferCallButton); if (videoButton != null) settingsPanel.add(videoButton); + if (showHidePeersButton != null) + settingsPanel.add(showHidePeersButton); // The bottom bar will contain the settingsPanel. add(createBottomBar(), BorderLayout.SOUTH); @@ -2015,6 +2056,22 @@ void setFullScreen(boolean fullScreen) callWindow.setFullScreen(fullScreen); } + /** + * Shows/hides the thumbnails list in the case of video conference. + * + * @param show true to show the thumbnails list, false + * to hide it + */ + public void showThumbnailsList(boolean show) + { + // This shouldn't happen, but if we aren't in a video conference we + // have nothing to do here. + if (!(callPanel instanceof VideoConferenceCallPanel)) + return; + + ((VideoConferenceCallPanel) callPanel).showThumbnailsList(show); + } + /** * Selects or unselects the video button in this call dialog. * diff --git a/src/net/java/sip/communicator/impl/gui/main/call/conference/ShowHidePeersButton.java b/src/net/java/sip/communicator/impl/gui/main/call/conference/ShowHidePeersButton.java new file mode 100644 index 000000000..e146e6a10 --- /dev/null +++ b/src/net/java/sip/communicator/impl/gui/main/call/conference/ShowHidePeersButton.java @@ -0,0 +1,58 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.impl.gui.main.call.conference; + +import net.java.sip.communicator.impl.gui.main.call.*; +import net.java.sip.communicator.impl.gui.utils.*; + +/** + * Implements an AWT/Swing button which toggles the display of the participants + * list in a conference call. + * + * @author Yana Stamcheva + */ +public class ShowHidePeersButton + extends AbstractCallToggleButton +{ + private static final long serialVersionUID = 0L; + + /** + * The parent call container. + */ + private final CallPanel callPanel; + + /** + * Initializes a new ShowHideVideoButton instance which is to + * toggle the display of the visual Component which depicts the + * video streaming from the local peer/user to the remote peer(s). + * + * @param callPanel the parent call container + * @param selected true if the new toggle button is to be initially + * selected; otherwise, false + */ + public ShowHidePeersButton(CallPanel callPanel, boolean selected) + { + super( null, + true, + selected, + ImageLoader.SHOW_HIDE_PEERS_BUTTON, + ImageLoader.SHOW_HIDE_PEERS_BUTTON_PRESSED, + "service.gui.SHOW_HIDE_PEERS_TOOL_TIP"); + + this.callPanel = callPanel; + } + + /** + * Toggles the display of the visual Component which depicts the + * video streaming from the local peer/user to the remote peer(s). + */ + @Override + public void buttonPressed() + { + callPanel.showThumbnailsList(isSelected()); + } +} diff --git a/src/net/java/sip/communicator/impl/gui/main/call/conference/VideoConferenceCallPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/conference/VideoConferenceCallPanel.java index b56bada70..543769e7f 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/conference/VideoConferenceCallPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/conference/VideoConferenceCallPanel.java @@ -85,6 +85,8 @@ public void update(Observable o, Object arg) */ private final ThumbnailConferenceCallPanel thumbnailContainer; + private final JPanel thumbnailPanel; + /** * Initializes a new VideoConferenceCallPanel instance which is to * be used by a specific CallPanel to depict a specific @@ -107,6 +109,7 @@ public VideoConferenceCallPanel( this.uiVideoHandler = uiVideoHandler; + thumbnailPanel = new JPanel(new BorderLayout()); thumbnailContainer = new ThumbnailConferenceCallPanel( callPanel, callConference, @@ -260,7 +263,6 @@ private VideoContainer createVideoContainer() { VideoContainer videoContainer = new VideoContainer(null, true); - JPanel thumbnailPanel = new JPanel(new BorderLayout()); thumbnailPanel.setBackground(Color.DARK_GRAY); thumbnailPanel.add(thumbnailContainer, BorderLayout.NORTH); @@ -270,6 +272,17 @@ private VideoContainer createVideoContainer() return videoContainer; } + /** + * Shows/hides the participants thumbnails list. + * + * @param show true to show the participants list, false + * to hide it + */ + public void showThumbnailsList(boolean show) + { + thumbnailPanel.setVisible(show); + } + /** * {@inheritDoc} */ diff --git a/src/net/java/sip/communicator/impl/gui/utils/ImageLoader.java b/src/net/java/sip/communicator/impl/gui/utils/ImageLoader.java index 664d9aee2..77edeed04 100644 --- a/src/net/java/sip/communicator/impl/gui/utils/ImageLoader.java +++ b/src/net/java/sip/communicator/impl/gui/utils/ImageLoader.java @@ -777,6 +777,20 @@ public class ImageLoader public static final ImageID SHOW_LOCAL_VIDEO_BUTTON_PRESSED = new ImageID("service.gui.buttons.SHOW_LOCAL_VIDEO_BUTTON_PRESSED"); + /** + * A show/hide local video button icon. The icon shown in the CallPeer + * panel. + */ + public static final ImageID SHOW_HIDE_PEERS_BUTTON + = new ImageID("service.gui.buttons.SHOW_HIDE_PEERS_BUTTON"); + + /** + * A show/hide local video button pressed icon. The icon shown in the + * CallPeer panel. + */ + public static final ImageID SHOW_HIDE_PEERS_BUTTON_PRESSED + = new ImageID("service.gui.buttons.SHOW_HIDE_PEERS_BUTTON_PRESSED"); + /** * The resize video button. */