Commit acd4da7c authored by Sylvain Berfini's avatar Sylvain Berfini

Finish to disable tunnel + display name setting

parent 94e8c7cd
......@@ -316,6 +316,7 @@ namespace Linphone.Model
private const string DomainKeyName = "Domain";
private const string ProxyKeyName = "Proxy";
private const string OutboundProxyKeyName = "OutboundProxy";
private const string DisplayNameKeyName = "DisplayName";
#endregion
#region Implementation of the ISettingsManager interface
......@@ -328,6 +329,7 @@ namespace Linphone.Model
dict[DomainKeyName] = "";
dict[ProxyKeyName] = "";
dict[PasswordKeyName] = "";
dict[DisplayNameKeyName] = "";
dict[OutboundProxyKeyName] = false.ToString();
LinphoneProxyConfig cfg = LinphoneManager.Instance.LinphoneCore.GetDefaultProxyConfig();
if (cfg != null)
......@@ -353,6 +355,7 @@ namespace Linphone.Model
{
dict[PasswordKeyName] = ((LinphoneAuthInfo)authInfos[0]).GetPassword();
}
dict[DisplayNameKeyName] = address.GetDisplayName();
}
}
}
......@@ -391,6 +394,7 @@ namespace Linphone.Model
String username = GetNew(UsernameKeyName);
String password = GetNew(PasswordKeyName);
String domain = GetNew(DomainKeyName);
String displayname = GetNew(DisplayNameKeyName);
bool outboundProxy = Convert.ToBoolean(GetNew(OutboundProxyKeyName));
lc.ClearAuthInfos();
lc.ClearProxyConfigs();
......@@ -407,7 +411,14 @@ namespace Linphone.Model
}
cfg = lc.CreateEmptyProxyConfig();
cfg.SetIdentity(username, username, domain);
if (displayname != null && displayname.Length > 0)
{
cfg.SetIdentity(displayname, username, domain);
}
else
{
cfg.SetIdentity(username, username, domain);
}
cfg.SetProxy(proxy);
cfg.EnableRegister(true);
// Can't set string to null: http://stackoverflow.com/questions/12980915/exception-when-trying-to-read-null-string-in-c-sharp-winrt-component-from-winjs
......@@ -501,6 +512,21 @@ namespace Linphone.Model
Set(OutboundProxyKeyName, value.ToString());
}
}
/// <summary>
/// SIP account display name setting (String).
/// </summary>
public string DisplayName
{
get
{
return Get(DisplayNameKeyName);
}
set
{
Set(DisplayNameKeyName, value);
}
}
#endregion
}
......@@ -1088,7 +1114,7 @@ namespace Linphone.Model
}
// Save tunnel configuration
if (LinphoneManager.Instance.LinphoneCore.IsTunnelAvailable())
if (LinphoneManager.Instance.LinphoneCore.IsTunnelAvailable() && false) // Disable tunnel for now
{
if (ValueChanged(TunnelServerKeyName) || ValueChanged(TunnelPortKeyName))
{
......
......@@ -399,6 +399,15 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Display name.
/// </summary>
public static string DisplayName {
get {
return ResourceManager.GetString("DisplayName", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Download.
/// </summary>
......
......@@ -467,4 +467,7 @@ http://www.linphone.org/m/help
<data name="EditPassword" xml:space="preserve">
<value>edit password</value>
</data>
<data name="DisplayName" xml:space="preserve">
<value>Display name</value>
</data>
</root>
\ No newline at end of file
......@@ -37,6 +37,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical" Grid.Row="0">
......@@ -109,6 +110,21 @@
Header="{Binding Path=LocalizedResources.SIPOutboundProxy, Source={StaticResource LocalizedStrings}}">
</toolkit:ToggleSwitch>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Row="5" Margin="0,10,0,0">
<TextBlock
Margin="10,0,0,0"
Text="{Binding Path=LocalizedResources.DisplayName, Source={StaticResource LocalizedStrings}}">
</TextBlock>
<TextBox
x:Name="DisplayName">
<TextBox.InputScope>
<InputScope>
<InputScopeName NameValue="PersonalSurname" />
</InputScope>
</TextBox.InputScope>
</TextBox>
</StackPanel>
</Grid>
</ScrollViewer>
</Grid>
......
......@@ -31,6 +31,7 @@ namespace Linphone.Views
Domain.Text = _settings.Domain;
Proxy.Text = _settings.Proxy;
OutboundProxy.IsChecked = _settings.OutboundProxy;
DisplayName.Text = _settings.DisplayName;
if (Username.Text.Length > 0)
{
......@@ -53,6 +54,7 @@ namespace Linphone.Views
_settings.Domain = Domain.Text;
_settings.Proxy = Proxy.Text;
_settings.OutboundProxy = OutboundProxy.IsChecked;
_settings.DisplayName = DisplayName.Text;
_settings.Save();
NavigationService.GoBack();
......@@ -94,7 +96,7 @@ namespace Linphone.Views
private void Proxy_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.Enter)
OutboundProxy.Focus();
DisplayName.Focus();
}
private void EditPassword_Click(object sender, System.Windows.RoutedEventArgs 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