Moved network monitor button to MainToolbar

This commit is contained in:
Mateus Dalepiane 2014-09-15 16:30:58 -03:00
parent d94e7eb54c
commit cdb2fa5d3e
8 changed files with 75 additions and 59 deletions

View File

@ -46,7 +46,7 @@ ToolTip {
paddingRight: 3;
}
Button, .logoutButtonStyle, .chatSendButtonStyle, .helpLinkButtonStyle {
Button, .logoutButtonStyle, .chatSendButtonStyle, .helpLinkButtonStyle, .bandwidthButtonStyle {
textIndent: 0;
paddingLeft: 10;
paddingRight: 10;
@ -644,3 +644,7 @@ MDIWindow { /*None of the following properties are overridden by the MDIWindow c
fontSize: 20;
fontWeight: bold;
}
.bandwidthButtonStyle {
icon: Embed('assets/images/bandwidth.png');
}

View File

@ -60,7 +60,7 @@ ToolTip {
color: #e1e2e5;
}
Button, .logoutButtonStyle, .chatSendButtonStyle, .helpLinkButtonStyle, .cameraDisplaySettingsWindowChangeResolutionCombo, .languageSelectorStyle, .testJavaLinkButtonStyle, .recordButtonStyleNormal, .recordButtonStyleStart, .recordButtonStyleStop, .micSettingsWindowHelpButtonStyle {
Button, .logoutButtonStyle, .chatSendButtonStyle, .helpLinkButtonStyle, .cameraDisplaySettingsWindowChangeResolutionCombo, .languageSelectorStyle, .testJavaLinkButtonStyle, .recordButtonStyleNormal, .recordButtonStyleStart, .recordButtonStyleStop, .micSettingsWindowHelpButtonStyle, .bandwidthButtonStyle {
textIndent: 0;
paddingLeft: 10;
paddingRight: 10;
@ -827,3 +827,8 @@ Alert {
.recordButtonStyleStop {
icon: Embed('assets/images/control-record-stop.png');
}
.bandwidthButtonStyle {
icon: Embed('assets/images/bandwidth.png');
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

View File

@ -79,9 +79,6 @@ package org.bigbluebutton.common
[Embed(source="assets/images/vdoc_bg.jpg")]
public var video_dock_bg:Class;
[Embed(source="assets/images/bandwidth.png")]
public var bandwidth:Class;
[Embed(source="assets/images/statistics.png")]
public var stats:Class;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -24,13 +24,14 @@ package org.bigbluebutton.main.events
public class NetworkStatsEvent extends Event
{
public static const NETWORK_STATS_EVENTS:String = "NETWORK_STATS_EVENTS";
public static const OPEN_NETSTATS_WIN:String = "OPEN_NETWORK_WIN";
public var downloadStats:Dictionary;
public var uploadStats:Dictionary;
public function NetworkStatsEvent(bubbles:Boolean=true, cancelable:Boolean=false)
public function NetworkStatsEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
{
super(NETWORK_STATS_EVENTS, bubbles, cancelable);
super(type, bubbles, cancelable);
}
}

View File

@ -57,6 +57,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mate:Listener type="{LockControlEvent.OPEN_LOCK_SETTINGS}" method="openLockSettingsWindow" />
<mate:Listener type="{InvalidAuthTokenEvent.INVALID_AUTH_TOKEN}" method="handleInvalidAuthToken" />
<mate:Listener type="{NetworkStatsEvent.OPEN_NETSTATS_WIN}" method="openNetworkStatsWindow" />
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
@ -72,11 +74,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import mx.controls.Alert;
import mx.core.FlexGlobals;
import mx.core.IFlexDisplayObject;
import mx.core.IToolTip;
import mx.core.UIComponent;
import mx.events.CloseEvent;
import mx.events.FlexEvent;
import mx.events.ToolTipEvent;
import mx.managers.PopUpManager;
import org.bigbluebutton.common.IBbbModuleWindow;
@ -95,6 +95,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.events.ConfigEvent;
import org.bigbluebutton.main.events.InvalidAuthTokenEvent;
import org.bigbluebutton.main.events.LogoutEvent;
import org.bigbluebutton.main.events.NetworkStatsEvent;
import org.bigbluebutton.main.events.MeetingNotFoundEvent;
import org.bigbluebutton.main.events.ModuleLoadEvent;
import org.bigbluebutton.main.events.PortTestEvent;
@ -102,7 +103,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.events.SuccessfulLoginEvent;
import org.bigbluebutton.main.model.LayoutOptions;
import org.bigbluebutton.main.model.users.Conference;
import org.bigbluebutton.main.model.NetworkStatsData;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
import org.bigbluebutton.modules.phone.events.AudioSelectionWindowEvent;
import org.bigbluebutton.modules.phone.events.FlashMicSettingsEvent;
@ -137,7 +137,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
[Bindable] private var fullscreen_icon:Class = images.full_screen;
[Bindable] private var logs_icon:Class = images.table;
[Bindable] private var reset_layout_icon:Class = images.layout;
[Bindable] private var statsIcon:Class = images.bandwidth;
private var receivedConfigLocaleVer:Boolean = false;
private var receivedResourceLocaleVer:Boolean = false;
@ -157,10 +156,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
[Bindable] private var isTunneling:Boolean = false;
[Bindable] private var _bandwidthConsumedUp:String = "-";
[Bindable] private var _bandwidthConsumedDown:String = "-";
private var _updateBandwidthTimer:Timer = new Timer(1000);
private var _bandwidthToolTip:IToolTip;
private var confirmingLogout:Boolean = false;
public function initOptions(e:Event):void {
@ -182,7 +177,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
if (!showFooterOpt) {
footerHeight = 0;
}
initBandwidthToolTip();
}
protected function initializeShell():void {
@ -536,7 +530,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private var networkStatsWindow:NetworkStatsWindow = null;
private function openNetworkStatsWindow():void {
private function openNetworkStatsWindow(e:Event = null):void {
if (networkStatsWindow == null) {
networkStatsWindow = new NetworkStatsWindow();
}
@ -546,36 +540,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
mdiCanvas.windowManager.bringToFront(networkStatsWindow);
}
private function updateBwToolTip():void {
if(_bandwidthToolTip) {
_bandwidthToolTip.text = ResourceUtil.getInstance().getString('bbb.bwmonitor.upload.short') + ": " + _bandwidthConsumedUp +
" | " + ResourceUtil.getInstance().getString('bbb.bwmonitor.download.short')+": "+_bandwidthConsumedDown;
}
}
private function initBandwidthToolTip():void {
_updateBandwidthTimer.addEventListener(TimerEvent.TIMER, updateBandwidthTimerHandler);
_updateBandwidthTimer.start();
btnNetwork.addEventListener(ToolTipEvent.TOOL_TIP_SHOW, bwToolTipShowHandler);
btnNetwork.addEventListener(ToolTipEvent.TOOL_TIP_END, bwToolTipEndHandler);
}
private function bwToolTipShowHandler(e:ToolTipEvent):void {
// The ToolTip must be stored so it's text can be updated
_bandwidthToolTip = e.toolTip;
updateBwToolTip();
}
private function bwToolTipEndHandler(e:ToolTipEvent):void {
_bandwidthToolTip = null;
}
private function updateBandwidthTimerHandler(e:TimerEvent):void {
_bandwidthConsumedDown = NetworkStatsData.getInstance().formattedCurrentConsumedDownBW;
_bandwidthConsumedUp = NetworkStatsData.getInstance().formattedCurrentConsumedUpBW;
updateBwToolTip();
}
private function openLockSettingsWindow(event:LockControlEvent):void {
var conference:Conference = UserManager.getInstance().getConference();
var lsv:LockSettingsVO = conference.getLockSettings();
@ -650,14 +614,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
icon="{logs_icon}"
click="openLogWindow()"
tabIndex="{baseIndex}"/>
<mx:Button
id="btnNetwork"
icon="{statsIcon}"
width="20"
height="20"
toolTip="dummy text"
click="openNetworkStatsWindow()"
visible="{layoutOptions.showNetworkMonitor}" />
<mx:HBox id="addedBtns" />
</mx:ControlBar>
</mx:VBox>

View File

@ -43,8 +43,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import com.asfusion.mate.events.Dispatcher;
import mx.accessibility.AlertAccImpl;
import mx.controls.Alert;
import mx.core.IToolTip;
import mx.core.UIComponent;
import mx.events.CloseEvent;
import mx.events.ToolTipEvent;
import org.bigbluebutton.common.IBbbToolbarComponent;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.events.CloseWindowEvent;
@ -56,9 +58,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.ConfigEvent;
import org.bigbluebutton.main.events.LogoutEvent;
import org.bigbluebutton.main.events.NetworkStatsEvent;
import org.bigbluebutton.main.events.SettingsEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.model.LayoutOptions;
import org.bigbluebutton.main.model.NetworkStatsData;
import org.bigbluebutton.main.model.users.events.ConferenceCreatedEvent;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
@ -74,6 +78,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
[Bindable] private var baseIndex:int;
[Bindable] private var numButtons:int;
[Bindable] private var _bandwidthConsumedUp:String = "-";
[Bindable] private var _bandwidthConsumedDown:String = "-";
private var _updateBandwidthTimer:Timer = new Timer(1000);
private var _bandwidthToolTip:IToolTip;
/*
* Because of the de-centralized way buttons are added to the toolbar, there is a large gap between the tab indexes of the main buttons
* on the left and the tab indexes of the "other" items on the right (shortcut glossary, language slector, etc). This will make it more
@ -150,6 +159,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
} else {
showHelpBtn = false;
}
if(toolbarOptions.showNetworkMonitor) {
initBandwidthToolTip();
}
}
private function retrieveMeetingName(e:ConferenceCreatedEvent):void {
@ -333,6 +345,41 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
}
private function onNetStatsButtonClick(e:Event = null):void {
var d:Dispatcher = new Dispatcher();
d.dispatchEvent(new NetworkStatsEvent(NetworkStatsEvent.OPEN_NETSTATS_WIN));
}
private function initBandwidthToolTip():void {
_updateBandwidthTimer.addEventListener(TimerEvent.TIMER, updateBandwidthTimerHandler);
_updateBandwidthTimer.start();
btnNetwork.addEventListener(ToolTipEvent.TOOL_TIP_SHOW, bwToolTipShowHandler);
btnNetwork.addEventListener(ToolTipEvent.TOOL_TIP_END, bwToolTipEndHandler);
}
private function bwToolTipShowHandler(e:ToolTipEvent):void {
// The ToolTip must be stored so it's text can be updated
_bandwidthToolTip = e.toolTip;
updateBwToolTip();
}
private function bwToolTipEndHandler(e:ToolTipEvent):void {
_bandwidthToolTip = null;
}
private function updateBandwidthTimerHandler(e:TimerEvent):void {
_bandwidthConsumedDown = NetworkStatsData.getInstance().formattedCurrentConsumedDownBW;
_bandwidthConsumedUp = NetworkStatsData.getInstance().formattedCurrentConsumedUpBW;
updateBwToolTip();
}
private function updateBwToolTip():void {
if(_bandwidthToolTip) {
_bandwidthToolTip.text = ResourceUtil.getInstance().getString('bbb.bwmonitor.upload.short') + ": " + _bandwidthConsumedUp +
" | " + ResourceUtil.getInstance().getString('bbb.bwmonitor.download.short')+": "+_bandwidthConsumedDown;
}
}
]]>
</mx:Script>
@ -361,6 +408,12 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<!--
<mx:Button label="DISCONNECT!" click="BBB.initConnectionManager().forceClose()" height="22" toolTip="Click to simulate disconnection" />
-->
<mx:Button
id="btnNetwork"
styleName="bandwidthButtonStyle"
toolTip="dummy text"
click="onNetStatsButtonClick()"
visible="{toolbarOptions.showNetworkMonitor}" />
<mx:Button id="shortcutKeysBtn" label="{ResourceUtil.getInstance().getString('bbb.mainToolbar.shortcutBtn')}" styleName="shortcutButtonStyle"
click="onShortcutButtonClick()" height="22"
toolTip="{ResourceUtil.getInstance().getString('bbb.mainToolbar.shortcutBtn.toolTip')}"