diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/events/ClosePendingGuestWindow.as b/bigbluebutton-client/src/org/bigbluebutton/core/events/ClosePendingGuestWindow.as new file mode 100644 index 0000000000..5e9a69a8bd --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/core/events/ClosePendingGuestWindow.as @@ -0,0 +1,14 @@ +package org.bigbluebutton.core.events +{ + import flash.events.Event; + + public class ClosePendingGuestWindow extends Event + { + public static const CLOSE_PENDING_GUEST_WINDOW: String = "CLOSE_PENDING_GUEST_WINDOW"; + + public function ClosePendingGuestWindow() + { + super(CLOSE_PENDING_GUEST_WINDOW, false, false); + } + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml index a86858e866..6807b60756 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml @@ -73,6 +73,7 @@ with BigBlueButton; if not, see . + . import org.bigbluebutton.core.events.NewGuestWaitingEvent; import org.bigbluebutton.core.events.RoundTripLatencyReceivedEvent; import org.bigbluebutton.core.events.SwitchedLayoutEvent; + import org.bigbluebutton.core.events.ClosePendingGuestWindow; + import org.bigbluebutton.core.model.LiveMeeting; import org.bigbluebutton.core.vo.LockSettingsVO; import org.bigbluebutton.main.events.AppVersionEvent; import org.bigbluebutton.main.events.BBBEvent; @@ -183,6 +186,8 @@ with BigBlueButton; if not, see . private var resizeExecuting:Boolean = false; private var _respTimer:ResponsivenessTimer; + + private var guestWindow:PendingGuestsWindow; public function getLogWindow() : LogWindow { @@ -332,19 +337,30 @@ with BigBlueButton; if not, see . } private function refreshGuestView(evt:NewGuestWaitingEvent):void { - LOGGER.debug("NewGuestWaitingEvent"); + LOGGER.debug("NewGuestWaitingEvent"); // do not show the guest window if the user isn't moderator or if he's waiting for acceptance if (!UsersUtil.amIModerator() || UsersUtil.amIWaitingForAcceptance() && usersOptions.enableGuestUI) { return; } - LOGGER.debug("OPENING GUEST WINDOW"); - var guestWindow:PendingGuestsWindow = PopUpUtil.createModalPopUp( mdiCanvas, PendingGuestsWindow, false) as PendingGuestsWindow; + var guestUsers:ArrayCollection = new ArrayCollection(LiveMeeting.inst().guestsWaiting.getGuests()); + + LOGGER.debug("OPENING GUEST WINDOW"); + if (guestWindow == null) { + guestWindow = PopUpUtil.createModalPopUp( mdiCanvas, PendingGuestsWindow, false) as PendingGuestsWindow; guestWindow.x = systemManager.screen.width - guestWindow.width - 20; guestWindow.y = 20; + } guestWindow.refreshGuestView(); } + private function handleClosePendingGuestWindow(event: ClosePendingGuestWindow): void { + if (guestWindow != null) { + PopUpUtil.removePopUp(guestWindow); + guestWindow = null; + } + } + public function removeGuestWindow(evt:BBBEvent):void { LOGGER.debug("REMOVE GUEST WINDOW"); //if (guestWindow != null) { diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/PendingGuestsWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/PendingGuestsWindow.mxml index 51afb426d9..de2390f838 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/PendingGuestsWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/PendingGuestsWindow.mxml @@ -32,6 +32,7 @@ $Id: $ + @@ -45,6 +46,8 @@ $Id: $ import org.bigbluebutton.core.model.LiveMeeting; import org.bigbluebutton.core.model.users.GuestWaiting; import org.bigbluebutton.main.events.BBBEvent; + import org.bigbluebutton.core.events.GuestWaitingApprovedEvent; + import org.bigbluebutton.core.events.ClosePendingGuestWindow; import org.bigbluebutton.main.events.RemoveGuestEvent; import org.bigbluebutton.main.events.RemoveGuestFromViewEvent; import org.bigbluebutton.main.events.ResponseModeratorEvent; @@ -90,6 +93,13 @@ $Id: $ public function denyAllWaitingGuests(event:BBBEvent):void { sendResponseToAllGuests(false); } + + private function handleGuestWaitingApprovedEvent(event: GuestWaitingApprovedEvent): void { + refreshGuestView(); + if (guestUsers.length == 0) { + closeWindow(); + } + } public function removeAllGuests():void { closeWindow(); @@ -108,7 +118,8 @@ $Id: $ } public function closeWindow():void { - PopUpUtil.removePopUp(this); + var event:ClosePendingGuestWindow = new ClosePendingGuestWindow(); + dispatcher.dispatchEvent(event); } ]]>