Commit cb2ec15d authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added Tunnel/Call settings

parent c79b61ec
No preview for this file type
......@@ -128,6 +128,9 @@
<Compile Include="Views\About.xaml.cs">
<DependentUpon>About.xaml</DependentUpon>
</Compile>
<Compile Include="Views\AdvancedSettings.xaml.cs">
<DependentUpon>AdvancedSettings.xaml</DependentUpon>
</Compile>
<Compile Include="Views\CodecsSettings.xaml.cs">
<DependentUpon>CodecsSettings.xaml</DependentUpon>
</Compile>
......@@ -185,6 +188,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\AdvancedSettings.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\CodecsSettings.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
......@@ -316,6 +323,7 @@
<Content Include="Toolkit.Content\ApplicationBar.Select.png" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Phone.Controls, Version=8.0.0.0, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Phone.Controls.Toolkit">
<HintPath>..\packages\WPtoolkit.4.2012.10.30\lib\wp8\Microsoft.Phone.Controls.Toolkit.dll</HintPath>
</Reference>
......
......@@ -16,6 +16,7 @@ namespace Linphone.Model
const string DebugSettingKeyName = "Debug";
const string TransportSettingKeyName = "Transport";
const string SendDTFMsRFC2833KeyName = "SendDTFMsRFC2833";
const string AMRNBSettingKeyName = "AMRNB";
const string AMRWBSettingKeyName = "AMRWB";
const string Speex16SettingKeyName = "Speex16";
......@@ -27,6 +28,10 @@ namespace Linphone.Model
const string SILK16SettingKeyName = "SILK16";
const string GSMSettingKeyName = "GSM";
const string TunnelServerKeyName = "TunnelServer";
const string TunnelPortKeyName = "TunnelPort";
const string TunnelModeKeyName = "TunnelMode";
public SettingsManager()
{
// Get the settings for this application.
......@@ -132,6 +137,21 @@ namespace Linphone.Model
}
}
public bool? SendDTFMsRFC2833
{
get
{
return GetValueOrDefault<bool?>(SendDTFMsRFC2833KeyName, Boolean.Parse(resourceManager.GetString("RFC2833Default")));
}
set
{
if (AddOrUpdateValue(SendDTFMsRFC2833KeyName, value))
{
Save();
}
}
}
#region Codecs Settings
public bool? AMRNB
{
......@@ -274,5 +294,52 @@ namespace Linphone.Model
}
}
#endregion
#region Tunnel Settings
public string TunnelServer
{
get
{
return GetValueOrDefault<string>(TunnelServerKeyName, resourceManager.GetString("TunnelServer"));
}
set
{
if (AddOrUpdateValue(TunnelServerKeyName, value))
{
Save();
}
}
}
public string TunnelPort
{
get
{
return GetValueOrDefault<string>(TunnelPortKeyName, resourceManager.GetString("TunnelPort"));
}
set
{
if (AddOrUpdateValue(TunnelPortKeyName, value))
{
Save();
}
}
}
public string TunnelMode
{
get
{
return GetValueOrDefault<string>(TunnelModeKeyName, resourceManager.GetString("TunnelMode"));
}
set
{
if (AddOrUpdateValue(TunnelModeKeyName, value))
{
Save();
}
}
}
#endregion
}
}
......@@ -93,6 +93,15 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Advanced settings.
/// </summary>
public static string AdvancedSettingsMenu {
get {
return ResourceManager.GetString("AdvancedSettingsMenu", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to AMR-NB.
/// </summary>
......@@ -120,6 +129,15 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Call.
/// </summary>
public static string CallMenu {
get {
return ResourceManager.GetString("CallMenu", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cancel.
/// </summary>
......@@ -300,6 +318,15 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Send DTMFs as RFC2833.
/// </summary>
public static string RFC2833Setting {
get {
return ResourceManager.GetString("RFC2833Setting", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Save.
/// </summary>
......@@ -380,5 +407,77 @@ namespace Linphone.Resources {
return ResourceManager.GetString("TransportUDP", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tunnel.
/// </summary>
public static string TunnelMenu {
get {
return ResourceManager.GetString("TunnelMenu", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tunnel mode.
/// </summary>
public static string TunnelMode {
get {
return ResourceManager.GetString("TunnelMode", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to 3G only.
/// </summary>
public static string TunnelMode3GOnly {
get {
return ResourceManager.GetString("TunnelMode3GOnly", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Always.
/// </summary>
public static string TunnelModeAlways {
get {
return ResourceManager.GetString("TunnelModeAlways", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Auto.
/// </summary>
public static string TunnelModeAuto {
get {
return ResourceManager.GetString("TunnelModeAuto", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disabled.
/// </summary>
public static string TunnelModeDisabled {
get {
return ResourceManager.GetString("TunnelModeDisabled", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tunnel port.
/// </summary>
public static string TunnelPort {
get {
return ResourceManager.GetString("TunnelPort", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tunnel server.
/// </summary>
public static string TunnelServer {
get {
return ResourceManager.GetString("TunnelServer", resourceCulture);
}
}
}
}
......@@ -230,4 +230,37 @@ http://www.linphone.org/m/help
<data name="ContactMenu" xml:space="preserve">
<value>Contact</value>
</data>
<data name="AdvancedSettingsMenu" xml:space="preserve">
<value>Advanced settings</value>
</data>
<data name="CallMenu" xml:space="preserve">
<value>Call</value>
</data>
<data name="RFC2833Setting" xml:space="preserve">
<value>Send DTMFs as RFC2833</value>
</data>
<data name="TunnelMenu" xml:space="preserve">
<value>Tunnel</value>
</data>
<data name="TunnelMode" xml:space="preserve">
<value>Tunnel mode</value>
</data>
<data name="TunnelMode3GOnly" xml:space="preserve">
<value>3G only</value>
</data>
<data name="TunnelModeAlways" xml:space="preserve">
<value>Always</value>
</data>
<data name="TunnelModeAuto" xml:space="preserve">
<value>Auto</value>
</data>
<data name="TunnelModeDisabled" xml:space="preserve">
<value>Disabled</value>
</data>
<data name="TunnelPort" xml:space="preserve">
<value>Tunnel port</value>
</data>
<data name="TunnelServer" xml:space="preserve">
<value>Tunnel server</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 RFC2833Default {
get {
return ResourceManager.GetString("RFC2833Default", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to UDP.
/// </summary>
......@@ -68,5 +77,32 @@ namespace Linphone.Resources {
return ResourceManager.GetString("TransportDefault", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disabled.
/// </summary>
internal static string TunnelMode {
get {
return ResourceManager.GetString("TunnelMode", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to 443.
/// </summary>
internal static string TunnelPort {
get {
return ResourceManager.GetString("TunnelPort", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to tunnel.linphone.org.
/// </summary>
internal static string TunnelServer {
get {
return ResourceManager.GetString("TunnelServer", resourceCulture);
}
}
}
}
......@@ -117,7 +117,19 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="RFC2833Default" xml:space="preserve">
<value>false</value>
</data>
<data name="TransportDefault" xml:space="preserve">
<value>UDP</value>
</data>
<data name="TunnelMode" xml:space="preserve">
<value>Disabled</value>
</data>
<data name="TunnelPort" xml:space="preserve">
<value>443</value>
</data>
<data name="TunnelServer" xml:space="preserve">
<value>tunnel.linphone.org</value>
</data>
</root>
\ No newline at end of file
<phone:PhoneApplicationPage
x:Class="Linphone.Views.AdvancedSettings"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<!--Pivot Control-->
<phone:Pivot Title="{Binding Path=LocalizedResources.AdvancedSettingsMenu, Source={StaticResource LocalizedStrings}}">
<!--Pivot item one-->
<phone:PivotItem Header="{Binding Path=LocalizedResources.TunnelMenu, Source={StaticResource LocalizedStrings}}">
<StackPanel Orientation="Vertical">
<TextBlock
Text="{Binding Path=LocalizedResources.TunnelServer, Source={StaticResource LocalizedStrings}}" />
<TextBox
x:Name="tunnelServer"
IsEnabled="True"
IsReadOnly="False">
<TextBox.InputScope>
<InputScope>
<InputScopeName NameValue="Url" />
</InputScope>
</TextBox.InputScope>
</TextBox>
<TextBlock
Text="{Binding Path=LocalizedResources.TunnelPort, Source={StaticResource LocalizedStrings}}" />
<TextBox
x:Name="tunnelPort"
IsEnabled="True"
IsReadOnly="False">
<TextBox.InputScope>
<InputScope>
<InputScopeName NameValue="Number" />
</InputScope>
</TextBox.InputScope>
</TextBox>
<toolkit:ListPicker
x:Name="tunnelMode"
Header="{Binding Path=LocalizedResources.TunnelMode, Source={StaticResource LocalizedStrings}}">
</toolkit:ListPicker>
</StackPanel>
</phone:PivotItem>
<!--Pivot item two-->
<phone:PivotItem Header="{Binding Path=LocalizedResources.CallMenu, Source={StaticResource LocalizedStrings}}">
<StackPanel Orientation="Vertical">
<toolkit:ToggleSwitch
x:Name="rfc2833"
Header="{Binding Path=LocalizedResources.RFC2833Setting, Source={StaticResource LocalizedStrings}}">
</toolkit:ToggleSwitch>
</StackPanel>
</phone:PivotItem>
</phone:Pivot>
</Grid>
</phone:PhoneApplicationPage>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Linphone.Model;
using Linphone.Resources;
namespace Linphone.Views
{
public partial class AdvancedSettings : PhoneApplicationPage
{
private SettingsManager _appSettings = new SettingsManager();
public AdvancedSettings()
{
InitializeComponent();
BuildLocalizedApplicationBar();
rfc2833.IsChecked = _appSettings.SendDTFMsRFC2833;
List<string> tunnelModes = new List<string>
{
AppResources.TunnelModeDisabled,
AppResources.TunnelMode3GOnly,
AppResources.TunnelModeAlways,
AppResources.TunnelModeAuto
};
tunnelMode.ItemsSource = tunnelModes;
tunnelMode.SelectedItem = _appSettings.TunnelMode;
tunnelPort.Text = _appSettings.TunnelPort;
tunnelServer.Text = _appSettings.TunnelServer;
}
private void cancel_Click_1(object sender, EventArgs e)
{
NavigationService.GoBack();
}
private void save_Click_1(object sender, EventArgs e)
{
_appSettings.SendDTFMsRFC2833 = rfc2833.IsChecked;
_appSettings.TunnelMode = tunnelMode.SelectedItem.ToString();
_appSettings.TunnelServer = tunnelServer.Text;
_appSettings.TunnelPort = tunnelPort.Text;
NavigationService.GoBack();
}
private void BuildLocalizedApplicationBar()
{
ApplicationBar = new ApplicationBar();
ApplicationBarIconButton appBarSave = new ApplicationBarIconButton(new Uri("/Assets/AppBar/save.png", UriKind.Relative));
appBarSave.Text = AppResources.SaveSettings;
ApplicationBar.Buttons.Add(appBarSave);
appBarSave.Click += save_Click_1;
ApplicationBarIconButton appBarCancel = new ApplicationBarIconButton(new Uri("/Assets/AppBar/cancel.png", UriKind.Relative));
appBarCancel.Text = AppResources.CancelChanges;
ApplicationBar.Buttons.Add(appBarCancel);
appBarCancel.Click += cancel_Click_1;
}
}
}
\ No newline at end of file
......@@ -34,6 +34,7 @@
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<toolkit:ToggleSwitch
......@@ -57,6 +58,13 @@
<Button
Grid.Row="3"
x:Name="Advanced"
Click="advanced_Click_1"
Margin="0,30,0,0"
Content="{Binding Path=LocalizedResources.AdvancedSettingsMenu, Source={StaticResource LocalizedStrings}}" />
<Button
Grid.Row="4"
Click="LockScreenSettings_Click_1"
x:Name="LockScreenSettings"
Margin="0,30,0,0"
......
......@@ -23,9 +23,8 @@ namespace Linphone.Views
InitializeComponent();
BuildLocalizedApplicationBar();
ResourceManager resourceManager = new ResourceManager("Linphone.Resources.AppResources", typeof(AppResources).Assembly);
string tcp = resourceManager.GetString("TransportTCP", CultureInfo.CurrentCulture);
string udp = resourceManager.GetString("TransportUDP", CultureInfo.CurrentCulture);
string tcp = AppResources.TransportTCP;
string udp = AppResources.TransportUDP;
List<string> transports = new List<string>
{
tcp,
......@@ -55,6 +54,11 @@ namespace Linphone.Views
NavigationService.Navigate(new Uri("/Views/CodecsSettings.xaml", UriKind.RelativeOrAbsolute));
}
private void advanced_Click_1(object sender, RoutedEventArgs e)
{
NavigationService.Navigate(new Uri("/Views/AdvancedSettings.xaml", UriKind.RelativeOrAbsolute));
}
private void BuildLocalizedApplicationBar()
{
ApplicationBar = new ApplicationBar();
......
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