fixed removing presentation

This commit is contained in:
adam-sharpe 2014-08-15 12:47:15 -07:00
parent 9762e02b22
commit 8563812446
5 changed files with 45 additions and 7 deletions

View File

@ -78,6 +78,9 @@ trait PresentationApp {
sharePresentation(msg.presentationID, false);
}
})
outGW.send(new RemovePresentationOutMsg(msg.meetingID, recorded, msg.presentationID))
}
def handleGetPresentationInfo(msg: GetPresentationInfo) {

View File

@ -9,6 +9,8 @@ package org.bigbluebutton.modules.present.services
import org.bigbluebutton.modules.present.events.PageChangedEvent;
import org.bigbluebutton.modules.present.events.PageMovedEvent;
import org.bigbluebutton.modules.present.events.PresentationChangedEvent;
import org.bigbluebutton.modules.present.events.RemovePresentationEvent;
import org.bigbluebutton.modules.present.events.UploadEvent;
import org.bigbluebutton.modules.present.model.Page;
import org.bigbluebutton.modules.present.model.Presentation;
import org.bigbluebutton.modules.present.model.PresentationModel;
@ -149,5 +151,18 @@ package org.bigbluebutton.modules.present.services
trace(LOG + "Switching presentation but presentation [" + presVO.id + "] is not current [" + presVO.isCurrent() + "]");
}
}
public function removePresentation(presentationID:String):void {
var removedEvent:RemovePresentationEvent = new RemovePresentationEvent(RemovePresentationEvent.PRESENTATION_REMOVED_EVENT);
removedEvent.presentationName = presentationID;
dispatcher.dispatchEvent(removedEvent);
if(presentationID == model.getCurrentPresentation().id) {
var uploadEvent:UploadEvent = new UploadEvent(UploadEvent.CLEAR_PRESENTATION);
dispatcher.dispatchEvent(uploadEvent);
}
model.removePresentation(presentationID);
}
}
}

View File

@ -197,10 +197,12 @@ package org.bigbluebutton.modules.present.services.messaging
}
private function handleRemovePresentationCallback(msg:Object):void {
trace(LOG + "***TODO: handleRemovePresentationCallback " + msg.msg + " **** \n");
var e:RemovePresentationEvent = new RemovePresentationEvent(RemovePresentationEvent.PRESENTATION_REMOVED_EVENT);
e.presentationName = msg.presentationID;
// dispatcher.dispatchEvent(e);
trace(LOG + "***DOING: handleRemovePresentationCallback " + msg.msg + " **** \n");
var map:Object = JSON.parse(msg.msg);
if(map.hasOwnProperty("presentationID")) {
service.removePresentation(map.presentationID);
}
}
private function handleConversionCompletedUpdateMessageCallback(msg:Object) : void {

View File

@ -39,15 +39,18 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mate:Listener type="{ConversionUnsupportedDocEvent.UNSUPPORTED_DOC}" method="handleUnsupportedDocument"/>
<mate:Listener type="{ConversionPageCountError.PAGE_COUNT_ERROR}" method="handlePageCountFailed"/>
<mate:Listener type="{ConversionPageCountMaxed.PAGE_COUNT_MAXED}" method="handlePageCountExceeded"/>
<mate:Listener type="{RemovePresentationEvent.PRESENTATION_REMOVED_EVENT}" method="handlePresentationRemoved" />
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import mx.collections.*;
import mx.events.FlexEvent;
import mx.events.ValidationResultEvent;
import mx.managers.PopUpManager;
import mx.utils.*;
import mx.validators.*;
import mx.validators.*;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.modules.present.commands.UploadFileCommand;
@ -280,6 +283,15 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function enableClosing():void {
okCancelBtn.enabled = true;
}
private function handlePresentationRemoved(e:RemovePresentationEvent):void {
for(var i:int = 0; i < presentationNamesAC.length; i++) {
if(e.presentationName == presentationNamesAC.getItemAt(i).id) {
presentationNamesAC.removeItemAt(i);
return;
}
}
}
]]>
</mx:Script>

View File

@ -479,11 +479,17 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function clearPresentation(e:UploadEvent):void{
slideView.visible = false;
slideView.visible = false;
slideView.slideLoader.source = null;
slideView.setSelectedSlide(0);
btnSlideNum.label = "";
displaySlideNavigationControls(false);
backButton.visible = false;
forwardButton.visible = false;
zoomSlider.visible = false;
btnSlideNum.visible = false;
btnFitToWidth.visible = false;
btnFitToPage.visible = false;
// Change the title of the window.
currentPresentation = ResourceUtil.getInstance().getString('bbb.presentation.title');