Fixed bug with NullRef in ComputeHeaderCallStatus() method. However, some unknown Null Ref in the EssentialsVideoCodecUiDriver Constructor is preventing the UI from loading.

This commit is contained in:
Neil Dorin
2017-10-23 00:02:13 -06:00
parent 13a8876a61
commit 65adc5de1c
2 changed files with 46 additions and 19 deletions

View File

@@ -43,6 +43,11 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public string DefaultRoomKey { get; set; } public string DefaultRoomKey { get; set; }
/// <summary>
/// Indicates that the SetHeaderButtons method has completed successfully
/// </summary>
public bool HeaderButtonsAreSetUp { get; private set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@@ -954,6 +959,8 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
void SetupHeaderButtons() void SetupHeaderButtons()
{ {
HeaderButtonsAreSetUp = false;
TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true); TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true);
var roomConf = CurrentRoom.Config; var roomConf = CurrentRoom.Config;
@@ -1093,7 +1100,11 @@ namespace PepperDash.Essentials
TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, true); TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, true);
TriList.SetBool(UIBoolJoin.HeaderCallStatusRightPositionVisible, false); TriList.SetBool(UIBoolJoin.HeaderCallStatusRightPositionVisible, false);
} }
HeaderButtonsAreSetUp = true;
ComputeHeaderCallStatus(CurrentRoom.VideoCodec);
} }
/// <summary> /// <summary>
@@ -1101,6 +1112,18 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public void ComputeHeaderCallStatus(VideoCodecBase codec) public void ComputeHeaderCallStatus(VideoCodecBase codec)
{ {
if (codec == null)
{
Debug.Console(1, "ComputeHeaderCallStatus() cannot execute. codec is null");
return;
}
if(HeaderCallButtonIconSig == null)
{
Debug.Console(1, "ComputeHeaderCallStatus() cannot execute. HeaderCallButtonIconSig is null");
return;
}
// Set mode of header button // Set mode of header button
if (!codec.IsInCall) if (!codec.IsInCall)
{ {
@@ -1433,9 +1456,11 @@ namespace PepperDash.Essentials
{ {
PepperDash.Essentials.Core.Touchpanels.Keyboards.HabaneroKeyboardController Keyboard { get; } PepperDash.Essentials.Core.Touchpanels.Keyboards.HabaneroKeyboardController Keyboard { get; }
JoinedSigInterlock PopupInterlock { get; } JoinedSigInterlock PopupInterlock { get; }
EssentialsHuddleVtc1Room CurrentRoom { get; }
void ShowNotificationRibbon(string message, int timeout); void ShowNotificationRibbon(string message, int timeout);
void HideNotificationRibbon(); void HideNotificationRibbon();
void ComputeHeaderCallStatus(VideoCodecBase codec); void ComputeHeaderCallStatus(VideoCodecBase codec);
bool HeaderButtonsAreSetUp { get; }
SubpageReferenceList MeetingOrContactMethodModalSrl { get; } SubpageReferenceList MeetingOrContactMethodModalSrl { get; }
/// <summary> /// <summary>
/// Exposes the ability to switch into call mode /// Exposes the ability to switch into call mode

View File

@@ -80,7 +80,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
BoolFeedback SearchStringBackspaceVisibleFeedback; BoolFeedback SearchStringBackspaceVisibleFeedback;
BoolFeedback CallSharingInfoVisibleFeedback; BoolFeedback CallSharingInfoVisibleFeedback;
StringFeedback CallSharingInfoTextFeedback; //StringFeedback CallSharingInfoTextFeedback;
ModalDialog IncomingCallModal; ModalDialog IncomingCallModal;
@@ -183,28 +183,21 @@ namespace PepperDash.Essentials.UIDrivers.VC
CallSharingInfoVisibleFeedback = new BoolFeedback(() => Codec.SharingContentIsOnFeedback.BoolValue); CallSharingInfoVisibleFeedback = new BoolFeedback(() => Codec.SharingContentIsOnFeedback.BoolValue);
codec.SharingContentIsOnFeedback.OutputChange += new EventHandler<EventArgs>(SharingContentIsOnFeedback_OutputChange); codec.SharingContentIsOnFeedback.OutputChange += new EventHandler<EventArgs>(SharingContentIsOnFeedback_OutputChange);
CallSharingInfoVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.CallSharedSourceInfoVisible]); CallSharingInfoVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.CallSharedSourceInfoVisible]);
Parent.CurrentRoom.CurrentSingleSourceChange += new SourceInfoChangeHandler(CurrentRoom_CurrentSingleSourceChange);
CallSharingInfoTextFeedback = new StringFeedback(() => GetCurrentSourceName(Codec.SharingSourceFeedback.StringValue));
CallSharingInfoTextFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CallSharedSourceNameText]);
TriList.SetSigFalseAction(UIBoolJoin.CallStopSharingPress, Codec.StopSharing); TriList.SetSigFalseAction(UIBoolJoin.CallStopSharingPress, Codec.StopSharing);
} }
/// <summary> /// <summary>
/// Returns the name of the source that matches the specified key /// Updates the current shared source label on the call list when the source changes
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="room"></param>
/// <returns></returns> /// <param name="info"></param>
string GetCurrentSourceName(string key) /// <param name="type"></param>
void CurrentRoom_CurrentSingleSourceChange(EssentialsRoomBase room, SourceListItem info, ChangeType type)
{ {
Debug.Console(1, "GetCurrentSource: Attempting to get device with key: {0}", key); if (Codec.SharingContentIsOnFeedback.BoolValue)
TriList.StringInput[UIStringJoin.CallSharedSourceNameText].StringValue = Parent.CurrentRoom.CurrentSourceInfo.PreferredName;
var device = DeviceManager.GetDeviceForKey(key);
if (device != null)
return (device as SourceListItem).Name;
else
return "None";
} }
/// <summary> /// <summary>
@@ -215,7 +208,15 @@ namespace PepperDash.Essentials.UIDrivers.VC
void SharingContentIsOnFeedback_OutputChange(object sender, EventArgs e) void SharingContentIsOnFeedback_OutputChange(object sender, EventArgs e)
{ {
CallSharingInfoVisibleFeedback.FireUpdate(); CallSharingInfoVisibleFeedback.FireUpdate();
CallSharingInfoTextFeedback.FireUpdate();
string callListSharedSourceLabel;
if (Codec.SharingContentIsOnFeedback.BoolValue)
callListSharedSourceLabel = Parent.CurrentRoom.CurrentSourceInfo.PreferredName;
else
callListSharedSourceLabel = "None";
TriList.StringInput[UIStringJoin.CallSharedSourceNameText].StringValue = callListSharedSourceLabel;
} }
/// <summary> /// <summary>
@@ -228,7 +229,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
TriList.SetString(UIStringJoin.RoomPhoneText, Codec.CodecInfo.PhoneNumber); TriList.SetString(UIStringJoin.RoomPhoneText, Codec.CodecInfo.PhoneNumber);
TriList.SetString(UIStringJoin.RoomSipText, Codec.CodecInfo.SipUri); TriList.SetString(UIStringJoin.RoomSipText, Codec.CodecInfo.SipUri);
Parent.ComputeHeaderCallStatus(Codec); if(Parent.HeaderButtonsAreSetUp)
Parent.ComputeHeaderCallStatus(Codec);
} }
/// <summary> /// <summary>