(GUI): added site link to about box.

This commit is contained in:
morkt 2016-05-27 12:12:28 +04:00
parent ddd5c89cd1
commit f9c39e87a3
5 changed files with 44 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<!-- Game Resource browser
Copyright (C) 2014-2015 by morkt
Copyright (C) 2014-2016 by morkt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
@ -28,10 +28,12 @@ IN THE SOFTWARE.
xmlns:s="clr-namespace:GARbro.GUI.Strings"
xmlns:gr="clr-namespace:GameRes;assembly=GameRes"
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
xmlns:sys="clr-namespace:System;assembly=System"
Title="{x:Static s:guiStrings.TextAboutTitle}" Height="306" Width="550" ResizeMode="NoResize"
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
<Window.Resources>
<sys:Uri x:Key="DevLink">https://github.com/morkt/GARbro#readme</sys:Uri>
<local:BooleanToVisibiltyConverter x:Key="guiBoolToVisibilityConverter" />
<local:CanCreateConverter x:Key="guiCanCreateConverter"/>
<CollectionViewSource x:Key="ArcFormatsSource" Source="{Binding Source={x:Static gr:FormatCatalog.Instance}, Path=ArcFormats, Mode=OneWay}">
@ -62,7 +64,12 @@ IN THE SOFTWARE.
<StackPanel Grid.Column="0" Margin="10">
<TextBox Text="{Binding Path=AssemblyTitle, Mode=OneWay}" IsReadOnly="True" Background="Transparent" BorderThickness="0" Margin="0,0,0,10" />
<TextBox Text="{Binding Path=VersionString, Mode=OneWay}" IsReadOnly="True" Background="Transparent" BorderThickness="0" Margin="0,0,0,10" />
<TextBox Text="{Binding Path=AssemblyCopyright, Mode=OneWay}" IsReadOnly="True" Background="Transparent" BorderThickness="0" />
<TextBox Text="{Binding Path=AssemblyCopyright, Mode=OneWay}" IsReadOnly="True" Background="Transparent" BorderThickness="0" Margin="0,0,0,10" />
<TextBlock Background="Transparent" Margin="0,0,0,10" Padding="3,0,0,0">
<Hyperlink NavigateUri="{StaticResource DevLink}" RequestNavigate="Hyperlink_RequestNavigate">
<TextBlock Text="{x:Static s:guiStrings.LabelDevSite}" ToolTip="{StaticResource DevLink}"/>
</Hyperlink>
</TextBlock>
</StackPanel>
<Button Grid.Column="0" VerticalAlignment="Bottom" HorizontalAlignment="Left" VerticalContentAlignment="Center" IsDefault="true"
Content="{x:Static s:guiStrings.ButtonOK}" Margin="10,0,0,10" Width="70" Height="25" Click="Button_Click" IsCancel="True"/>

View File

@ -22,11 +22,13 @@
//
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Windows;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Navigation;
using GARbro.GUI.Properties;
using GARbro.GUI.Strings;
@ -184,6 +186,24 @@ namespace GARbro.GUI
}
}
#endregion
private void Hyperlink_RequestNavigate (object sender, RequestNavigateEventArgs e)
{
try
{
if (e.Uri.IsAbsoluteUri)
{
Process.Start (new ProcessStartInfo (e.Uri.AbsoluteUri));
e.Handled = true;
}
else
throw new ApplicationException ("URI is not absolute");
}
catch (Exception X)
{
Trace.WriteLine ("Link navigation failed: "+X.Message, e.Uri.ToString());
}
}
}
public class BooleanToVisibiltyConverter : IValueConverter

View File

@ -330,6 +330,15 @@ namespace GARbro.GUI.Strings {
}
}
/// <summary>
/// Looks up a localized string similar to Development site.
/// </summary>
public static string LabelDevSite {
get {
return ResourceManager.GetString("LabelDevSite", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Encoding.
/// </summary>

View File

@ -456,4 +456,7 @@ Overwrite?</value>
<value>Playing {0} / {3} / {2}bps / {1}Hz</value>
<comment>{0}=filename, {1}=sampling rate, {2}=bitrate, {3}=total time </comment>
</data>
<data name="LabelDevSite" xml:space="preserve">
<value>Development site</value>
</data>
</root>

View File

@ -477,4 +477,7 @@
<value>Проигрывается {0} / {3} / {2}bps / {1}Гц</value>
<comment>{0}=filename, {1}=sampling rate, {2}=bitrate, {3}=total time </comment>
</data>
<data name="LabelDevSite" xml:space="preserve">
<value>Сайт разработки</value>
</data>
</root>