Commit fd867c3a authored by Erwan Croze's avatar Erwan Croze 👋🏻

Lot of UI fix and code fix

parent 79768e0f
......@@ -34,7 +34,7 @@ namespace Linphone.Controls
{
Button button = sender as Button;
String tag = button.Tag as String;
LinphoneManager.Instance.Core.PlayDtmf(Convert.ToSByte(tag), 1000);
LinphoneManager.Instance.Core.PlayDtmf(Convert.ToSByte(tag.ToCharArray()[0]), 1000);
}
}
}
......@@ -291,7 +291,7 @@ namespace Linphone.Model {
ProxyConfig cfg = LinphoneManager.Instance.Core.DefaultProxyConfig;
if (cfg != null) {
Address address = LinphoneManager.Instance.Core.CreateAddress(cfg.IdentityAddress.AsStringUriOnly());
Address address = cfg.IdentityAddress;
if (address != null) {
Address proxyAddress = LinphoneManager.Instance.Core.CreateAddress(cfg.ServerAddr);
dict[ProxyKeyName] = proxyAddress.AsStringUriOnly();
......@@ -308,7 +308,7 @@ namespace Linphone.Model {
if (cfg.NatPolicy == null) cfg.NatPolicy = LinphoneManager.Instance.Core.CreateNatPolicy();
dict[Ice] = cfg.NatPolicy.IceEnabled.ToString();
dict[DisplayNameKeyName] = address.DisplayName;
dict[AVPFKeyName] = cfg.AvpfEnabled.ToString();
dict[AVPFKeyName] = (cfg.AvpfMode == AVPFMode.Enabled) ? true.ToString() : false.ToString();
}
}
}
......@@ -362,7 +362,6 @@ namespace Linphone.Model {
} else {
cfg.IdentityAddress = Factory.Instance.CreateAddress("<sip:" + username + "@" + domain + ">");
}
if ((proxy == null) || (proxy.Length <= 0)) {
proxy = "sip:" + domain;
} else {
......@@ -386,9 +385,11 @@ namespace Linphone.Model {
cfg.Route = cfg.ServerAddr;
}
if (cfg.NatPolicy != null) {
if (cfg.NatPolicy == null)
cfg.NatPolicy = cfg.Core.CreateNatPolicy();
if (cfg.NatPolicy != null)
cfg.NatPolicy.IceEnabled = ice;
}
int result = 0;
int.TryParse(expires, out result);
......@@ -402,7 +403,7 @@ namespace Linphone.Model {
lc.AddProxyConfig(cfg);
lc.DefaultProxyConfig = cfg;
LinphoneManager.Instance.AddPushInformationsToContactParams();
//cfg.AvpfEnabled = avpf;
cfg.AvpfMode = (avpf) ? AVPFMode.Enabled : AVPFMode.Disabled;
cfg.RegisterEnabled = true;
cfg.Done();
}
......
......@@ -548,7 +548,7 @@ Do you want to report it to the developpers ? It will help fix it faster.</value
<value>None</value>
</data>
<data name="FirewallPolicySetting.Header" xml:space="preserve">
<value>Firewall policy</value>
<value>ICE</value>
</data>
<data name="FirewallPolicyStun" xml:space="preserve">
<value>STUN</value>
......
......@@ -33,6 +33,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical" Grid.Row="0" Margin="0,10,0,0">
......@@ -116,19 +117,19 @@
</ToggleSwitch>
</StackPanel>
<!--<StackPanel Orientation="Vertical" Grid.Row="7" Margin="0,10,0,0">
<StackPanel Orientation="Vertical" Grid.Row="7" Margin="0,10,0,0">
<ToggleSwitch
x:Name="IceSwitch" x:Uid="ICESwitch" Header="Ice">
x:Name="IceSwitch" x:Uid="ICESwitch" Header="ICE">
</ToggleSwitch>
</StackPanel>-->
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Row="7" Margin="0,10,0,0">
<StackPanel Orientation="Vertical" Grid.Row="8" Margin="0,10,0,0">
<ToggleSwitch
x:Name="AVPF" x:Uid="AVPF" Header="AVPF">
</ToggleSwitch>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Row="8" Margin="0,10,0,0">
<StackPanel Orientation="Vertical" Grid.Row="9" Margin="0,10,0,0">
<TextBlock
Text="Expire" x:Uid="Expire">
</TextBlock>
......@@ -144,7 +145,7 @@
</TextBox>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Row="9" Margin="0,10,0,0">
<StackPanel Orientation="Vertical" Grid.Row="10" Margin="0,10,0,0">
<TextBlock
Text="DisplayName" x:Uid="DisplayName">
</TextBlock>
......
......@@ -58,7 +58,7 @@ namespace Linphone.Views {
Transport.SelectedItem = (_settings.Transports != null) ? _settings.Transports : transports[0];
AVPF.IsOn = (_settings.AVPF != null) ? (bool)_settings.AVPF : false;
//IceSwitch.IsOn = (_settings.ICE != null) ? (bool)_settings.ICE : false;
IceSwitch.IsOn = (_settings.ICE != null) ? (bool)_settings.ICE : false;
}
private void Save() {
......@@ -79,7 +79,7 @@ namespace Linphone.Views {
_settings.Transports = Transport.SelectedItem.ToString();
_settings.Expires = Expires.Text;
_settings.AVPF = AVPF.IsOn;
//_settings.ICE = IceSwitch.IsOn;
_settings.ICE = IceSwitch.IsOn;
_settings.Save();
......@@ -88,7 +88,7 @@ namespace Linphone.Views {
networkSettings.Load();
networkSettings.MEncryption = "SRTP";
//networkSettings.FWPolicy = networkSettings.EnumToFirewallPolicy[FirewallPolicy.UseIce];
networkSettings.FWPolicy = true;
networkSettings.StunServer = "stun.linphone.org";
networkSettings.Save();
}
......@@ -111,7 +111,6 @@ namespace Linphone.Views {
if (Frame.CanGoBack) {
Frame.GoBack();
}
}
private void save_Click_1(object sender, RoutedEventArgs e) {
......@@ -128,6 +127,7 @@ namespace Linphone.Views {
OutboundProxy.IsOn = true;
Expires.Text = "28800";
AVPF.IsOn = true;
IceSwitch.IsOn = true;
linphoneAccount = true;
}
......
......@@ -23,7 +23,8 @@
Margin="0,10,0,0"
x:Name="ICE"
x:Uid="FirewallPolicySetting"
Header="ICE">
Header="ICE" Toggled="ICE_Toggled"
Visibility="Collapsed">
</ToggleSwitch>
<ToggleSwitch
......@@ -103,7 +104,8 @@
<ToggleSwitch
x:Name="sipInfo"
x:Uid="SIPInfoSetting"
Header="SIPInfoSetting">
Header="SIPInfoSetting"
Visibility="Collapsed">
</ToggleSwitch>
</StackPanel>
</PivotItem>
......@@ -127,6 +129,7 @@
<!--Pivot item Debug-->
<PivotItem Header="DebugMenu" x:Uid="DebugMenu">
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="Information" FontStyle="Oblique" Text="Requires mail software configured on this device"/>
<ToggleSwitch
x:Name="Debug"
x:Uid="DebugSetting"
......
......@@ -196,5 +196,9 @@ namespace Linphone.Views {
Debug_Unchecked(sender, e);
}
}
private void ICE_Toggled(object sender, RoutedEventArgs e) {
}
}
}
\ No newline at end of file
......@@ -79,7 +79,7 @@
</PivotItem>
<!--Pivot item two-->
<PivotItem Header="OptionsMenu" x:Uid="OptionsMenu">
<!--<PivotItem Header="OptionsMenu" x:Uid="OptionsMenu" Visibility="Collapsed">
<StackPanel Orientation="Vertical">
<Button
Grid.Row="3"
......@@ -98,7 +98,7 @@
x:Uid="ECCalibrationNotRun"
Text="ECCalibrationNotRun" />
</StackPanel>
</PivotItem>
</PivotItem>-->
</Pivot>
</Grid>
......
......@@ -37,6 +37,7 @@ namespace Linphone.Views {
this.InitializeComponent();
SystemNavigationManager.GetForCurrentView().BackRequested += back_Click;
//ECCalibratorButton.IsEnabled = false;
_settings.Load();
Speex16.IsOn = _settings.Speex16;
Speex8.IsOn = _settings.Speex8;
......@@ -100,9 +101,10 @@ namespace Linphone.Views {
private void ECCalibratorButton_Click_1(object sender, RoutedEventArgs e) {
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
ECCalibratorButton.IsEnabled = false;
ECCalibratorStatusButton.Text = loader.GetString("ECCalibrationInProgress");
//LinphoneManager.Instance.Core.StartEchoCalibration(); TODO
//ECCalibratorButton.IsEnabled = false;
//ECCalibratorStatusButton.Text = loader.GetString("ECCalibrationInProgress");
//LinphoneManager.Instance.Core.StartEchoCalibration();
}
/// <summary>
......@@ -119,7 +121,7 @@ namespace Linphone.Views {
/// <param name="delayMs">The echo delay in milliseconds if the status is EcCalibratorStatus.Done</param>
public void ECStatusNotified(EcCalibratorStatus status, int delayMs) {
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
/* var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
if (status == EcCalibratorStatus.Done) {
ECCalibratorStatusButton.Text = String.Format(loader.GetString("ECCalibrationDone"), delayMs);
} else if (status == EcCalibratorStatus.DoneNoEcho) {
......@@ -129,7 +131,7 @@ namespace Linphone.Views {
} else if (status == EcCalibratorStatus.InProgress) {
ECCalibratorStatusButton.Text = loader.GetString("ECCalibrationInProgress");
}
ECCalibratorButton.IsEnabled = true;
ECCalibratorButton.IsEnabled = true;*/
}
private void back_Click(object sender, BackRequestedEventArgs e) {
......
......@@ -194,7 +194,7 @@ namespace Linphone.Views {
private void numpad_Click(object sender, RoutedEventArgs e) {
Button button = sender as Button;
String tag = button.Tag as String;
LinphoneManager.Instance.Core.PlayDtmf(Convert.ToSByte(tag), 1000);
LinphoneManager.Instance.Core.PlayDtmf(Convert.ToSByte(tag.ToCharArray()[0]), 1000);
addressBox.Text += tag;
}
......
......@@ -100,6 +100,7 @@ namespace Linphone.Views {
}
private void buttons_DialpadClick(object sender, bool isBluetoothOn) {
}
private bool buttons_SpeakerClick(object sender, bool isSpeakerOn) {
......@@ -126,7 +127,6 @@ namespace Linphone.Views {
} else {
PreviewRender.ScaleX = 1;
}
}
private void buttons_StatsClick(object sender, bool areStatsVisible) {
......@@ -174,7 +174,7 @@ namespace Linphone.Views {
protected override void OnNavigatedFrom(NavigationEventArgs nee) {
StopVideoStream();
if (oneSecondTimer != null) {
oneSecondTimer.Stop();
oneSecondTimer.Start();
}
if (LinphoneManager.Instance.isMobileVersion()) {
......@@ -188,7 +188,7 @@ namespace Linphone.Views {
Frame.BackStack.Clear();
base.OnNavigatedFrom(nee);
LinphoneManager.Instance.CallStateChangedEvent -= CallStateChanged;
//LinphoneManager.Instance.CallStateChangedEvent -= CallStateChanged;
}
public void CallStateChanged(Call call, CallState state) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment