diff --git a/bigbluebutton-client/branding/default/style/css/BBBDefault.css b/bigbluebutton-client/branding/default/style/css/BBBDefault.css index 8fec8c8fc0..36bb8d9a22 100755 --- a/bigbluebutton-client/branding/default/style/css/BBBDefault.css +++ b/bigbluebutton-client/branding/default/style/css/BBBDefault.css @@ -297,7 +297,7 @@ DataGrid { .presentationUploadButtonStyle, .presentationBackButtonStyle, .presentationBackButtonDisabledStyle, .presentationForwardButtonStyle, .presentationForwardButtonDisabledStyle, -.presentationFitToWidthButtonStyle, .presentationFitToPageButtonStyle, .presentationDownloadButtonStyle +.presentationFitToWidthButtonStyle, .presentationFitToPageButtonStyle, .presentationDownloadButtonStyle, .presentationDownloadButtonDisabledStyle { textIndent: 0; paddingLeft: 10; @@ -347,6 +347,10 @@ DataGrid { .presentationDownloadButtonStyle { icon: Embed('assets/images/ic_file_download_16px.png'); } +.presentationDownloadButtonDisabledStyle { + icon: Embed('assets/images/ic_file_download_grey_16px.png'); +} + .presentationZoomSliderStyle{ labelOffset: 0; diff --git a/bigbluebutton-client/branding/default/style/css/assets/images/ic_file_download_grey_16px.png b/bigbluebutton-client/branding/default/style/css/assets/images/ic_file_download_grey_16px.png new file mode 100644 index 0000000000..c375962ff3 Binary files /dev/null and b/bigbluebutton-client/branding/default/style/css/assets/images/ic_file_download_grey_16px.png differ diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RemovePresentationEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RemovePresentationEvent.as index 34f3c43829..4eb492588d 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RemovePresentationEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RemovePresentationEvent.as @@ -27,6 +27,9 @@ package org.bigbluebutton.modules.present.events // Presentation has been removed from server. public static const PRESENTATION_REMOVED_EVENT:String = "Presentation Removed Event"; + + // Presentation removed from the list of downloadable events. + public static const PRESENTATION_NOT_DOWNLOADABLE_EVENT:String = "Presentation Can't Be Downloaded Event"; public var presentationName:String; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as index d680064484..5e2ee551ef 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as @@ -169,6 +169,8 @@ package org.bigbluebutton.modules.present.services } model.removePresentation(presentationID); + var notDownloadableEvent:RemovePresentationEvent = new RemovePresentationEvent(RemovePresentationEvent.PRESENTATION_NOT_DOWNLOADABLE_EVENT); + dispatcher.dispatchEvent(notDownloadableEvent); //this event will trigger the disabling of the download button. } } } \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml index 825e52595a..0190107bed 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml @@ -60,8 +60,8 @@ with BigBlueButton; if not, see . - - + + . import org.bigbluebutton.modules.present.events.UploadEvent; import org.bigbluebutton.modules.present.events.DownloadEvent; import org.bigbluebutton.modules.present.events.WindowResizedEvent; + import org.bigbluebutton.modules.present.events.RemovePresentationEvent; import org.bigbluebutton.modules.present.managers.Slide; import org.bigbluebutton.modules.present.model.Page; import org.bigbluebutton.modules.present.model.PresentationModel; @@ -376,6 +377,7 @@ with BigBlueButton; if not, see . displaySlideNavigationControls(false, !!page) } onResetZoom(); + downloadAvailable(); } @@ -601,6 +603,27 @@ with BigBlueButton; if not, see . } } + + private function handlePresentationNotDownloadable(e:RemovePresentationEvent):void{ + downloadAvailable(); + } + + + private function downloadAvailable():void{ + var isAnyPres:ArrayCollection = PresentationModel.getInstance().getDownloadablePresentations(); + if(isAnyPres.length != 0){ + trace(LOG+"Enabling dowload presentation button. There are " + isAnyPres.length + " presentations available for downloading."); + downloadPres.enabled = true; + downloadPres.styleName = "presentationDownloadButtonStyle"; + } + else + { + trace(LOG+"Disabling download presentation button. There are " + isAnyPres.length + " presentations available for downloading."); + downloadPres.enabled = false; + downloadPres.styleName = "presentationDownloadButtonDisabledStyle"; + } + } + ]]> @@ -610,9 +633,9 @@ with BigBlueButton; if not, see . - + click="onDownloadButtonClicked()" tabIndex="{baseIndex+5}" creationComplete="downloadAvailable()"/>