Commit fe3b4037 authored by Sylvain Berfini's avatar Sylvain Berfini

Improved account interface

parent 04e2a500
......@@ -131,7 +131,7 @@ namespace Linphone.Model
{
if (dict.ContainsKey(Key))
{
if (dict[Key] != Value)
if (dict[Key] != Value || Value.Length == 0)
{
changesDict[Key] = Value;
}
......
......@@ -462,6 +462,15 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to edit password.
/// </summary>
public static string EditPassword {
get {
return ResourceManager.GetString("EditPassword", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to G722.
/// </summary>
......
......@@ -464,4 +464,7 @@ http://www.linphone.org/m/help
<data name="IncomingCall" xml:space="preserve">
<value>INCOMING CALL</value>
</data>
<data name="EditPassword" xml:space="preserve">
<value>edit password</value>
</data>
</root>
\ No newline at end of file
......@@ -60,6 +60,15 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to false.
/// </summary>
internal static string CustomIncomingCallView {
get {
return ResourceManager.GetString("CustomIncomingCallView", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to 3600.
/// </summary>
......
......@@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="CustomIncomingCallView" xml:space="preserve">
<value>false</value>
</data>
<data name="KeepAlive" xml:space="preserve">
<value>3600</value>
<comment>Seconds for keep-alive task</comment>
......
......@@ -45,7 +45,8 @@
Text="{Binding Path=LocalizedResources.SIPUsername, Source={StaticResource LocalizedStrings}}">
</TextBlock>
<TextBox
x:Name="Username">
x:Name="Username"
KeyDown="Username_KeyDown">
<TextBox.InputScope>
<InputScope>
<InputScopeName NameValue="EmailUserName" />
......@@ -60,8 +61,14 @@
Text="{Binding Path=LocalizedResources.SIPPassword, Source={StaticResource LocalizedStrings}}">
</TextBlock>
<PasswordBox
x:Name="Password">
x:Name="Password"
KeyDown="Password_KeyDown">
</PasswordBox>
<Button
x:Name="EditPassword"
Click="EditPassword_Click"
Visibility="Collapsed"
Content="{Binding Path=LocalizedResources.EditPassword, Source={StaticResource LocalizedStrings}}"/>
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Row="2" Margin="0,10,0,0">
......@@ -70,7 +77,8 @@
Text="{Binding Path=LocalizedResources.SIPDomain, Source={StaticResource LocalizedStrings}}">
</TextBlock>
<TextBox
x:Name="Domain">
x:Name="Domain"
KeyDown="Domain_KeyDown">
<TextBox.InputScope>
<InputScope>
<InputScopeName NameValue="Url" />
......@@ -85,7 +93,8 @@
Text="{Binding Path=LocalizedResources.SIPProxy, Source={StaticResource LocalizedStrings}}">
</TextBlock>
<TextBox
x:Name="Proxy">
x:Name="Proxy"
KeyDown="Proxy_KeyDown">
<TextBox.InputScope>
<InputScope>
<InputScopeName NameValue="Url" />
......
......@@ -2,6 +2,8 @@
using Linphone.Resources;
using Microsoft.Phone.Shell;
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Navigation;
namespace Linphone.Views
......@@ -13,6 +15,8 @@ namespace Linphone.Views
{
private SIPAccountSettingsManager _settings = new SIPAccountSettingsManager();
private bool _editPassword = true;
/// <summary>
/// Public constructor.
/// </summary>
......@@ -27,6 +31,13 @@ namespace Linphone.Views
Domain.Text = _settings.Domain;
Proxy.Text = _settings.Proxy;
OutboundProxy.IsChecked = _settings.OutboundProxy;
if (Username.Text.Length > 0)
{
_editPassword = false;
Password.Visibility = Visibility.Collapsed;
EditPassword.Visibility = Visibility.Visible;
}
}
private void cancel_Click_1(object sender, EventArgs e)
......@@ -37,7 +48,8 @@ namespace Linphone.Views
private void save_Click_1(object sender, EventArgs e)
{
_settings.Username = Username.Text;
_settings.Password = Password.Password;
if (_editPassword)
_settings.Password = Password.Password;
_settings.Domain = Domain.Text;
_settings.Proxy = Proxy.Text;
_settings.OutboundProxy = OutboundProxy.IsChecked;
......@@ -60,5 +72,37 @@ namespace Linphone.Views
ApplicationBar.Buttons.Add(appBarCancel);
appBarCancel.Click += cancel_Click_1;
}
private void Username_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.Enter)
Password.Focus();
}
private void Password_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.Enter)
Domain.Focus();
}
private void Domain_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.Enter)
Proxy.Focus();
}
private void Proxy_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.Enter)
OutboundProxy.Focus();
}
private void EditPassword_Click(object sender, System.Windows.RoutedEventArgs e)
{
_editPassword = true;
Password.Password = "";
Password.Visibility = Visibility.Visible;
EditPassword.Visibility = Visibility.Collapsed;
}
}
}
\ No newline at end of file
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