diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/events/ChangeStatusEvent.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/events/ChangeStatusEvent.as index 97bcdc8c01..acd999ac71 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/events/ChangeStatusEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/events/ChangeStatusEvent.as @@ -24,17 +24,17 @@ package org.bigbluebutton.main.model.users.events { public static const CHANGE_STATUS:String = "CHANGE_STATUS_EVENT"; - public static const CLEAR_STATUS:String = "clear_status"; - public static const RAISE_HAND:String = "raise_hand"; - public static const AGREE:String = "agree"; - public static const DISAGREE:String = "disagree"; - public static const SPEAK_LOUDER:String = "speak_louder"; - public static const SPEAK_LOWER:String = "speak_lower"; - public static const SPEAK_FASTER:String = "speak_faster"; - public static const SPEAK_SLOWER:String = "speak_slower"; - public static const BE_RIGHT_BACK:String = "be_right_back"; - public static const LAUGHTER:String = "laughter"; - public static const SAD:String = "sad"; + public static const CLEAR_STATUS:String = "CLEAR_STATUS"; + public static const RAISE_HAND:String = "RAISE_HAND"; + public static const AGREE:String = "AGREE"; + public static const DISAGREE:String = "DISAGREE"; + public static const SPEAK_LOUDER:String = "SPEAK_LOUDER"; + public static const SPEAK_LOWER:String = "SPEAK_LOWER"; + public static const SPEAK_FASTER:String = "SPEAK_FASTER"; + public static const SPEAK_SLOWER:String = "SPEAK_SLOWER"; + public static const BE_RIGHT_BACK:String = "BE_RIGHT_BACK"; + public static const LAUGHTER:String = "LAUGHTER"; + public static const SAD:String = "SAD"; private var status:String; public var userId:String; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/StatusItemRenderer.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/StatusItemRenderer.mxml index 2d56fde400..d6f577f644 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/StatusItemRenderer.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/StatusItemRenderer.mxml @@ -92,116 +92,129 @@ private function updateButton(unneeded:Object = null):void { if (data != null) { - if (data.presenter) + if (rolledOver) //if i'm moderator and I rolled the mouse { - roleImg.source = images.presenter_new; - roleImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.presenter'); - roleImg.visible = true; - roleBtn.visible = false; - roleBtn.enabled = false; - } - else if (rolledOver) - { - roleImg.visible = false; - roleBtn.visible = true; - roleBtn.enabled = true; - if (data.userHasStatus) { - roleBtn.setStyle("icon", images.delete_icon); - roleBtn.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.clearStatus'); + statusBtn.setStyle("icon", images.delete_icon); + statusBtn.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.clearStatus'); + + statusImg.visible = false; + statusBtn.visible = true; + statusBtn.enabled = true; } - else + if(!data.presenter) { - roleBtn.setStyle("icon", images.presenter_new); + roleBtn.setStyle("icon", images.presenter_new); roleBtn.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.changePresenter'); + + roleImg.visible = false; + roleBtn.visible = true; + roleBtn.enabled = true; } - } - else if (data.role == Role.MODERATOR) - { - roleImg.source = images.moderator; - roleImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.moderator'); - roleImg.visible = true; - roleBtn.visible = false; - roleBtn.enabled = false; - } - else if (data.userHasStatus) + } + + else { + //updating which role to show: presenter or moderator + if (data.presenter) + { + roleImg.source = images.presenter_new; + roleImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.presenter') + } + + else if(data.role == Role.MODERATOR) + { + roleImg.source = images.moderator; + roleImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.moderator'); + } + + else + { + roleImg.source = null; + roleImg.toolTip = ""; + } + + + //updating which status to show switch(data.currentStatus) { case ChangeStatusEvent.RAISE_HAND: - roleImg.source = images.hand_new; - roleImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.handRaised'); + statusImg.source = images.hand_new; + statusImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.handRaised'); break; case ChangeStatusEvent.AGREE: - roleImg.source = images.agree; - roleImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.agree'); + statusImg.source = images.agree; + statusImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.agree'); break; case ChangeStatusEvent.DISAGREE: - roleImg.source = images.disagree; - roleImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.disagree'); + statusImg.source = images.disagree; + statusImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.disagree'); break; case ChangeStatusEvent.SPEAK_LOUDER: - roleImg.source = images.speak_louder; - roleImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.status.speak_louder'); + statusImg.source = images.speak_louder; + statusImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.status.speak_louder'); break; case ChangeStatusEvent.SPEAK_LOWER: - roleImg.source = images.speak_lower; - roleImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.status.speak_lower'); + statusImg.source = images.speak_lower; + statusImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.status.speak_lower'); break; case ChangeStatusEvent.SPEAK_FASTER: - roleImg.source = images.speak_faster; - roleImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.status.speak_faster'); + statusImg.source = images.speak_faster; + statusImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.status.speak_faster'); break; case ChangeStatusEvent.SPEAK_SLOWER: - roleImg.source = images.speak_slower; - roleImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.status.speak_slower'); + statusImg.source = images.speak_slower; + statusImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.status.speak_slower'); break; case ChangeStatusEvent.BE_RIGHT_BACK: - roleImg.source = images.be_right_back; - roleImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.be_right_back'); + statusImg.source = images.be_right_back; + statusImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.usersGrid.statusItemRenderer.be_right_back'); break; case ChangeStatusEvent.LAUGHTER: - roleImg.source = images.laughter; - roleImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.status.laughter'); + statusImg.source = images.laughter; + statusImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.status.laughter'); break; case ChangeStatusEvent.SAD: - roleImg.source = images.sad; - roleImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.status.sad'); - } + statusImg.source = images.sad; + statusImg.toolTip = ResourceUtil.getInstance().getString('bbb.users.status.sad'); + break; - roleImg.visible = true; + default: //user has no status... + statusImg.source = null; + statusImg.toolTip = ""; + } + + roleImg.visible = true; + statusImg.visible = true; + roleBtn.visible = false; + statusBtn.visible = false; + roleBtn.enabled = false; - } - else - { - roleImg.source = null; - roleImg.toolTip = ""; - roleImg.visible = true; - roleBtn.visible = false; - roleBtn.enabled = false; - } - } - } + statusBtn.enabled = false; + + } + } + } - private function onRollOver(e:UsersRollEvent):void{ + private function onRollOver(e:UsersRollEvent):void{ //descobrir qual botão: role ou status if (moderator && (e.userID == data.userID) && !data.phoneUser) { rolledOver = true; updateButton(); } } - private function onRollOut(e:UsersRollEvent):void{ + private function onRollOut(e:UsersRollEvent):void{ //descobrir qual botão: role ou status if (moderator) { rolledOver = false; updateButton(); @@ -210,20 +223,15 @@ private function roleBtnClicked():void { - // Ignore if the selected user is already the presenter. - if (data.presenter) return; - - if (data.userHasStatus) - { - dispatchEvent( new ChangeStatusEvent(data.userID, ChangeStatusEvent.CLEAR_STATUS) ) - } - else - { - var e:RoleChangeEvent = new RoleChangeEvent(RoleChangeEvent.ASSIGN_PRESENTER); - e.userid = data.userID; - e.username = data.name; - dispatchEvent(e); - } + var e:RoleChangeEvent = new RoleChangeEvent(RoleChangeEvent.ASSIGN_PRESENTER); + e.userid = data.userID; + e.username = data.name; + dispatchEvent(e); + } + + private function statusBtnClicked():void + { + dispatchEvent( new ChangeStatusEvent(data.userID, ChangeStatusEvent.CLEAR_STATUS) ) } // Need to refresh the roleBtn toolTip text on locale change @@ -233,7 +241,10 @@ ]]> - + + + + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml index 6d861f65e8..97fa234659 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml @@ -89,6 +89,7 @@ private var users:ArrayCollection = new ArrayCollection(); private var amIModerator:Boolean = false; + private var baseIndex:int = 0; private const FOCUS_USERS_LIST:String = "Focus Users List"; private const MAKE_PRESENTER:String = "Make Presenter"; @@ -104,9 +105,8 @@ users = UserManager.getInstance().getConference().users; amIModerator = UserManager.getInstance().getConference().amIModerator(); - settingsBtn.visible = settingsBtn.includeInLayout = partOptions.enableSettingsButton && amIModerator; + //settingsBtn.visible = settingsBtn.includeInLayout = partOptions.enableSettingsButton && amIModerator; - BindingUtils.bindSetter(changeButtons, UserManager.getInstance().getConference(), "amIPresenter"); BindingUtils.bindSetter(updateNumberofUsers, users, "length"); this.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown); @@ -115,8 +115,6 @@ modifier = ExternalInterface.call("determineModifier"); loadKeyCombos(modifier); - changeButtons(UserManager.getInstance().getConference().amIPresenter); - resourcesChanged(); titleBarOverlay.tabIndex = partOptions.baseTabIndex; @@ -142,10 +140,6 @@ resourcesChanged(); } - private function changeButtons(presenter:Boolean):void { - statusBtn.visible = statusBtn.includeInLayout = partOptions.enableRaiseHand && !(presenter || amIModerator); - } - private function onItemRollOver(event:ListEvent):void{ var item:IListItemRenderer = event.itemRenderer; var user:BBBUser = item.data as BBBUser; @@ -168,80 +162,6 @@ } } - private function openParticipantStatus():void { - - var menuStatusData:Array = []; - - menuStatusData[0] = {label: ResourceUtil.getInstance().getString('bbb.users.status.clearStatus'), icon: images.delete_icon}; - menuStatusData[1] = {label: ResourceUtil.getInstance().getString('bbb.shortcutkey.raiseHand.function'), icon: images.hand_new}; - menuStatusData[2] = {label: ResourceUtil.getInstance().getString('bbb.users.status.agree'), icon: images.agree}; - menuStatusData[3] = {label: ResourceUtil.getInstance().getString('bbb.users.status.disagree'), icon: images.disagree}; - menuStatusData[4] = {label: ResourceUtil.getInstance().getString('bbb.users.status.speak_louder'), icon: images.speak_louder}; - menuStatusData[5] = {label: ResourceUtil.getInstance().getString('bbb.users.status.speak_lower'), icon: images.speak_lower}; - menuStatusData[6] = {label: ResourceUtil.getInstance().getString('bbb.users.status.speak_faster'), icon: images.speak_faster}; - menuStatusData[7] = {label: ResourceUtil.getInstance().getString('bbb.users.status.speak_slower'), icon: images.speak_slower}; - menuStatusData[8] = {label: ResourceUtil.getInstance().getString('bbb.users.status.be_right_back'), icon: images.be_right_back}; - menuStatusData[9] = {label: ResourceUtil.getInstance().getString('bbb.users.status.laughter'), icon: images.laughter}; - menuStatusData[10] = {label: ResourceUtil.getInstance().getString('bbb.users.status.sad'), icon: images.sad}; - - - // make sure the previous menu is closed before opening a new one - // This could be improved to include a flag that tells if the menu is open, - // but it would require an extra listener for the MenuCloseEvent. - if (menuStatus) menuStatus.hide(); - - menuStatus = Menu.createMenu(null, menuStatusData, true); - - menuStatus.variableRowHeight = true; - menuStatus.show(this.x + settingsBtn.x + 2, this.y + this.height + 25); - menuStatus.addEventListener(MenuEvent.ITEM_CLICK, menuStatusClickHandler); - menuStatus.setFocus(); - } - - private function menuStatusClickHandler(e:MenuEvent):void { - switch (e.index) { - case 0: - changeStatus(ChangeStatusEvent.CLEAR_STATUS); - break; - case 1: - changeStatus(ChangeStatusEvent.RAISE_HAND); - break; - case 2: - changeStatus(ChangeStatusEvent.AGREE); - break; - case 3: - changeStatus(ChangeStatusEvent.DISAGREE); - break; - case 4: - changeStatus(ChangeStatusEvent.SPEAK_LOUDER); - break; - case 5: - changeStatus(ChangeStatusEvent.SPEAK_LOWER); - break; - case 6: - changeStatus(ChangeStatusEvent.SPEAK_FASTER); - break; - case 7: - changeStatus(ChangeStatusEvent.SPEAK_SLOWER); - break; - case 8: - changeStatus(ChangeStatusEvent.BE_RIGHT_BACK); - break; - case 9: - changeStatus(ChangeStatusEvent.LAUGHTER); - break; - default: - changeStatus(ChangeStatusEvent.SAD); - } - } - - private function changeStatus(whichStatus:String):void{ - if (UserManager.getInstance().getConference().getMyRole() == Role.VIEWER) { - var e:ChangeStatusEvent = new ChangeStatusEvent(UserManager.getInstance().getConference().getMyUserId(), whichStatus); - dispatchEvent(e); - } - } - private function clearAllStatus():void { // Pendente: ver clear status do moderador for (var i:int = 0; i < users.length; i++) { var p:BBBUser = users.getItemAt(i) as BBBUser; @@ -253,15 +173,41 @@ private function openSettings():void { // everyone can see the audio settings var myMenuData:Array = []; - - myMenuData[0] = {label: ResourceUtil.getInstance().getString('bbb.users.settings.clearAllStats'), icon: images.delete_icon}; - if (!roomMuted) { - myMenuData[1] = {label: ResourceUtil.getInstance().getString('bbb.users.settings.muteAll'), icon: images.audio_muted}; - if (UserManager.getInstance().getConference().getPresenter()) - myMenuData[2] = {label: ResourceUtil.getInstance().getString('bbb.users.settings.muteAllExcept') + ": " + UserManager.getInstance().getConference().getPresenter().name, icon: images.audio_muted}; - } else - myMenuData[1] = {label: ResourceUtil.getInstance().getString('bbb.users.settings.unmuteAll'), icon: images.audio}; - + + if(amIModerator) + { + myMenuData[0] = {label: ResourceUtil.getInstance().getString('bbb.users.settings.clearAllStats'), icon: images.delete_icon}; + if (!roomMuted) + { + myMenuData[1] = {label: ResourceUtil.getInstance().getString('bbb.users.settings.muteAll'), icon: images.audio_muted}; + if (UserManager.getInstance().getConference().getPresenter()) + myMenuData[2] = {label: ResourceUtil.getInstance().getString('bbb.users.settings.muteAllExcept') + ": " + UserManager.getInstance().getConference().getPresenter().name, icon: images.audio_muted}; + baseIndex = 2; + } + else + { + myMenuData[1] = {label: ResourceUtil.getInstance().getString('bbb.users.settings.unmuteAll'), icon: images.audio}; + baseIndex = 1; + } + } + + + if(partOptions.enableRaiseHand) + { + myMenuData[baseIndex+1] = {label: ResourceUtil.getInstance().getString('bbb.users.status.clearStatus'), icon: images.delete_icon}; + myMenuData[baseIndex+2] = {label: ResourceUtil.getInstance().getString('bbb.shortcutkey.raiseHand.function'), icon: images.hand_new}; + myMenuData[baseIndex+3] = {label: ResourceUtil.getInstance().getString('bbb.users.status.agree'), icon: images.agree}; + myMenuData[baseIndex+4] = {label: ResourceUtil.getInstance().getString('bbb.users.status.disagree'), icon: images.disagree}; + myMenuData[baseIndex+5] = {label: ResourceUtil.getInstance().getString('bbb.users.status.speak_louder'), icon: images.speak_louder}; + myMenuData[baseIndex+6] = {label: ResourceUtil.getInstance().getString('bbb.users.status.speak_lower'), icon: images.speak_lower}; + myMenuData[baseIndex+7] = {label: ResourceUtil.getInstance().getString('bbb.users.status.speak_faster'), icon: images.speak_faster}; + myMenuData[baseIndex+8] = {label: ResourceUtil.getInstance().getString('bbb.users.status.speak_slower'), icon: images.speak_slower}; + myMenuData[baseIndex+9] = {label: ResourceUtil.getInstance().getString('bbb.users.status.be_right_back'), icon: images.be_right_back}; + myMenuData[baseIndex+10] = {label: ResourceUtil.getInstance().getString('bbb.users.status.laughter'), icon: images.laughter}; + myMenuData[baseIndex+11] = {label: ResourceUtil.getInstance().getString('bbb.users.status.sad'), icon: images.sad}; + } + + // make sure the previous menu is closed before opening a new one // This could be improved to include a flag that tells if the menu is open, // but it would require an extra listener for the MenuCloseEvent. @@ -276,19 +222,89 @@ } - private function menuClickHandler(e:MenuEvent):void { - // case 1 is the separator and can never get called - switch (e.index) { - case 0: - clearAllStatus(); - break; - case 1: - muteAll(); - break; - case 2: - muteAlmostAll(); + private function menuClickHandler(e:MenuEvent):void + { + if(baseIndex == 0) //not a moderator + { + changeStatusHandler(e.index) + } + + else if(baseIndex == 1) //i'm a moderator and there is NOT the "mute all except" option + { + switch (e.index) { + case 0: + clearAllStatus(); + break; + case 1: + muteAll(); + break; + default: + changeStatusHandler(e.index); + } + } + + else //i'm a moderator and the option "mute all except" is enabled + { + switch (e.index) { + case 0: + clearAllStatus(); + break; + case 1: + muteAll(); + break; + case 2: + muteAlmostAll(); + break; + default: + changeStatusHandler(e.index); + } } } + + private function changeStatusHandler(index:int):void { + switch (index) { + case baseIndex+1: + changeStatus(ChangeStatusEvent.CLEAR_STATUS); + break; + case baseIndex+2: + changeStatus(ChangeStatusEvent.RAISE_HAND); + break; + case baseIndex+3: + changeStatus(ChangeStatusEvent.AGREE); + break; + case baseIndex+4: + changeStatus(ChangeStatusEvent.DISAGREE); + break; + case baseIndex+5: + changeStatus(ChangeStatusEvent.SPEAK_LOUDER); + break; + case baseIndex+6: + changeStatus(ChangeStatusEvent.SPEAK_LOWER); + break; + case baseIndex+7: + changeStatus(ChangeStatusEvent.SPEAK_FASTER); + break; + case baseIndex+8: + changeStatus(ChangeStatusEvent.SPEAK_SLOWER); + break; + case baseIndex+9: + changeStatus(ChangeStatusEvent.BE_RIGHT_BACK); + break; + case baseIndex+10: + changeStatus(ChangeStatusEvent.LAUGHTER); + break; + case baseIndex+11: + changeStatus(ChangeStatusEvent.SAD); + } + } + + private function changeStatus(whichStatus:String):void + { + var e:ChangeStatusEvent = new ChangeStatusEvent(UserManager.getInstance().getConference().getMyUserId(), whichStatus); + dispatchEvent(e); + + } + private function setRoomMute(e:UsersEvent):void { roomMuted = e.mute_state; @@ -465,7 +481,7 @@ tabIndex="{partOptions.baseTabIndex+5}" accessibilityName="{ResourceUtil.getInstance().getString('bbb.users.usersGrid.accessibilityName')}" > - @@ -480,11 +496,6 @@ click="openSettings()" visible="true" tabIndex="{partOptions.baseTabIndex+10}" /> - -