Add Setting Button and Remember Guest Window

This commit is contained in:
Hugo Lazzari 2013-02-22 01:08:21 -03:00
parent d095305d69
commit 65b75e72ad
10 changed files with 132 additions and 22 deletions

View File

@ -177,5 +177,9 @@ package org.bigbluebutton.common
[Embed(source="assets/images/shape_handles.png")]
public var shape_handles:Class;
[Embed(source="assets/images/wrench.png")]
public var wrench:Class;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

View File

@ -33,6 +33,7 @@ package org.bigbluebutton.main.model.users
import org.bigbluebutton.main.events.UserServicesEvent;
import org.bigbluebutton.main.events.ResponseModeratorEvent;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.LogoutEvent;
import org.bigbluebutton.main.model.ConferenceParameters;
import org.bigbluebutton.main.model.users.events.BroadcastStartedEvent;
import org.bigbluebutton.main.model.users.events.BroadcastStoppedEvent;
@ -150,7 +151,7 @@ package org.bigbluebutton.main.model.users
}
public function denyGuest():void {
guestDisconnect();
dispatcher.dispatchEvent(new LogoutEvent(LogoutEvent.GUEST_KICKED_OUT));
}
public function newGuestPolicy(event:BBBEvent):void {

View File

@ -359,12 +359,7 @@ package org.bigbluebutton.main.model.users {
guestPolicy
); //_netConnection.call
if(guestPolicy == "ALWAYS_DENY") {
dispatcher.dispatchEvent(new BBBEvent("DENY_ALL_WAITING_GUESTS"));
}
else if(guestPolicy == "ALWAYS_ACCEPT") {
dispatcher.dispatchEvent(new BBBEvent("ACCEPT_ALL_WAITING_GUESTS"));
}
}
public function guestPolicyChanged(guestPolicy:String):void {

View File

@ -8,7 +8,6 @@
<mate:Listener type="GET_GUEST_POLICY" method="refreshGuestPolicy"/>
<mx:Script>
<![CDATA[
import mx.events.ItemClickEvent;
@ -66,12 +65,12 @@
else if(option == 1) {
event.payload['guestPolicy'] = "ALWAYS_ACCEPT";
dispatchEvent(event);
//Send Accept All Waiting Guests
dispatchEvent(new BBBEvent("ACCEPT_ALL_WAITING_GUESTS"));
}
else {
event.payload['guestPolicy'] = "ALWAYS_DENY";
dispatchEvent(event);
//Send Deny All Waiting Guests
dispatchEvent(new BBBEvent("DENY_ALL_WAITING_GUESTS"));
}
LogUtil.debug("SENDING TO SERVER POLICY");
PopUpManager.removePopUp(this);

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
BigBlueButton open source conferencing system - http://www.bigbluebutton.org
Copyright (c) 2010 BigBlueButton Inc. and by respective authors (see below).
BigBlueButton 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/>.
$Id: $
-->
<mx:Button xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:mate="http://mate.asfusion.com/"
icon="{wrenchIcon}" click="start()"
toolTip="{ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.stop')}"
implements="org.bigbluebutton.common.IBbbToolbarComponent"
>
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.util.i18n.ResourceUtil;
private var images:Images = new Images();
private var dispatcher:Dispatcher = new Dispatcher();
[Bindable] public var wrenchIcon:Class = images.wrench;
private function start():void {
this.enabled = false;
dispatcher.dispatchEvent(new BBBEvent("SHOW_BBB_SETTINGS"));
this.enabled = true;
}
//For whatever reason the tooltip does not update when localization is changed dynamically. Overrideing it here
override protected function resourcesChanged():void{
this.toolTip = ResourceUtil.getInstance().getString('bbb.toolbar.phone.toolTip.start');
}
public function getAlignment():String{
return MainToolbar.ALIGN_RIGHT;
}
]]>
</mx:Script>
</mx:Button>

View File

@ -118,6 +118,22 @@
dispatcher.dispatchEvent(respCommand);
}
public function sendResponseToAllGuestsCheckBox(resp:Boolean):void {
if(checkBoxR.selected) {
var event:BBBEvent = new BBBEvent("GUEST_POLICY");
if(resp) {
event.payload['guestPolicy'] = "ALWAYS_ACCEPT";
}
else {
event.payload['guestPolicy'] = "ALWAYS_DENY";
}
dispatchEvent(event);
}
sendResponseToAllGuests(resp);
}
public function acceptAllWaitingGuests(event:BBBEvent):void {
sendResponseToAllGuests(true);
@ -176,8 +192,9 @@
</mx:Script>
<mx:Label text="{ResourceUtil.getInstance().getString('bbb.guests.message', [String(numberOfGuests)])}"/>
<mx:HRule width="100%"/>
<mx:Button id="allowEveryoneBtn" label="{ResourceUtil.getInstance().getString('bbb.guests.allowEveryoneBtn.text')}" width="70%" click="sendResponseToAllGuests(true)" toolTip="{allowEveryoneBtn.label}"/>
<mx:Button id="denyEveryoneBtn" label="{ResourceUtil.getInstance().getString('bbb.guests.denyEveryoneBtn.text')}" width="70%" click="sendResponseToAllGuests(false)" toolTip="{denyEveryoneBtn.label}"/>
<mx:Button id="allowEveryoneBtn" label="{ResourceUtil.getInstance().getString('bbb.guests.allowEveryoneBtn.text')}" width="70%" click="sendResponseToAllGuestsCheckBox(true)" toolTip="{allowEveryoneBtn.label}"/>
<mx:Button id="denyEveryoneBtn" label="{ResourceUtil.getInstance().getString('bbb.guests.denyEveryoneBtn.text')}" width="70%" click="sendResponseToAllGuestsCheckBox(false)" toolTip="{denyEveryoneBtn.label}"/>
<mx:CheckBox id="checkBoxR" label="Remember my action to all other users"/>
<mx:HRule width="100%"/>
</mx:TitleWindow>

View File

@ -35,6 +35,9 @@
[Bindable] private var message:String = "You have logged out of the conference";
private var urlLoader:URLLoader;
private var timer:Timer = null;
private var reason:String;
private function init():void {
addEventListener(Event.CLOSE, onUserLoggedOutWindowClose);
@ -61,10 +64,19 @@
private function onUserLoggedOutWindowClose(e:Event):void {
PopUpManager.removePopUp(this);
}
private function reSetReason(evt:TimerEvent):void {
var tmr:Timer = evt.currentTarget as Timer;
if(tmr.currentCount > 10)
tmr.stop();
setReason(reason);
}
public function setReason(reason:String):void{
this.reason = reason;
switch(reason){
case ConnectionFailedEvent.APP_SHUTDOWN:
message = ResourceUtil.getInstance().getString('bbb.logout.appshutdown');
@ -94,10 +106,23 @@
message = ResourceUtil.getInstance().getString('bbb.logout.guestkickedout');
break;
}
if(message == null) {
if(timer == null) {
timer = new Timer(100);
timer.addEventListener(TimerEvent.TIMER, reSetReason);
timer.start();
}
}
else if(timer != null)
timer.stop();
}
]]>
</mx:Script>
<mx:Button id="okBtn" label="OK" click="redirect()"/>
<mx:Label text="{message}"/>
<mx:Button id="okBtn" label="OK" click="redirect()"/>
</mx:TitleWindow>

