open display result window

This commit is contained in:
Richard Alam 2013-06-28 18:00:09 +00:00
parent ee3af50c08
commit bb4de5a889
5 changed files with 71 additions and 27 deletions

View File

@ -0,0 +1,22 @@
package org.bigbluebutton.modules.polling.events
{
import flash.events.Event;
public class OpenPollResultWindow extends Event
{
public static const OPEN_RESULT_WINDOW:String = "open poll result window";
private var _pollID:String;
public function OpenPollResultWindow(pollID:String)
{
super(OPEN_RESULT_WINDOW, true, false);
_pollID = pollID;
}
public function get pollID():String {
return _pollID;
}
}
}

View File

@ -35,6 +35,7 @@ package org.bigbluebutton.modules.polling.managers
import org.bigbluebutton.common.events.OpenWindowEvent;
import org.bigbluebutton.modules.polling.events.GenerateWebKeyEvent;
import org.bigbluebutton.modules.polling.events.OpenPollMainWindowEvent;
import org.bigbluebutton.modules.polling.events.OpenPollResultWindow;
import org.bigbluebutton.modules.polling.events.OpenSavedPollEvent;
import org.bigbluebutton.modules.polling.events.PollGetTitlesEvent;
import org.bigbluebutton.modules.polling.events.PollRefreshEvent;
@ -49,14 +50,14 @@ package org.bigbluebutton.modules.polling.managers
import org.bigbluebutton.modules.polling.model.PollingViewModel;
import org.bigbluebutton.modules.polling.service.PollingService;
import org.bigbluebutton.modules.polling.views.CreatePollWindow;
import org.bigbluebutton.modules.polling.views.DisplayResultWindow;
import org.bigbluebutton.modules.polling.views.PollCreateWindow;
import org.bigbluebutton.modules.polling.views.PollMainWindow;
import org.bigbluebutton.modules.polling.views.PollingInstructionsWindow;
import org.bigbluebutton.modules.polling.views.DisplayResultWindow;
import org.bigbluebutton.modules.polling.views.PollingStatsWindow;
import org.bigbluebutton.modules.polling.views.PollingViewWindow;
import org.bigbluebutton.modules.polling.views.TakePollWindow;
import org.bigbluebutton.modules.polling.views.UpdatePollWindow;
import org.bigbluebutton.modules.polling.views.UpdatePollWindow;
public class PollingWindowManager {
@ -72,7 +73,8 @@ package org.bigbluebutton.modules.polling.managers
private var takePollWindow:TakePollWindow;
private var pollMainWindow:PollMainWindow = new PollMainWindow();
private var createPollWindow:CreatePollWindow;
private var resultsWindow:DisplayResultWindow = new DisplayResultWindow();
private var displayResultWindow:DisplayResultWindow;
private var testCreateWindow:PollCreateWindow;
@ -93,10 +95,16 @@ package org.bigbluebutton.modules.polling.managers
}
public function handleOpenPollMainWindowEvent():void{
if (_viewModel == null) trace("***************** PollingWindowManager::handleOpenPollMainWindowEvent - viewModel is NULL!!!!!");
pollMainWindow.viewModel = _viewModel;
openWindow(pollMainWindow);
}
public function handleOpenPollResultWindowEvent(event:OpenPollResultWindow):void {
resultsWindow.viewModel = _viewModel;
resultsWindow.pollID = event.pollID;
openWindow(resultsWindow);
}
private function moveInstructionsFocus(event:TimerEvent):void{
appFM.setFocus(updatePollWindow.titleBarOverlay);

View File

@ -49,7 +49,11 @@
<EventHandlers type="{OpenPollMainWindowEvent.OPEN_POLL_MAIN_WINDOW}">
<MethodInvoker generator="{PollingWindowManager}" method="handleOpenPollMainWindowEvent" />
</EventHandlers>
<EventHandlers type="{OpenPollResultWindow.OPEN_RESULT_WINDOW}">
<MethodInvoker generator="{PollingWindowManager}" method="handleOpenPollResultWindowEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PollingInstructionsWindowEvent.CLOSE}">
<MethodInvoker generator="{PollingManager}" method="handleClosePollingInstructionsWindowEvent" arguments="{event}"/>
</EventHandlers>

View File

@ -39,6 +39,7 @@
import org.bigbluebutton.util.i18n.ResourceUtil;
[Bindable] public var viewModel:PollingViewModel;
[Bindable] public var pollID:String;
public function getPrefferedPosition():String{
return MainCanvas.POPUP;

View File

@ -49,6 +49,7 @@
import org.bigbluebutton.main.model.users.Conference;
import org.bigbluebutton.main.views.MainToolbar;
import org.bigbluebutton.modules.polling.events.OpenPollMainWindowEvent;
import org.bigbluebutton.modules.polling.events.OpenPollResultWindow;
import org.bigbluebutton.modules.polling.events.OpenSavedPollEvent;
import org.bigbluebutton.modules.polling.events.PollGetPollEvent;
import org.bigbluebutton.modules.polling.events.PollGetTitlesEvent;
@ -132,7 +133,7 @@
private function renderMenu():void{
myMenuData.removeAll();
myMenuData.addItem(new ValueObject("create", ResourceUtil.getInstance().getString('bbb.polling.createPoll')));
myMenuData.addItem(new ValueObject("show", "Show Polls"));
myMenuData.addItem(new ValueObject("show", "Show Result"));
for (var i:int = 0; i < pollList.length; i++){
if (pollList[i] != null){
var keyString:String = pollList[i].room +"-"+ pollList[i].title;
@ -172,36 +173,44 @@
}
private function menuClick(event:MenuEvent):void {
if(event.index == 0){
openMainPollingWindow();
}else{
var poll:PollObject = myMenuData.getItemAt(event.index).poll;
if (poll.status){
// Poll has not been used yet, open instructions window
var openPollEvent:OpenSavedPollEvent = new OpenSavedPollEvent(OpenSavedPollEvent.OPEN);
openPollEvent.poll = poll;
dispatchEvent(openPollEvent);
}else{
// Poll has been closed, show results
var reviewEvent:ReviewResultsEvent = new ReviewResultsEvent(ReviewResultsEvent.REVIEW);
reviewEvent.poll = poll;
dispatchEvent(reviewEvent);
}
}
stage.dispatchEvent(new MenuEvent(MenuEvent.MENU_HIDE));
}
if(event.index == 0){
openMainPollingWindow();
} else if (event.index == 1) {
openResultWindow();
}
else{
var poll:PollObject = myMenuData.getItemAt(event.index).poll;
if (poll.status){
// Poll has not been used yet, open instructions window
var openPollEvent:OpenSavedPollEvent = new OpenSavedPollEvent(OpenSavedPollEvent.OPEN);
openPollEvent.poll = poll;
dispatchEvent(openPollEvent);
}else{
// Poll has been closed, show results
var reviewEvent:ReviewResultsEvent = new ReviewResultsEvent(ReviewResultsEvent.REVIEW);
reviewEvent.poll = poll;
dispatchEvent(reviewEvent);
}
}
stage.dispatchEvent(new MenuEvent(MenuEvent.MENU_HIDE));
}
public function getAlignment():String{
return MainToolbar.ALIGN_RIGHT;
}
private function openMainPollingWindow():void {
dispatchEvent(new OpenPollMainWindowEvent());
this.enabled = false;
}
private function openResultWindow():void {
dispatchEvent(new OpenPollResultWindow("pollID"));
this.enabled = false;
}
private function remoteSwitch(e:ShortcutEvent):void{
if (this.toString() != REAL_BUTTON_ID){
updateMenuByShortcut(e);