Fixed layout lock issues and adjusted shared notes minimized window bar layout

This commit is contained in:
Pedro Beschorner Marin 2016-11-07 16:40:21 +00:00
parent ab8eb279a0
commit 51dc8322f0
6 changed files with 53 additions and 14 deletions

View File

@ -40,10 +40,20 @@ package org.bigbluebutton.common
MDIManager.CONTEXT_MENU_LABEL_CASCADE,
MDIManager.CONTEXT_MENU_LABEL_SHOW_ALL );
private static const LOCKABLE_MENU_ITEMS:Array = new Array(
MDIWindow.CONTEXT_MENU_LABEL_MINIMIZE,
MDIWindow.CONTEXT_MENU_LABEL_MAXIMIZE,
MDIWindow.CONTEXT_MENU_LABEL_RESTORE);
private var _customContextMenuItems:Array = null;
private var _unlocked:Boolean = true;
private function filterContextMenu(item:*, index:int, array:Array):Boolean {
return IGNORED_MENU_ITEMS.indexOf(item.caption) < 0;
var filter:Boolean = this._unlocked ?
IGNORED_MENU_ITEMS.indexOf(item.caption) < 0 :
IGNORED_MENU_ITEMS.indexOf(item.caption) < 0 && LOCKABLE_MENU_ITEMS.indexOf(item.caption) < 0;
return filter;
}
override public function updateContextMenu():void {
@ -87,5 +97,25 @@ package org.bigbluebutton.common
updateContextMenu();
}
public function get unlocked():Boolean {
return this._unlocked;
}
public function set unlocked(value:Boolean):void {
this._unlocked
= this.draggable
= this.resizable
= this.titleBarOverlay.includeInLayout
= this.titleBarOverlay.enabled
= this.titleBarOverlay.visible
= value;
if (!this.minimized) {
this.showControls = this._unlocked;
}
updateContextMenu();
}
}
}

View File

@ -266,6 +266,7 @@ package org.bigbluebutton.main.model.users {
public function set amIPresenter(presenter:Boolean):void {
me.presenter = presenter;
me.applyLockSettings();
}
[Bindable]
@ -375,6 +376,7 @@ package org.bigbluebutton.main.model.users {
public function setMyRole(role:String):void {
me.role = role;
me.applyLockSettings();
}
public function amIGuest():Boolean {
@ -567,6 +569,7 @@ package org.bigbluebutton.main.model.users {
var myUser:BBBUser = getMyUser();
if(myUser != null)
myUser.applyLockSettings();
users.refresh(); // we need to refresh after updating the lock settings to trigger the user item renderers to redraw
}
}
}

View File

@ -44,6 +44,7 @@ package org.bigbluebutton.modules.layout.managers
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.CustomMdiWindow;
import org.bigbluebutton.core.EventBroadcaster;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.events.SwitchedLayoutEvent;
@ -51,6 +52,7 @@ package org.bigbluebutton.modules.layout.managers
import org.bigbluebutton.core.model.Config;
import org.bigbluebutton.main.events.ModuleLoadEvent;
import org.bigbluebutton.main.model.LayoutOptions;
import org.bigbluebutton.main.model.users.BBBUser;
import org.bigbluebutton.modules.layout.events.LayoutEvent;
import org.bigbluebutton.modules.layout.events.LayoutLockedEvent;
import org.bigbluebutton.modules.layout.events.LayoutsLoadedEvent;
@ -364,6 +366,12 @@ package org.bigbluebutton.modules.layout.managers
checkWindowsPermissions();
}
public function lockSettingsChanged():void {
var myUser:BBBUser = UserManager.getInstance().getConference().getMyUser();
_locked = myUser.lockedLayout;
checkWindowsPermissions();
}
public function applyRemoteLayout(e:LayoutFromRemoteEvent):void {
var layout:LayoutDefinition = e.layout;
applyLayout(layout);
@ -390,12 +398,8 @@ package org.bigbluebutton.modules.layout.managers
}
private function checkSingleWindowPermissions(window:MDIWindow):void {
if (!UserManager.getInstance().getConference().amIModerator()
&& !LayoutDefinition.ignoreWindow(window)) {
window.draggable
= window.resizable
= window.showControls
= !_locked;
if (!LayoutDefinition.ignoreWindow(window)) {
(window as CustomMdiWindow).unlocked = !_locked || UsersUtil.amIModerator() || UsersUtil.amIPresenter();
}
}

View File

@ -24,6 +24,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import mx.events.FlexEvent;
import org.bigbluebutton.core.EventConstants;
import org.bigbluebutton.core.events.LockControlEvent;
import org.bigbluebutton.main.model.users.events.ChangeMyRole;
import org.bigbluebutton.main.events.MadePresenterEvent;
import org.bigbluebutton.modules.layout.events.ChangeLayoutEvent;
@ -141,6 +142,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<MethodInvoker generator="{LayoutManager}" method="remoteSyncLayout" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{LockControlEvent.CHANGED_LOCK_SETTINGS}">
<MethodInvoker generator="{LayoutManager}" method="lockSettingsChanged"/>
</EventHandlers>
<EventHandlers type="{MadePresenterEvent.SWITCH_TO_VIEWER_MODE}">
<MethodInvoker generator="{LayoutManager}" method="presenterChanged" />
</EventHandlers>

View File

@ -66,10 +66,10 @@ package org.bigbluebutton.modules.layout.services
if(message.layout == "" || UsersUtil.amIModerator())
_dispatcher.dispatchEvent(new LayoutEvent(LayoutEvent.APPLY_DEFAULT_LAYOUT_EVENT));
else {
lockLayout(message.locked, message.setById);
handleSyncLayout(message);
}
handleLayoutLocked(message);
_dispatcher.dispatchEvent(new ModuleLoadEvent(ModuleLoadEvent.LAYOUT_MODULE_STARTED));
}

View File

@ -18,12 +18,9 @@
Author: Islam El-Ashi <ielashi@gmail.com>, <http://www.ielashi.com>
-->
<containers:CustomMdiWindow xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:containers="org.bigbluebutton.common.*"
<CustomMdiWindow xmlns="org.bigbluebutton.common.*"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:mate="http://mate.asfusion.com/"
layout="absolute"
minWidth="160"
minHeight="160"
implements="org.bigbluebutton.common.IBbbModuleWindow"
creationComplete="onCreationComplete()"
xmlns:components="org.bigbluebutton.modules.sharednotes.views.components.*"
@ -372,4 +369,4 @@
<mx:Button id="btnSave" styleName="sharedNotesSaveButtonStyle" width="26" height="26" click="btnSave_clickHandler(event)" toolTip="{ResourceUtil.getInstance().getString('bbb.sharedNotes.save.toolTip')}"/>
</mx:HBox>
</mx:VBox>
</containers:CustomMdiWindow>
</CustomMdiWindow>