Commit 19cd8561 authored by Sylvain Berfini's avatar Sylvain Berfini

Added Stun server setting + always show the delete logs button, only disable...

Added Stun server setting + always show the delete logs button, only disable it when action is not allowed
parent 2edb3ad1
......@@ -1023,6 +1023,7 @@ namespace Linphone.Model
#region Constants settings names
private const string SIPTransportSettingKeyName = "SIPTransport";
private const string SIPPortKeyName = "SIPPort";
private const string StunServerKeyName = "StunServer";
private const string TunnelServerKeyName = "TunnelServer";
private const string TunnelPortKeyName = "TunnelPort";
private const string TunnelModeKeyName = "TunnelMode";
......@@ -1084,6 +1085,8 @@ namespace Linphone.Model
dict[SIPTransportSettingKeyName] = tname;
dict[SIPPortKeyName] = port.ToString();
dict[StunServerKeyName] = LinphoneManager.Instance.LinphoneCore.GetStunServer();
// Load tunnel configuration
dict[TunnelModeKeyName] = AppResources.TunnelModeDisabled;
dict[TunnelServerKeyName] = "";
......@@ -1151,6 +1154,9 @@ namespace Linphone.Model
LinphoneManager.Instance.LinphoneCore.SetSignalingTransportsPorts(transports);
}
if (ValueChanged(StunServerKeyName))
LinphoneManager.Instance.LinphoneCore.SetStunServer(GetNew(StunServerKeyName));
// Save tunnel configuration
if (LinphoneManager.Instance.LinphoneCore.IsTunnelAvailable() && Customs.IsTunnelEnabled)
{
......@@ -1203,6 +1209,21 @@ namespace Linphone.Model
}
}
/// <summary>
/// Stun server setting (String).
/// </summary>
public string StunServer
{
get
{
return Get(StunServerKeyName);
}
set
{
Set(StunServerKeyName, value);
}
}
/// <summary>
/// Tunnel server setting (String).
/// </summary>
......
......@@ -1111,6 +1111,15 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Stun server.
/// </summary>
public static string StunServer {
get {
return ResourceManager.GetString("StunServer", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à To:.
/// </summary>
......
......@@ -537,4 +537,7 @@ Do you want to report it to the developpers ? It will help fix it faster.</value
<data name="SIPUserId" xml:space="preserve">
<value>Auth userid</value>
</data>
<data name="StunServer" xml:space="preserve">
<value>Stun server</value>
</data>
</root>
\ No newline at end of file
......@@ -22,11 +22,28 @@
<phone:PivotItem Header="{Binding Path=LocalizedResources.NetworkMenu, Source={StaticResource LocalizedStrings}}">
<ScrollViewer>
<StackPanel Orientation="Vertical">
<toolkit:ListPicker
Grid.Row="1"
<toolkit:ListPicker
x:Name="Transport"
Header="{Binding Path=LocalizedResources.TransportSetting, Source={StaticResource LocalizedStrings}}">
</toolkit:ListPicker>
<StackPanel Orientation="Vertical">
<TextBlock
Margin="12,20,0,0"
Text="{Binding Path=LocalizedResources.StunServer, Source={StaticResource LocalizedStrings}}" />
<TextBox
x:Name="Stun"
IsEnabled="True"
IsReadOnly="False">
<TextBox.InputScope>
<InputScope>
<InputScopeName NameValue="Url" />
</InputScope>
</TextBox.InputScope>
</TextBox>
</StackPanel>
<StackPanel x:Name="TunnelPanel" Orientation="Vertical">
<toolkit:ListPicker
......
......@@ -33,6 +33,8 @@ namespace Linphone.Views
vibrator.IsChecked = _chatSettings.VibrateOnIncomingMessage;
resizeDown.IsChecked = _chatSettings.ScaleDownSentPictures;
Stun.Text = _networkSettings.StunServer;
List<string> tunnelModes = new List<string>
{
AppResources.TunnelModeDisabled,
......@@ -78,6 +80,7 @@ namespace Linphone.Views
_callSettings.SendDTFMsSIPInfo = sipInfo.IsChecked;
_callSettings.Save();
_networkSettings.StunServer = Stun.Text;
_networkSettings.TunnelMode = tunnelMode.SelectedItem.ToString();
_networkSettings.TunnelServer = tunnelServer.Text;
_networkSettings.TunnelPort = tunnelPort.Text;
......
......@@ -33,13 +33,10 @@ namespace Linphone.Views
{
base.OnNavigatedTo(e);
if (BugCollector.HasLinphoneLogFile())
DeleteLogs.Visibility = (bool)Debug.IsChecked ? Visibility.Visible : Visibility.Collapsed;
else
DeleteLogs.Visibility = Visibility.Collapsed;
// Create LinphoneCore if not created yet, otherwise do nothing
await LinphoneManager.Instance.InitLinphoneCore();
DeleteLogs.IsEnabled = BugCollector.HasLinphoneLogFile();
}
......@@ -51,7 +48,7 @@ namespace Linphone.Views
private void deleteLogs_Click_1(object sender, EventArgs e)
{
BugCollector.DeleteLinphoneLogFile();
DeleteLogs.Visibility = Visibility.Collapsed;
DeleteLogs.IsEnabled = false;
}
private void save_Click_1(object sender, EventArgs e)
......
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