Show guest rejected message

The message window height still need to be fixed.
This commit is contained in:
Mateus Dalepiane 2014-10-22 17:36:48 -02:00
parent dfa32dcd6d
commit f0dc019311
4 changed files with 39 additions and 11 deletions

View File

@ -69,8 +69,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<MethodInvoker generator="{ModulesProxy}" method="startAllModules" /> <MethodInvoker generator="{ModulesProxy}" method="startAllModules" />
</EventHandlers> </EventHandlers>
<EventHandlers type="{LogoutEvent.GUEST_KICKED_OUT}" >
<MethodInvoker generator="{ModulesProxy}" method="handleLogout" />
</EventHandlers>
<mx:Script> <mx:Script>
<![CDATA[ <![CDATA[
import mx.events.FlexEvent; import mx.events.FlexEvent;

View File

@ -358,15 +358,16 @@ package org.bigbluebutton.main.model.users
} }
private function sendConnectionFailedEvent(reason:String):void{ private function sendConnectionFailedEvent(reason:String):void{
if (this.logoutOnUserCommand){
sendUserLoggedOutEvent();
return;
}
if (this.guestKickedOutCommand) { if (this.guestKickedOutCommand) {
sendGuestUserKickedOutEvent(); sendGuestUserKickedOutEvent();
return; return;
} }
if (this.logoutOnUserCommand){
sendUserLoggedOutEvent();
return;
}
var e:ConnectionFailedEvent = new ConnectionFailedEvent(reason); var e:ConnectionFailedEvent = new ConnectionFailedEvent(reason);
dispatcher.dispatchEvent(e); dispatcher.dispatchEvent(e);

View File

@ -232,7 +232,7 @@ package org.bigbluebutton.main.model.users
} }
public function guestDisconnect():void { public function guestDisconnect():void {
sender.guestDisconnect(); _connectionManager.guestDisconnect();
} }
public function isModerator():Boolean { public function isModerator():Boolean {

View File

@ -27,6 +27,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script> <mx:Script>
<![CDATA[ <![CDATA[
import mx.core.FlexGlobals; import mx.core.FlexGlobals;
import mx.events.FlexEvent;
import mx.managers.PopUpManager; import mx.managers.PopUpManager;
import org.bigbluebutton.common.LogUtil; import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB; import org.bigbluebutton.core.BBB;
@ -34,6 +35,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.util.i18n.ResourceUtil; import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOG:String = "Main::LoggedOutWindow - "; private static const LOG:String = "Main::LoggedOutWindow - ";
[Bindable] private var DISPLAY_MESSAGE_ONLY_STATE:String = "displayMessageOnlyState";
[Bindable] private var DISPLAY_RECONNECT_BUTTON_STATE:String = "displayReconnectButton";
[Bindable] private var message:String = "You have logged out of the conference"; [Bindable] private var message:String = "You have logged out of the conference";
private var urlLoader:URLLoader; private var urlLoader:URLLoader;
@ -83,31 +87,41 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
switch(reason){ switch(reason){
case ConnectionFailedEvent.APP_SHUTDOWN: case ConnectionFailedEvent.APP_SHUTDOWN:
message = ResourceUtil.getInstance().getString('bbb.logout.appshutdown'); message = ResourceUtil.getInstance().getString('bbb.logout.appshutdown');
setCurrentState(DISPLAY_MESSAGE_ONLY_STATE);
break; break;
case ConnectionFailedEvent.ASYNC_ERROR: case ConnectionFailedEvent.ASYNC_ERROR:
message = ResourceUtil.getInstance().getString('bbb.logout.asyncerror'); message = ResourceUtil.getInstance().getString('bbb.logout.asyncerror');
setCurrentState(DISPLAY_RECONNECT_BUTTON_STATE);
break; break;
case ConnectionFailedEvent.CONNECTION_CLOSED: case ConnectionFailedEvent.CONNECTION_CLOSED:
message = ResourceUtil.getInstance().getString('bbb.logout.connectionclosed'); message = ResourceUtil.getInstance().getString('bbb.logout.connectionclosed');
setCurrentState(DISPLAY_RECONNECT_BUTTON_STATE);
break; break;
case ConnectionFailedEvent.CONNECTION_FAILED: case ConnectionFailedEvent.CONNECTION_FAILED:
message = ResourceUtil.getInstance().getString('bbb.logout.connectionfailed'); message = ResourceUtil.getInstance().getString('bbb.logout.connectionfailed');
setCurrentState(DISPLAY_RECONNECT_BUTTON_STATE);
break; break;
case ConnectionFailedEvent.CONNECTION_REJECTED: case ConnectionFailedEvent.CONNECTION_REJECTED:
message = ResourceUtil.getInstance().getString('bbb.logout.rejected'); message = ResourceUtil.getInstance().getString('bbb.logout.rejected');
setCurrentState(DISPLAY_RECONNECT_BUTTON_STATE);
break; break;
case ConnectionFailedEvent.INVALID_APP: case ConnectionFailedEvent.INVALID_APP:
message = ResourceUtil.getInstance().getString('bbb.logout.invalidapp'); message = ResourceUtil.getInstance().getString('bbb.logout.invalidapp');
setCurrentState(DISPLAY_MESSAGE_ONLY_STATE);
break; break;
case ConnectionFailedEvent.UNKNOWN_REASON: case ConnectionFailedEvent.UNKNOWN_REASON:
message = ResourceUtil.getInstance().getString('bbb.logout.unknown'); message = ResourceUtil.getInstance().getString('bbb.logout.unknown');
setCurrentState(DISPLAY_RECONNECT_BUTTON_STATE);
break; break;
case ConnectionFailedEvent.USER_LOGGED_OUT: case ConnectionFailedEvent.USER_LOGGED_OUT:
message = ResourceUtil.getInstance().getString('bbb.logout.usercommand'); message = ResourceUtil.getInstance().getString('bbb.logout.usercommand');
setCurrentState(DISPLAY_MESSAGE_ONLY_STATE);
redirect(); // we know that the disconnect was requested so automatically redirect redirect(); // we know that the disconnect was requested so automatically redirect
break; break;
case ConnectionFailedEvent.GUEST_KICKED_OUT: case ConnectionFailedEvent.GUEST_KICKED_OUT:
message = ResourceUtil.getInstance().getString('bbb.logout.guestkickedout'); message = ResourceUtil.getInstance().getString('bbb.logout.guestkickedout');
setCurrentState(DISPLAY_MESSAGE_ONLY_STATE);
// setCurrentState(DISPLAY_RECONNECT_BUTTON_STATE);
break; break;
} }
} }
@ -117,11 +131,22 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
} }
]]> ]]>
</mx:Script> </mx:Script>
<mx:VBox width="100%" height="100%" horizontalAlign="center"> <mx:states>
<mx:State name="{DISPLAY_MESSAGE_ONLY_STATE}">
<mx:SetProperty target="{this}" name="height" value="{mainContainer.getExplicitOrMeasuredHeight()}"/>
</mx:State>
<mx:State name="{DISPLAY_RECONNECT_BUTTON_STATE}">
<mx:AddChild relativeTo="okBtn" position="after">
<mx:VBox id="reconnectDialog" width="100%" height="100%" horizontalAlign="center">
<mx:HRule width="100%"/>
<mx:Text width="380" textAlign="center" text="{ResourceUtil.getInstance().getString('bbb.logout.refresh.message')}" />
<mx:Button id="reconnectBtn" label="{ResourceUtil.getInstance().getString('bbb.logout.refresh.label')}" click="reconnect()" />
</mx:VBox>
</mx:AddChild>
</mx:State>
</mx:states>
<mx:VBox id="mainContainer" width="100%" height="100%" horizontalAlign="center">
<mx:Text text="{message}"/> <mx:Text text="{message}"/>
<mx:Button id="okBtn" label="{ResourceUtil.getInstance().getString('bbb.logout.button.label')}" click="redirect()"/> <mx:Button id="okBtn" label="{ResourceUtil.getInstance().getString('bbb.logout.button.label')}" click="redirect()"/>
<mx:HRule width="100%" />
<mx:Text width="380" textAlign="center" text="{ResourceUtil.getInstance().getString('bbb.logout.refresh.message')}" />
<mx:Button id="reconnectBtn" label="{ResourceUtil.getInstance().getString('bbb.logout.refresh.label')}" click="reconnect()" />
</mx:VBox> </mx:VBox>
</mx:TitleWindow> </mx:TitleWindow>