View File

@ -44,6 +44,7 @@
<mate:Listener type="{WaitModeratorEvent.USER_LOGGED_IN}" method="openWaitWindow" />
<mate:Listener type="{RemoveGuestRequestEvent.GUEST_EVENT}" method="removeGuestWindow" />
<mate:Listener type="SHOW_MIC_SETTINGS" method="showMicSettings" />
<mate:Listener type="SHOW_BBB_SETTINGS" method="showBBBSettings" />
<mate:Listener type="{NewGuestEvent.NEW_GUEST_EVENT}" method="newGuestWindow" />
<mate:Listener type="{ModeratorRespEvent.GUEST_ALLOWED}" method="guestAllowed" />
<mate:Listener type="GET_GUEST_POLICY" method="setGuestPolicy"/>
@ -87,7 +88,6 @@
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
import org.bigbluebutton.util.logging.Logger;
private var globalDispatcher:Dispatcher;
private var dispState:String; //full-screen?
@ -132,6 +132,7 @@
LogUtil.debug("*** show toolbar = " + layoutOptions.showToolbar);
toolbar.displayToolbar();
}
private function setGuestPolicy(event:BBBEvent):void {
@ -288,16 +289,20 @@
}
private function showMicSettings(event:BBBEvent):void {
//var micSettings:MicSettings = MicSettings(PopUpManager.createPopUp(mdiCanvas, MicSettings, true));
//var point1:Point = new Point();
// Calculate position of TitleWindow in Application's coordinates.
//point1.x = width/2;
//point1.y = height/2;
//micSettings.x = point1.x - (micSettings.width/2);
//micSettings.y = point1.y - (micSettings.height/2);
var micSettings:MicSettings = MicSettings(PopUpManager.createPopUp(mdiCanvas, MicSettings, true));
var point1:Point = new Point();
//Calculate position of TitleWindow in Application's coordinates.
point1.x = width/2;
point1.y = height/2;
micSettings.x = point1.x - (micSettings.width/2);
micSettings.y = point1.y - (micSettings.height/2);
}
private function showBBBSettings(event:BBBEvent):void {
var bbbSettings:BBBSettings = BBBSettings(PopUpManager.createPopUp(mdiCanvas, BBBSettings, true));
bbbSettings.setGuestPolicy(guestPolicy);
var point1:Point = new Point();

View File

@ -157,6 +157,8 @@
<mx:HBox id="addedBtns">
</mx:HBox>
<mx:Spacer width="100%"/>
<views:BBBSettingsButton id="bbbSetting" visible="true"/>
<views:LanguageSelector id="langSelector" visible="false" />
<mx:LinkButton id="helpBtn" label="{ResourceUtil.getInstance().getString('bbb.mainToolbar.helpBtn')}" visible="{showHelpBtn}" click="onHelpButtonClicked()"/>
<mx:Button label="{ResourceUtil.getInstance().getString('bbb.mainToolbar.logoutBtn')}" id="btnLogout"