Skip to content

Commit d77fba7

Browse files
committed
feat: Add about and versioning
1 parent a709d39 commit d77fba7

File tree

7 files changed

+44
-2
lines changed

7 files changed

+44
-2
lines changed

VNGod/Resource/Strings/Strings.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

VNGod/Resource/Strings/Strings.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,4 +292,7 @@
292292
<data name="BrowserSearch" xml:space="preserve">
293293
<value>Search via browser</value>
294294
</data>
295+
<data name="About" xml:space="preserve">
296+
<value>About</value>
297+
</data>
295298
</root>

VNGod/Resource/Strings/Strings.zh-CN.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,4 +274,7 @@
274274
<data name="BrowserSearch" xml:space="preserve">
275275
<value>浏览器搜索</value>
276276
</data>
277+
<data name="About" xml:space="preserve">
278+
<value>关于</value>
279+
</data>
277280
</root>

VNGod/VNGod.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
<ItemGroup>
2424
<PackageReference Include="HandyControl" Version="3.5.1" />
2525
<PackageReference Include="log4net" Version="3.2.0" />
26+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.9.50">
27+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
28+
<PrivateAssets>all</PrivateAssets>
29+
</PackageReference>
2630
<PackageReference Include="System.Drawing.Common" Version="10.0.0" />
2731
<PackageReference Include="WebDav.Client" Version="2.9.0" />
2832
</ItemGroup>

VNGod/View/SettingsWindow.xaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@
3636
<Button x:Name="runTokenTestButton" Content="{x:Static strings:Strings.RunTokenTest}" Click="RunTokenTestButton_Click"/>
3737
</StackPanel>
3838
</GroupBox>
39+
<GroupBox Header="{x:Static strings:Strings.About}">
40+
<StackPanel>
41+
<TextBlock Text="VNGod - Simple and effective Visual Novel manager" TextAlignment="Center"/>
42+
<TextBlock x:Name="versionBlock" TextAlignment="Center"/>
43+
<Button x:Name="githubButton" Content="Github" Click="GithubButton_Click"/>
44+
</StackPanel>
45+
</GroupBox>
3946
</StackPanel>
4047
</hc:ScrollViewer>
4148
</Grid>

VNGod/View/SettingsWindow.xaml.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
using System.Diagnostics;
1+
using System;
2+
using System.Diagnostics;
23
using System.IO;
4+
using System.Reflection;
35
using System.Windows;
46
using System.Windows.Shapes;
5-
using VNGod.Properties;
67
using VNGod.Data;
8+
using VNGod.Properties;
79
using VNGod.Utils;
810

911
namespace VNGod
@@ -22,6 +24,9 @@ public SettingsWindow()
2224
webDavPasswordBox.Password = Settings.Default.WebDAVPassword;
2325
bangumiTokenTextBox.Text = Settings.Default.BgmToken;
2426
vndbTokenTextBox.Text = Settings.Default.VNDBToken;
27+
versionBlock.Text = "Version " + Assembly.GetExecutingAssembly()
28+
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
29+
?.InformationalVersion;
2530
}
2631
private string HandleUrl(string url)
2732
{
@@ -79,5 +84,10 @@ private void WebDavUrlTextBox_LostFocus(object sender, RoutedEventArgs e)
7984
{
8085
webDavUrlTextBox.Text = HandleUrl(webDavUrlTextBox.Text);
8186
}
87+
88+
private void GithubButton_Click(object sender, RoutedEventArgs e)
89+
{
90+
Process.Start("explorer.exe", "https://github.com/SamHou0/VNGod");
91+
}
8292
}
8393
}

VNGod/version.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": "0.1",
3+
"publicReleaseRefSpec": [
4+
"^refs/heads/main$"
5+
]
6+
}

0 commit comments

Comments
 (0)