From 8ac902456870615486df0fbc4bb073695d93a35b Mon Sep 17 00:00:00 2001 From: yanas Date: Fri, 10 Jan 2014 12:21:29 +0200 Subject: [PATCH] Adds a button that allows to hide/show the participants list in a video conference call. Two properties have been added to allow disabling the button or indicating the default mode (hidden or shown participants list). --- resources/images/images.properties | 2 + .../images/impl/gui/buttons/showHidePeers.png | Bin 0 -> 1667 bytes .../impl/gui/buttons/showHidePeersPressed.png | Bin 0 -> 1922 bytes resources/languages/resources.properties | 1 + .../impl/gui/main/call/CallPanel.java | 57 +++++++++++++++++ .../call/conference/ShowHidePeersButton.java | 58 ++++++++++++++++++ .../conference/VideoConferenceCallPanel.java | 15 ++++- .../impl/gui/utils/ImageLoader.java | 14 +++++ 8 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 resources/images/impl/gui/buttons/showHidePeers.png create mode 100644 resources/images/impl/gui/buttons/showHidePeersPressed.png create mode 100644 src/net/java/sip/communicator/impl/gui/main/call/conference/ShowHidePeersButton.java 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 0000000000000000000000000000000000000000..c036d7f7d42eae2331ee0863d1679beb34013a1a GIT binary patch literal 1667 zcmbVNdr;GM94|6Jalj#XGUQlRUz~#`=_93;3bg?(QdUY8HmBFn2FRdEO@l2QPQ)jN zn^T;R3C`h^4W=l%DLRpYhz#(pv`kN?_}E}<-L$f)+fp97-Fg18T$11K`^)$9`MxhD z>g2h8zM;Mx4#!V957n@1B>T)5>&?CyMRgOqyvD?*GpST2W5H;gBR5bPIG{9QS-1wr z4Eamj@E8uqGn3G!GwG@%sh%?OFt-lRYBaHE4ksqoYQpq6I0IzhSp+HL{&M0J7a$BW zZkk91sZ0tyo0wNX;7EWE!F&*6ZzKv9N=1m2F9t>~E^Cc8 zWJ)z?!iX(al5w*c#v}zni^amT2zV5o1;P@E#LdCyN3j}F=6sUDtWl(S$|wVhoAoqd zVhD-^+>BTTmB+}qtf#{v7)>hGGh)&_k|;K1pcONLFb@KaMt598+Ga+BKX>DW+GcIO z2?sT}naZQ}Y&|lkjDp$Rz1)ynk@ZIU7EQ24!E#YbpJ&8LMv2O}>=&MaFi0Udn$4nE z2#NU+5)H%A(ISZgibr9g7=~adew5=ySbLgjLi7!oAFaJ)bcBO(P~#7AHxL4lwN zqgW+rW-wBZkJ=?zyCYcPOR-V~jbjW&Ybh#sv;)-H6hoP_DHEVb6#*(tPmpfeU7q1+ zQJf~0;f4g7G6F;Sl@c$o&j$OSxFvjKPC`7&M}>R=8#(LyFxK#Yat5-_fbQn_SF?;B zu^s5%K5Knecs4vZ$xaN-jz)0G&6OO^n8Qj`uC;deZ$DppIWD+$=jX=m(7?WeO}iH? z!W_+Y)-B;__CD9Oy$^gUeVjd~dK|07C({$(T&#Y@3HZwTZ5lBAJujz^tVGQOUhnSQ zr@Z~h#@IGbXT)vqv^DDY?P%*Q6H^VfLFb?ijWH8vLs>08u9eGmuMft0`k&(;)6SIj zL=UW;4D7jhpV+H$#F^I{5c+g8X{)R6Qdg{AbC)}n6Q;=PAg`|SSsqva?h^UelS*4$ zwSL~7H+~A=FfsQ`e+qMKOvm(_-i-r;bEcQobCs8jyY8j+9P*;WZaHhJtHI+p22L)l zdH6xm!Ab9{mNpUE_*5YMTT-oZdcOFn0B;0N+C`+Qz{d+Tz68uAH{ICmy?&l-oaw z-Q5iSSdpF)GQaYZ_B$?7{lXeYf&Jo@>)FCTj~|FdoKGGvJMq*@wWbC3C_C~qpdF)E zlypljrs$?_G|vm)rVO!sF2TVhr;8GBYXPe%G@LKEVe2LfF3(#nY1w>5{f{^Zv4 z`|UdJtcXNjxz9M4xPQj>;HskhW!2Mehj}CR2KD|A|0w@k{{2wbwEs4@$b)nA%mXaW Sf0NVwTTsR)qX*{bivIy%M}klQ literal 0 HcmV?d00001 diff --git a/resources/images/impl/gui/buttons/showHidePeersPressed.png b/resources/images/impl/gui/buttons/showHidePeersPressed.png new file mode 100644 index 0000000000000000000000000000000000000000..c221ba15633a9b35199673cf1d50d37a02bfbea7 GIT binary patch literal 1922 zcmbVNc~BEq7>`kbDk7JNcr=7~L$bS&4M`IsWP=6?BBT-=23e8~M3QXSY$QNc#EL~x z)LM@58c*aBu^LgaqEc^Bq>4v7c$e0wSd~=hXg3J9opJo5yZiRN@9p>deaHL0*}~YE znInez4WrR$BV@CXIBE{0#$*>K>PC8U-9qR#p}}E0~QFX&jKx=Q}tcD2UPsGG!Y`)DmPc1q?7Cm`O!w zjieSgFdU3%DsCo4Ov=;uA?S^A`3GWysXtLv$~YF($N|{^N3VCp)u(MDp!O&1HUjj%GFoXvJARry!_!t%m3Fku~58?q_9tcWpasIURMTFP!e7W^buAR#c6#0dqC>jo+yHXSE%Q#x*BNaDE+IjYhc9J1qh z-bagIgmw|8jwEnBqc6V#?MLiW!Tu+1J_JWZN)ZSNfr6>XDc|2?)&D1F9LgDvqd5Lm zECX9q1v-`=N}m!wG!JH=I)ZXV(18arQTywo4POD@=SR zb76}4++Imx$j#K!R@Bwn=6lfXSnZg6XG|mmL z@D+JZD4x7Se0C}SV8iM=gL{OLw6U%Q$Lf_f_m!+`suz~cmrgSWIjOFCmqQ@kJ_fGu z7{prt+?G#^Pgxw+;iG)H`)p5dFL&Xgp8D7+IwyDj?)e*7S>1MfM<9oDrM9LcG|%R#RfjG$S5{VTG92zbYqQzhxIfg_Z>Qg^Gx}s(SERHE z#Nv0&_lynI)z#8N?u{E+m&qte_`3avt=7kfZ|PnnH4L+&Ws=($W#2_zFB={>(YSYC zK|#TumX?;`wY9Yi4qQ%5O0v}}19NN2nlo>BlnB2H6K~BBHx{{TSizev#{i2xm=(SS z=hZ(Ii`;&jP4FiK%uUs39``miHN~%pK+k#jFA2YXY<{gZxuWfOZ>ekAAFCA8YOlNo zd|eHvB6rTKHjiKXWwm13sBir4d--ZccXf8A(^v9-%}Gv7%pMbibiaN*^$UR@Y}?QR zzRQ9u84DMZx3*>rCphmOy0f(bgUY?lX7ef`d?_sDX6M=N?nR?F*R2n8i~sW}Dd>o= zAM3dWVa^4fRqx&FQdC^Ll>Tz&qmx}-`+fY`%hr{o2-`3(mh;ltvo8*(Es6YmKX588FoHv@#oXo4JsL<1LpN3@6 z#(lk-Y&aTQW8dfs99`Zno$t9I(5Hi)IA`X>Wjk_%*$Ee>rR2G`DlSg<0kHNOdcpGJ zyQ5_A?a85cd5E9qE}%WLsHo`Yoqkg9phMC2d~c;GY0JLmrdrk1n R(07i%qD&ft?2Aar{~Jq0>l*+7 literal 0 HcmV?d00001 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. */