Improve guest management settings window.

This commit is contained in:
Ghazi Triki 2017-10-23 22:33:23 +01:00
parent 70654a5e63
commit 6d09be933c
11 changed files with 150 additions and 249 deletions

View File

@ -831,7 +831,7 @@ presentation|FileExportWindow {
//------------------------------
*/
views|BBBSettings {
views|GuestSettingsWindow {
headerHeight : 0;
}

View File

@ -1,39 +0,0 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2010 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*
*/
package org.bigbluebutton.common.events
{
import flash.events.Event;
import mx.core.UIComponent;
public class SettingsComponentEvent extends Event
{
public static const ADD:String = "Add Component Event";
public static const REMOVE:String = "Remove Component Event";
public var component:UIComponent;
public function SettingsComponentEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
{
super(type, bubbles, cancelable);
}
}
}

View File

@ -1,3 +1,21 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.model
{
import org.bigbluebutton.core.model.users.GuestsApp;

View File

@ -1,3 +1,21 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.model
{
import org.bigbluebutton.core.vo.LockSettingsVO;

View File

@ -49,13 +49,9 @@ package org.bigbluebutton.main.events {
public static const JOIN_VOICE_FOCUS_HEAD:String = "JOIN_VOICE_FOCUS_HEAD";
public static const CHANGE_RECORDING_STATUS:String = "CHANGE_RECORDING_STATUS";
public static const SETTINGS_CONFIRMED:String = "BBB_SETTINGS_CONFIRMED";
public static const SETTINGS_CANCELLED:String = "BBB_SETTINGS_CANCELLED";
public static const ACCEPT_ALL_WAITING_GUESTS:String = "BBB_ACCEPT_ALL_WAITING_GUESTS";
public static const DENY_ALL_WAITING_GUESTS:String = "BBB_DENY_ALL_WAITING_GUESTS";
public static const BROADCAST_GUEST_POLICY:String = "BBB_BROADCAST_GUEST_POLICY";
public static const RETRIEVE_GUEST_POLICY:String = "BBB_RETRIEVE_GUEST_POLICY";
public static const MODERATOR_ALLOWED_ME_TO_JOIN:String = "MODERATOR_ALLOWED_ME_TO_JOIN";
public static const WAITING_FOR_MODERATOR_ACCEPTANCE:String = "WAITING_FOR_MODERATOR_ACCEPTANCE";
public static const ADD_GUEST_TO_LIST:String = "ADD_GUEST_TO_LIST";

View File

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:common="org.bigbluebutton.common.*"
xmlns:mate="http://mate.asfusion.com/"
implements="org.bigbluebutton.common.IKeyboardClose"
show="this.setFocus()"
layout="vertical"
horizontalAlign="center"
showCloseButton="false"
minWidth="250"
creationComplete="init()">
<fx:Script>
<![CDATA[
import mx.core.UIComponent;
import mx.managers.PopUpManager;
import org.bigbluebutton.common.IKeyboardClose;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
private function init():void {
this.x = (this.parent.width - this.width) / 2;
this.y = (this.parent.height - this.height) / 2;
}
public function pushComponents(components:Array):void {
for (var i:int = 0; i < components.length; ++i) {
addedComponents.addChildAt(components[i] as UIComponent, 0);
}
}
private function onCancelClicked():void {
var event:BBBEvent = new BBBEvent(BBBEvent.SETTINGS_CANCELLED);
dispatchEvent(event);
close();
}
private function onOkClicked():void {
var event:BBBEvent = new BBBEvent(BBBEvent.SETTINGS_CONFIRMED);
dispatchEvent(event);
close();
}
private function close():void {
PopUpManager.removePopUp(this);
}
]]>
</fx:Script>
<common:AdvancedLabel text="{ResourceUtil.getInstance().getString('bbb.settings.title')}"
styleName="titleWindowStyle"
width="{this.width - 40}" />
<mx:VBox id="addedComponents" paddingTop="12" height="100%" />
<mx:ControlBar width="100%" horizontalAlign="right">
<mx:Button id="okBtn" styleName="mainActionButton" label="{ResourceUtil.getInstance().getString('bbb.settings.ok')}" click="onOkClicked()"/>
<mx:Button id="cancelBtn" label="{ResourceUtil.getInstance().getString('bbb.settings.cancel')}" click="onCancelClicked()"/>
</mx:ControlBar>
</mx:TitleWindow>

View File

@ -1,106 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mate="http://mate.asfusion.com/"
horizontalGap="30"
width="400">
<fx:Declarations>
<mate:Listener type="{BBBEvent.RETRIEVE_GUEST_POLICY}" method="refreshGuestPolicy"/>
<mate:Listener type="{BBBEvent.SETTINGS_CONFIRMED}" method="onOkClicked"/>
<mate:Listener type="{BBBEvent.SETTINGS_CANCELLED}" method="onCancelClicked"/>
</fx:Declarations>
<fx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import mx.events.ItemClickEvent;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.events.SettingsComponentEvent;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOGGER:ILogger = getClassLogger(GuestManagement);
private var option:Number = 0;
private var guestPolicy:String;
private function refreshGuestPolicy(event:BBBEvent):void {
setGuestPolicy(event.payload.guestPolicy);
}
public function setGuestPolicy(guestPolicy:String):void {
this.guestPolicy = guestPolicy;
if(guestPolicy == "ASK_MODERATOR") {
guestManagement.selectedValue = 0;
option = 0;
} else if(guestPolicy == "ALWAYS_ACCEPT") {
guestManagement.selectedValue = 1;
option = 1;
} else {
guestManagement.selectedValue = 2;
option = 2;
}
}
public function addToSettings():void {
var addGuestManagement:SettingsComponentEvent = new SettingsComponentEvent(SettingsComponentEvent.ADD);
addGuestManagement.component = this;
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(addGuestManagement);
}
private function onCancelClicked(e:Event = null):void {
setGuestPolicy(guestPolicy);
}
private function handleGuestClick(event:ItemClickEvent):void {
option = event.currentTarget.selectedValue;
}
private function onOkClicked(e:Event = null):void {
var event:BBBEvent = new BBBEvent(BBBEvent.BROADCAST_GUEST_POLICY);
if(option == 0) {
event.payload['guestPolicy'] = "ASK_MODERATOR";
dispatchEvent(event);
}
else if(option == 1) {
event.payload['guestPolicy'] = "ALWAYS_ACCEPT";
dispatchEvent(event);
dispatchEvent(new BBBEvent(BBBEvent.ACCEPT_ALL_WAITING_GUESTS));
}
else {
event.payload['guestPolicy'] = "ALWAYS_DENY";
dispatchEvent(event);
dispatchEvent(new BBBEvent(BBBEvent.DENY_ALL_WAITING_GUESTS));
}
LOGGER.debug("SENDING TO SERVER POLICY");
}
]]>
</fx:Script>
<mx:VBox width="30%" horizontalAlign="right">
<mx:Label text="{ResourceUtil.getInstance().getString('bbb.guests.Management')}"/>
</mx:VBox>
<mx:VBox width="70%">
<mx:RadioButtonGroup id="guestManagement" itemClick="handleGuestClick(event);"/>
<mx:RadioButton groupName="guestManagement"
id="askModerator"
label="{ResourceUtil.getInstance().getString('bbb.guests.askModerator')}"
value="0"
/>
<mx:RadioButton groupName="guestManagement"
id="alwaysAccept"
label="{ResourceUtil.getInstance().getString('bbb.guests.alwaysAccept')}"
value="1"
/>
<mx:RadioButton groupName="guestManagement"
id="AlwaysDeny"
label="{ResourceUtil.getInstance().getString('bbb.guests.alwaysDeny')}"
value="2"
/>
</mx:VBox>
</mx:HBox>

View File

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:common="org.bigbluebutton.common.*"
xmlns:mate="http://mate.asfusion.com/"
implements="org.bigbluebutton.common.IKeyboardClose"
initialize="init()"
show="this.setFocus()"
layout="vertical"
horizontalAlign="center"
showCloseButton="false"
minWidth="250">
<fx:Script>
<![CDATA[
import mx.events.ItemClickEvent;
import mx.managers.PopUpManager;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IKeyboardClose;
import org.bigbluebutton.core.model.LiveMeeting;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOGGER:ILogger = getClassLogger(GuestSettingsWindow);
private var option:Number = 0;
private var guestPolicy:String;
public function init():void {
this.guestPolicy = LiveMeeting.inst().guestsWaiting.getGuestPolicy();
if(guestPolicy == "ASK_MODERATOR") {
guestManagement.selectedValue = 0;
option = 0;
} else if(guestPolicy == "ALWAYS_ACCEPT") {
guestManagement.selectedValue = 1;
option = 1;
} else {
guestManagement.selectedValue = 2;
option = 2;
}
}
private function handleGuestClick(event:ItemClickEvent):void {
option = event.currentTarget.selectedValue;
}
private function onOkClicked(e:Event = null):void {
var event:BBBEvent = new BBBEvent(BBBEvent.BROADCAST_GUEST_POLICY);
if(option == 0) {
event.payload['guestPolicy'] = "ASK_MODERATOR";
dispatchEvent(event);
}
else if(option == 1) {
event.payload['guestPolicy'] = "ALWAYS_ACCEPT";
dispatchEvent(event);
dispatchEvent(new BBBEvent(BBBEvent.ACCEPT_ALL_WAITING_GUESTS));
}
else {
event.payload['guestPolicy'] = "ALWAYS_DENY";
dispatchEvent(event);
dispatchEvent(new BBBEvent(BBBEvent.DENY_ALL_WAITING_GUESTS));
}
LOGGER.debug("Sending guest policy update to server");
close();
}
private function close():void {
PopUpManager.removePopUp(this);
}
]]>
</fx:Script>
<common:AdvancedLabel text="{ResourceUtil.getInstance().getString('bbb.settings.title')}"
styleName="titleWindowStyle"
width="{this.width - 40}" />
<mx:VBox width="30%" horizontalAlign="right">
<mx:HBox horizontalGap="30"
width="400">
<mx:Label text="{ResourceUtil.getInstance().getString('bbb.guests.Management')}"/>
<mx:VBox width="70%">
<mx:RadioButtonGroup id="guestManagement" itemClick="handleGuestClick(event);"/>
<mx:RadioButton groupName="guestManagement"
id="askModerator"
label="{ResourceUtil.getInstance().getString('bbb.guests.askModerator')}"
value="0"
/>
<mx:RadioButton groupName="guestManagement"
id="alwaysAccept"
label="{ResourceUtil.getInstance().getString('bbb.guests.alwaysAccept')}"
value="1"
/>
<mx:RadioButton groupName="guestManagement"
id="AlwaysDeny"
label="{ResourceUtil.getInstance().getString('bbb.guests.alwaysDeny')}"
value="2"
/>
</mx:VBox>
</mx:HBox>
</mx:VBox>
<mx:ControlBar width="100%" horizontalAlign="right">
<mx:Button id="okBtn" styleName="mainActionButton" label="{ResourceUtil.getInstance().getString('bbb.settings.ok')}" click="onOkClicked()"/>
<mx:Button id="cancelBtn" label="{ResourceUtil.getInstance().getString('bbb.settings.cancel')}" click="close()"/>
</mx:ControlBar>
</mx:TitleWindow>

View File

@ -76,7 +76,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mate:Listener type="{LocaleChangeEvent.LOCALE_CHANGED}" method="onLocaleChanged" />
<mate:Listener type="{NetworkStatsEvent.OPEN_NETSTATS_WIN}" method="openNetworkStatsWindow" />
<mate:Listener type="{BBBEvent.RETRIEVE_GUEST_POLICY}" method="setGuestPolicy"/>
<mate:Listener type="{ConnectionFailedEvent.MODERATOR_DENIED_ME}" method="handleLogout" />
<mate:Listener type="{BBBEvent.MODERATOR_ALLOWED_ME_TO_JOIN}" method="guestAllowed" />
<mate:Listener type="{NewGuestWaitingEvent.NEW_GUEST_WAITING}" method="refreshGuestView" />
@ -99,7 +98,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import mx.binding.utils.ChangeWatcher;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.core.FlexGlobals;
import mx.core.IFlexDisplayObject;
import mx.core.UIComponent;
@ -192,7 +190,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
[Bindable] private var isTunneling:Boolean = false;
private var guestManagement:GuestManagement = null;
private var guest:Guest = new Guest();
private var guestPolicy:String = "ASK_MODERATOR";
@ -297,16 +294,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
if (heightWatch != null) heightWatch.unwatch();
}
private function setGuestPolicy(event:BBBEvent):void {
guestPolicy = event.payload.guestPolicy;
if(guestManagement == null) {
LOGGER.debug("ADD Guest Event");
guestManagement = new GuestManagement();
guestManagement.setGuestPolicy(guestPolicy);
guestManagement.addToSettings();
}
}
private function updateCopyrightLabelDimensions(e:Event = null):void {
var appWidth:Number = parentApplication.width;

View File

@ -44,8 +44,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mate:Listener type="{ShortcutEvent.FOCUS_LOGOUT_BUTTON}" method="focusLogoutButton" />
<mate:Listener type="{ConferenceCreatedEvent.CONFERENCE_CREATED_EVENT}" method="retrieveMeetingName" />
<mate:Listener type="{ConnectionFailedEvent.MODERATOR_DENIED_ME}" method="hideToolbar" />
<mate:Listener type="{SettingsComponentEvent.ADD}" method="addSettingsComponent" />
<mate:Listener type="{SettingsComponentEvent.REMOVE}" method="removeSettingsComponent"/>
<mate:Listener type="{BBBEvent.CHANGE_RECORDING_STATUS}" method="onRecordingStatusChanged" />
<mate:Listener type="{SuccessfulLoginEvent.USER_LOGGED_IN}" method="refreshModeratorButtonsVisibility" />
<mate:Listener type="{ChangeMyRole.CHANGE_MY_ROLE_EVENT}" method="refreshRole" />
@ -63,7 +61,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import mx.core.UIComponent;
import mx.events.CloseEvent;
import mx.events.ToolTipEvent;
import mx.managers.PopUpManager;
import flashx.textLayout.formats.Direction;
@ -71,7 +68,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.events.LocaleChangeEvent;
import org.bigbluebutton.common.events.SettingsComponentEvent;
import org.bigbluebutton.common.events.ToolbarButtonEvent;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.Options;
@ -129,7 +125,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private var xml:XML;
private var settingsComponents:Array = new Array();
private var settingsPopup:BBBSettings = null;
private function init():void{
toolbarOptions = Options.getOptions(LayoutOptions) as LayoutOptions;
@ -517,18 +512,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
logoSperatator.visible = logo.includeInLayout = false;
}
private function addSettingsComponent(e:SettingsComponentEvent = null):void {
settingsComponents.push(e.component);
}
private function removeSettingsComponent(e:SettingsComponentEvent = null):void {
throw("Not implemented");
}
private function onSettingsButtonClick():void {
settingsPopup = PopUpUtil.createModalPopUp(this.parent, BBBSettings, true) as BBBSettings;
settingsPopup.pushComponents(settingsComponents);
PopUpManager.centerPopUp(settingsPopup);
PopUpUtil.createModalPopUp(this.parent, GuestSettingsWindow, true) as GuestSettingsWindow;
}
private function refreshRole(e:ChangeMyRole):void {

View File

@ -885,9 +885,7 @@ package org.bigbluebutton.modules.users.services
var body: Object = msg.body as Object;
var policy: String = body.policy as String;
var policyEvent:BBBEvent = new BBBEvent(BBBEvent.RETRIEVE_GUEST_POLICY);
policyEvent.payload['guestPolicy'] = policy;
dispatcher.dispatchEvent(policyEvent);
LiveMeeting.inst().guestsWaiting.setGuestPolicy(policy);
}
public function handleGetGuestPolicyReply(msg:Object):void {
@ -896,10 +894,6 @@ package org.bigbluebutton.modules.users.services
var policy: String = body.policy as String;
LiveMeeting.inst().guestsWaiting.setGuestPolicy(policy);
var policyEvent:BBBEvent = new BBBEvent(BBBEvent.RETRIEVE_GUEST_POLICY);
policyEvent.payload['guestPolicy'] = policyEvent;
dispatcher.dispatchEvent(policyEvent);
}
public function handleGuestAccessDenied(msg:Object):void {