- cleanup

- enable/disable phone button when call is connected/disconnected

git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@2118 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
Richard Alam 2009-08-06 15:31:18 +00:00
parent 0aa25569ba
commit 371b45cb01
9 changed files with 44 additions and 15 deletions

View File

@ -9,7 +9,7 @@ package org.bigbluebutton.modules.phone.events
public var publishStreamName:String;
public var playStreamName:String;
public function CallConnectedEvent(bubbles:Boolean=false, cancelable:Boolean=false)
public function CallConnectedEvent(bubbles:Boolean=true, cancelable:Boolean=false)
{
super(CALL_CONNECTED_EVENT, bubbles, cancelable);
}

View File

@ -6,7 +6,7 @@ package org.bigbluebutton.modules.phone.events
{
public static const CALL_DISCONNECTED_EVENT:String = 'CALL_DISCONNECTED_EVENT';
public function CallDisconnectedEvent(bubbles:Boolean=false, cancelable:Boolean=false)
public function CallDisconnectedEvent(bubbles:Boolean=true, cancelable:Boolean=false)
{
super(CALL_DISCONNECTED_EVENT, bubbles, cancelable);
}

View File

@ -19,7 +19,10 @@
*/
package org.bigbluebutton.modules.phone.managers {
import com.asfusion.mate.events.Dispatcher;
import flash.events.AsyncErrorEvent;
import flash.events.Event;
import flash.events.IEventDispatcher;
import flash.events.NetStatusEvent;
import flash.events.SecurityErrorEvent;
@ -146,7 +149,7 @@ package org.bigbluebutton.modules.phone.managers {
trace("Call has been disconnected.");
isConnected = false;
var event:CallDisconnectedEvent = new CallDisconnectedEvent();
localDispatcher.dispatchEvent(event);
localDispatcher.dispatchEvent(event);
}
}
@ -157,8 +160,8 @@ package org.bigbluebutton.modules.phone.managers {
event.publishStreamName = publishName;
event.playStreamName = playName;
localDispatcher.dispatchEvent(event);
}
}
//********************************************************************************************
//
// SIP Actions

View File

@ -3,6 +3,7 @@
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import org.bigbluebutton.modules.phone.events.CallDisconnectedEvent;
import org.bigbluebutton.modules.phone.events.CallConnectedEvent;
import org.bigbluebutton.modules.phone.events.RegistrationSuccessEvent;
import org.bigbluebutton.core.events.ConnectionStatusEvent;
@ -49,9 +50,14 @@
<MethodInvoker generator="{PhoneManager}" method="dialConference"/>
</EventHandlers>
<EventHandlers type="{CallConnectedEvent.CALL_CONNECTED_EVENT}">
<EventHandlers type="{CallConnectedEvent.CALL_CONNECTED_EVENT}">
<MethodInvoker generator="{PhoneLocalEventMapDelegate}" method="disableToolbarButton"/>
<MethodInvoker generator="{PhoneManager}" method="callConnected" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{CallDisconnectedEvent.CALL_DISCONNECTED_EVENT}">
<MethodInvoker generator="{PhoneLocalEventMapDelegate}" method="enableToolbarButton"/>
</EventHandlers>
<EventHandlers type="{ConnectionStatusEvent.CONNECTION_STATUS_EVENT}">
<MethodInvoker generator="{PhoneManager}" method="register"/>

View File

@ -48,5 +48,13 @@ package org.bigbluebutton.modules.phone.maps
buttonOpen = false;
}
public function disableToolbarButton():void {
phoneButton.enabled = false;
}
public function enableToolbarButton():void {
phoneButton.enabled = true;
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 700 B

View File

@ -17,16 +17,12 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package org.bigbluebutton.modules.phone.view.components
package org.bigbluebutton.modules.phone.views.assets
{
[Bindable]
public class Images
{
[Embed(source="../assets/images/stop.png")]
public var stop:Class;
[Embed(source="../assets/images/phone_sound.png")]
{
[Embed(source="images/phone_sound.png")]
public var phone_sound_icon:Class;
}

View File

@ -21,11 +21,18 @@
-->
<mx:Button xmlns:mx="http://www.adobe.com/2006/mxml"
icon="{phoneIcon}" click="startPhone()">
icon="{phoneIcon}" click="startPhone()"
xmlns:mate="http://mate.asfusion.com/">
<mate:Listener type="{CallConnectedEvent.CALL_CONNECTED_EVENT}" method="handleCallConnectedEvent"/>
<mate:Listener type="{CallDisconnectedEvent.CALL_DISCONNECTED_EVENT}" method="handleCallDisconnectedEvent"/>
<mx:Script>
<![CDATA[
import org.bigbluebutton.modules.phone.events.CallDisconnectedEvent;
import org.bigbluebutton.modules.phone.events.CallConnectedEvent;
import org.bigbluebutton.modules.phone.events.JoinVoiceConferenceEvent;
import org.bigbluebutton.modules.phone.view.components.Images;
import org.bigbluebutton.modules.phone.views.assets.Images;
private var images:Images = new Images();
private var localDispatcher:IEventDispatcher;
@ -39,6 +46,15 @@
public function setLocalDispatcher(dispatcher:IEventDispatcher):void {
localDispatcher = dispatcher;
}
private function handleCallConnectedEvent(event:CallConnectedEvent):void {
this.enabled = false;
}
private function handleCallDisconnectedEvent(event:CallConnectedEvent):void {
this.enabled = true;
}
]]>
</mx:Script>
</mx:Button>