Premerge call history

This commit is contained in:
Heath Volmer
2017-10-02 15:26:12 -06:00
parent ae2725f6d1
commit 1274c74807
7 changed files with 83 additions and 4 deletions

View File

@@ -58,6 +58,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
SubpageReferenceList ActiveCallsSRL;
SmartObjectDynamicList RecentCallsList;
// These are likely temp until we get a keyboard built
StringFeedback DialStringFeedback;
StringBuilder DialStringBuilder = new StringBuilder();
@@ -82,6 +84,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
SetupCallStagingPopover();
SetupDialKeypad();
ActiveCallsSRL = new SubpageReferenceList(TriList, UISmartObjectJoin.CodecActiveCallsHeaderList, 3, 3, 3);
SetupRecentCallsList();
codec.CallStatusChange += new EventHandler<CodecCallStatusItemChangeEventArgs>(Codec_CallStatusChange);
@@ -333,6 +336,40 @@ namespace PepperDash.Essentials.UIDrivers.VC
TriList.ID, UISmartObjectJoin.VCDialKeypad);
}
/// <summary>
///
/// </summary>
void SetupRecentCallsList()
{
var codec = Codec as IHasCallHistory;
if (codec != null)
{
// EVENT??????????????? Pointed at refresh
RefreshRecentCallsList();
}
}
/// <summary>
///
/// </summary>
void RefreshRecentCallsList()
{
var codec = Codec as IHasCallHistory;
if (codec != null)
{
RecentCallsList = new SmartObjectDynamicList(TriList.SmartObjects[UISmartObjectJoin.VCRecentsList], true, 1200);
ushort i = 0;
foreach (var c in codec.CallHistory.RecentCalls)
{
i++;
RecentCallsList.SetItemMainText(i, c.Name);
var call = c; // for lambda scope
RecentCallsList.SetItemButtonAction(i, b => { if(!b) Codec.Dial(call.Number); });
}
RecentCallsList.Count = i;
}
}
/// <summary>
///
/// </summary>
@@ -404,7 +441,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
void ShowRecents()
{
//populate recents
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCDirectoryVisible);
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCRecentsVisible);
StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingRecentsPress);
}