mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-02 06:14:52 +00:00
feat: Add method to clear selected phonebook entry
This commit is contained in:
@@ -398,6 +398,22 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("DirectoryClearSelection")]
|
||||
public JoinDataComplete DirectoryClearSelection = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 100,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Directory Search Busy FB",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
|
||||
|
||||
[JoinName("DirectoryEntryIsContact")]
|
||||
public JoinDataComplete DirectoryEntryIsContact = new JoinDataComplete(
|
||||
new JoinData
|
||||
@@ -1256,8 +1272,8 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Directory Select Row",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
Description = "Directory Select Row and Feedback",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Analog
|
||||
});
|
||||
|
||||
|
||||
@@ -1001,6 +1001,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.DirectorySelectRow.JoinNumber, (i) => SelectDirectoryEntry(codec, i, trilist, joinMap));
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.DirectoryClearSelection.JoinNumber,
|
||||
delegate { SelectDirectoryEntry(codec, 0, trilist, joinMap); });
|
||||
|
||||
// Report feedback for number of contact methods for selected contact
|
||||
|
||||
trilist.SetSigFalseAction(joinMap.DirectoryRoot.JoinNumber, codec.SetCurrentDirectoryToRoot);
|
||||
@@ -1049,13 +1052,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void SelectDirectoryEntry(IHasDirectory codec, ushort i, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||
{
|
||||
if (i < 1 || i > codec.CurrentDirectoryResult.CurrentDirectoryResults.Count) return;
|
||||
|
||||
_selectedDirectoryItem = codec.CurrentDirectoryResult.CurrentDirectoryResults[i - 1];
|
||||
if (i > codec.CurrentDirectoryResult.CurrentDirectoryResults.Count) return;
|
||||
_selectedDirectoryItem = i == 0 ? null : codec.CurrentDirectoryResult.CurrentDirectoryResults[i - 1];
|
||||
|
||||
trilist.SetUshort(joinMap.DirectorySelectRow.JoinNumber, i);
|
||||
|
||||
if (_selectedDirectoryItem is DirectoryFolder)
|
||||
{
|
||||
@@ -1073,13 +1075,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
trilist.SetString(joinMap.DirectorySelectedFolderName.JoinNumber, string.Empty);
|
||||
|
||||
var selectedContact = _selectedDirectoryItem as DirectoryContact;
|
||||
if (selectedContact != null)
|
||||
{
|
||||
trilist.SetString(joinMap.DirectoryEntrySelectedName.JoinNumber, selectedContact.Name);
|
||||
|
||||
}
|
||||
|
||||
// Allow auto dial of selected line. Always dials first contact method
|
||||
trilist.SetString(joinMap.DirectoryEntrySelectedName.JoinNumber,
|
||||
selectedContact != null ? selectedContact.Name : string.Empty);
|
||||
|
||||
// Allow auto dial of selected line. Always dials first contact method
|
||||
if (!trilist.GetBool(joinMap.DirectoryDisableAutoDialSelectedLine.JoinNumber))
|
||||
{
|
||||
var invitableEntry = _selectedDirectoryItem as IInvitableContact;
|
||||
@@ -1092,12 +1092,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
|
||||
var entryToDial = _selectedDirectoryItem as DirectoryContact;
|
||||
|
||||
trilist.SetString(joinMap.DirectoryEntrySelectedNumber.JoinNumber, selectedContact.ContactMethods[0].Number);
|
||||
trilist.SetString(joinMap.DirectoryEntrySelectedNumber.JoinNumber,
|
||||
selectedContact != null ? selectedContact.ContactMethods[0].Number : string.Empty);
|
||||
|
||||
if (entryToDial == null) return;
|
||||
|
||||
Dial(entryToDial.ContactMethods[0].Number);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user