mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-08 17:24:47 +00:00
Worked on VC directory and favorites. Fixed various bugs.
This commit is contained in:
@@ -10,6 +10,7 @@ using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.SmartObjects;
|
||||
using PepperDash.Essentials.Core.PageManagers;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
@@ -408,7 +409,7 @@ namespace PepperDash.Essentials
|
||||
TriList.SetSigFalseAction(UIBoolJoin.NextMeetingRibbonJoinPress, () =>
|
||||
{
|
||||
HideNextMeetingPopup();
|
||||
RoomOnAndDialMeeting(meeting.ConferenceNumberToDial);
|
||||
RoomOnAndDialMeeting(meeting);
|
||||
});
|
||||
TriList.SetString(UIStringJoin.NextMeetingSecondaryButtonLabel, "Show Schedule");
|
||||
TriList.SetSigFalseAction(UIBoolJoin.CalendarHeaderButtonPress, () =>
|
||||
@@ -459,13 +460,15 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
/// Dials a meeting after turning on room (if necessary)
|
||||
/// </summary>
|
||||
void RoomOnAndDialMeeting(string number)
|
||||
void RoomOnAndDialMeeting(Meeting meeting)
|
||||
{
|
||||
Action dialAction = () =>
|
||||
{
|
||||
var d = CurrentRoom.ScheduleSource as VideoCodecBase;
|
||||
if (d != null)
|
||||
d.Dial(number);
|
||||
if (d != null)
|
||||
{
|
||||
d.Dial(meeting);
|
||||
}
|
||||
};
|
||||
if (CurrentRoom.OnFeedback.BoolValue)
|
||||
dialAction();
|
||||
@@ -980,7 +983,7 @@ namespace PepperDash.Essentials
|
||||
PopupInterlock.Hide();
|
||||
var d = CurrentRoom.ScheduleSource as VideoCodecBase;
|
||||
if (d != null)
|
||||
RoomOnAndDialMeeting(mm.ConferenceNumberToDial);
|
||||
RoomOnAndDialMeeting(mm);
|
||||
});
|
||||
}
|
||||
MeetingsSrl.Count = i;
|
||||
|
||||
@@ -61,6 +61,10 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
|
||||
CodecDirectory CurrentDirectoryResult;
|
||||
|
||||
string LastFolderRequestedParentFolderId;
|
||||
|
||||
BoolFeedback DirectoryBackButtonVisibleFeedback;
|
||||
|
||||
// These are likely temp until we get a keyboard built
|
||||
StringFeedback DialStringFeedback;
|
||||
StringBuilder DialStringBuilder = new StringBuilder();
|
||||
@@ -130,6 +134,12 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
DialStringBackspaceVisibleFeedback
|
||||
.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCKeypadBackspaceVisible]);
|
||||
|
||||
TriList.SetSigFalseAction(UIBoolJoin.VCDirectoryBackPress, GetDirectoryParentFolderContents);
|
||||
|
||||
DirectoryBackButtonVisibleFeedback = new BoolFeedback(() => CurrentDirectoryResult != (codec as IHasDirectory).DirectoryRoot);
|
||||
DirectoryBackButtonVisibleFeedback
|
||||
.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCDirectoryBackVisible]);
|
||||
|
||||
TriList.SetSigFalseAction(UIBoolJoin.VCKeypadTextPress, RevealKeyboard);
|
||||
|
||||
// Address and number
|
||||
@@ -389,9 +399,9 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
TriList.SetString(timeTextOffset + i, timeText);
|
||||
|
||||
string iconName = null;
|
||||
if (c.Direction == eCodecCallDirection.Incoming)
|
||||
if (c.OccurenceType == eCodecOccurrenceType.Received)
|
||||
iconName = "Left";
|
||||
else if (c.Direction == eCodecCallDirection.Outgoing)
|
||||
else if (c.OccurenceType == eCodecOccurrenceType.Placed)
|
||||
iconName = "Right";
|
||||
else
|
||||
iconName = "Help";
|
||||
@@ -419,7 +429,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
if (i < favs.Count)
|
||||
{
|
||||
var fav = favs[(int)i];
|
||||
TriList.SetString(1211 + i, fav.Name);
|
||||
TriList.SetString(1411 + i, fav.Name);
|
||||
TriList.SetBool(1221 + i, true);
|
||||
TriList.SetSigFalseAction(1211 + i, () =>
|
||||
{
|
||||
@@ -445,7 +455,14 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
DirectoryList = new SmartObjectDynamicList(TriList.SmartObjects[UISmartObjectJoin.VCDirectoryList],
|
||||
true, 1300);
|
||||
codec.DirectoryResultReturned += new EventHandler<DirectoryEventArgs>(dir_DirectoryResultReturned);
|
||||
CurrentDirectoryResult = codec.DirectoryRoot;
|
||||
|
||||
if (codec.PhonebookSyncState.InitialSyncComplete)
|
||||
SetCurrentDirectoryToRoot();
|
||||
else
|
||||
{
|
||||
codec.PhonebookSyncState.InitialSyncCompleted += new EventHandler<EventArgs>(PhonebookSyncState_InitialSyncCompleted);
|
||||
}
|
||||
|
||||
|
||||
// If there is something here now, show it otherwise wait for the event
|
||||
if (CurrentDirectoryResult != null && codec.DirectoryRoot.DirectoryResults.Count > 0)
|
||||
@@ -456,6 +473,37 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the current directory resutls to the DirectorRoot and updates Back Button visibiltiy
|
||||
/// </summary>
|
||||
void SetCurrentDirectoryToRoot()
|
||||
{
|
||||
LastFolderRequestedParentFolderId = string.Empty;
|
||||
|
||||
CurrentDirectoryResult = (Codec as IHasDirectory).DirectoryRoot;
|
||||
|
||||
DirectoryBackButtonVisibleFeedback.FireUpdate();
|
||||
|
||||
RefreshDirectory();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setup the Directory list when notified that the initial phonebook sync is completed
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void PhonebookSyncState_InitialSyncCompleted(object sender, EventArgs e)
|
||||
{
|
||||
var codec = Codec as IHasDirectory;
|
||||
|
||||
SetCurrentDirectoryToRoot();
|
||||
|
||||
if (CurrentDirectoryResult != null && codec.DirectoryRoot.DirectoryResults.Count > 0)
|
||||
{
|
||||
RefreshDirectory();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -464,9 +512,38 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
void dir_DirectoryResultReturned(object sender, DirectoryEventArgs e)
|
||||
{
|
||||
CurrentDirectoryResult = e.Directory;
|
||||
DirectoryBackButtonVisibleFeedback.FireUpdate();
|
||||
RefreshDirectory();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to retrieve directory folder contents and store last requested folder id
|
||||
/// </summary>
|
||||
/// <param name="folderId"></param>
|
||||
void GetDirectoryFolderContents(DirectoryFolder folder)
|
||||
{
|
||||
LastFolderRequestedParentFolderId = folder.ParentFolderId;
|
||||
|
||||
(Codec as IHasDirectory).GetDirectoryFolderContents(folder.FolderId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Request the parent folder contents or sets back to the root if no parent folder
|
||||
/// </summary>
|
||||
void GetDirectoryParentFolderContents()
|
||||
{
|
||||
var codec = Codec as IHasDirectory;
|
||||
|
||||
if (!string.IsNullOrEmpty(LastFolderRequestedParentFolderId))
|
||||
codec.GetDirectoryFolderContents(LastFolderRequestedParentFolderId);
|
||||
else
|
||||
{
|
||||
SetCurrentDirectoryToRoot();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -484,9 +561,11 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
}
|
||||
|
||||
i++;
|
||||
DirectoryList.SetItemMainText(i, r.Name);
|
||||
|
||||
if(r is DirectoryContact)
|
||||
{
|
||||
DirectoryList.SetItemMainText(i, r.Name);
|
||||
|
||||
var dc = r as DirectoryContact;
|
||||
// if more than one contact method, pop up modal to choose
|
||||
// otherwiese dial 0 entry
|
||||
@@ -499,15 +578,18 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
else // is DirectoryFolder
|
||||
{
|
||||
DirectoryList.SetItemMainText(i, string.Format("[+] {0}", r.Name));
|
||||
|
||||
var df = r as DirectoryFolder;
|
||||
|
||||
DirectoryList.SetItemButtonAction(i, b =>
|
||||
{
|
||||
if (!b)
|
||||
{
|
||||
var id = (r as DirectoryFolder).FolderId;
|
||||
(Codec as IHasDirectory).GetDirectoryFolderContents(id);
|
||||
// will later call event handler
|
||||
GetDirectoryFolderContents(df);
|
||||
// will later call event handler after folder contents retrieved
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user