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

Added version name in about text

parent 787a6b45
No preview for this file type
......@@ -70,7 +70,7 @@ namespace Linphone.Resources {
}
/// <summary>
/// Looks up a localized string similar to Linphone SIP (rfc 3261) compatible phone under GNU Public License V2
/// Looks up a localized string similar to Linphone #version# SIP (rfc 3261) compatible phone under GNU Public License V2
///http://www.linphone.org
///
///Instructions
......
......@@ -162,7 +162,7 @@
<value>Dialer</value>
</data>
<data name="AboutText" xml:space="preserve">
<value>Linphone SIP (rfc 3261) compatible phone under GNU Public License V2
<value>Linphone #version# SIP (rfc 3261) compatible phone under GNU Public License V2
http://www.linphone.org
Instructions
......
......@@ -11,6 +11,7 @@ using System.Windows.Documents;
using Linphone.Resources;
using System.Globalization;
using System.Resources;
using System.Reflection;
namespace Linphone.Views
{
......@@ -20,17 +21,24 @@ namespace Linphone.Views
{
InitializeComponent();
ResourceManager resourceManager = new ResourceManager("Linphone.Resources.AppResources", typeof(AppResources).Assembly);
string versionName = new AssemblyName(Assembly.GetExecutingAssembly().FullName).Version.ToString();
int i = 0;
string text = resourceManager.GetString("AboutText", CultureInfo.CurrentCulture);
Paragraph paragraph = new Paragraph();
foreach (var line in text.Split('\n'))
{
String textLine = line;
if (line.Contains("#version#"))
{
textLine = line.Replace("#version#", versionName);
}
if (line.StartsWith("http://"))
{
Hyperlink link = new Hyperlink();
link.NavigateUri = new Uri(line);
link.Inlines.Add(line);
link.NavigateUri = new Uri(textLine);
link.Inlines.Add(textLine);
link.TargetName = "_blank";
paragraph.Inlines.Add(link);
......@@ -38,7 +46,7 @@ namespace Linphone.Views
}
else
{
paragraph.Inlines.Add(line);
paragraph.Inlines.Add(textLine);
paragraph.Inlines.Add(new LineBreak());
}
}
......
......@@ -51,6 +51,7 @@
Grid.Row="2"
x:Name="Codecs"
Click="codecs_Click_1"
Margin="0,30,0,0"
Content="{Binding Path=LocalizedResources.CodecsMenu, Source={StaticResource LocalizedStrings}}" />
</Grid>
</Grid>
......
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