-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
176 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace AutumnBox.GUI.Services | ||
{ | ||
internal interface IBuildInfo | ||
{ | ||
string LatestCommit { get; } | ||
string DateTime { get; } | ||
string LatestTag { get; } | ||
string Version { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using AutumnBox.Leafx.Container.Support; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace AutumnBox.GUI.Services.Impl | ||
{ | ||
[Component(Type = typeof(IBuildInfo))] | ||
class BuildInfo : IBuildInfo | ||
{ | ||
private const string FILE_NAME = "./build.ini"; | ||
|
||
public string LatestCommit => Read("commit") ?? "unknown"; | ||
|
||
public string DateTime => Read("datetime") ?? "unknown"; | ||
|
||
public string LatestTag => Read("tag") ?? "unknown"; | ||
|
||
public string Version => Read("version") ?? "unknown"; | ||
|
||
[DllImport("kernel32")] | ||
private static extern int GetPrivateProfileString(string section, string key, string def, | ||
StringBuilder retVal, int size, string filePath); | ||
|
||
private static string? Read(string key) | ||
{ | ||
const int BUFFER_SIZE = 255; | ||
StringBuilder sb = new StringBuilder(BUFFER_SIZE); | ||
_ = GetPrivateProfileString("Build", key, "", sb, BUFFER_SIZE, FILE_NAME); | ||
return sb.ToString(); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,11 +19,16 @@ | |
<StackPanel Margin="10" Orientation="Horizontal"> | ||
<Image Source="/Resources/Drawable/Icon.ico" Height="30" Margin="5"/> | ||
<StackPanel> | ||
<TextBlock FontSize="20" Text="{DynamicResource App.NameWithVersion}"/> | ||
<StackPanel Orientation="Horizontal"> | ||
<TextBlock FontSize="20" Text="{DynamicResource App.Name}"/> | ||
<TextBlock FontSize="20" Text="{Binding VersionName}"/> | ||
</StackPanel> | ||
|
||
<TextBlock Text="{DynamicResource App.Slogan}" Foreground="{DynamicResource SecondaryTextBrush}"/> | ||
</StackPanel> | ||
</StackPanel> | ||
|
||
|
||
<hc:Shield Command="{Binding OpenUrl}" CommandParameter="mailto:[email protected]" Margin="2" HorizontalAlignment="Center" Subject="{DynamicResource EMail}" Status="[email protected]" Color="#d8624c"/> | ||
<hc:Shield Margin="2" HorizontalAlignment="Center" Subject="{DynamicResource QQGroup}" Status="246177486" Color="#1182c3"/> | ||
<TextBlock HorizontalAlignment="Center" Text="www.atmb.top" TextDecorations="Underline"> | ||
|
@@ -43,17 +48,18 @@ | |
</TextBlock> | ||
</StackPanel> | ||
<StackPanel DockPanel.Dock="Bottom" Margin="0,0,0,10"> | ||
|
||
</StackPanel> | ||
|
||
<StackPanel DockPanel.Dock="Top" Width="200"> | ||
<StackPanel DockPanel.Dock="Top"> | ||
|
||
|
||
<DockPanel Margin="30,10,30,0"> | ||
<TextBlock DockPanel.Dock="Right" Text="{x:Static util:VersionInfos.GUIString}"/> | ||
<TextBlock DockPanel.Dock="Left" Text="{DynamicResource Version.AutumnBox}"/> | ||
</DockPanel> | ||
|
||
|
||
|
||
<DockPanel Margin="30,0,30,0"> | ||
<TextBlock DockPanel.Dock="Right" Text="{x:Static util:VersionInfos.BasicString}"/> | ||
<TextBlock DockPanel.Dock="Left" Text="{DynamicResource Version.Basic}"/> | ||
|
@@ -91,6 +97,18 @@ | |
<TextBlock DockPanel.Dock="Right" Text="{x:Static util:VersionInfos.SharpZipLibString}"/> | ||
<TextBlock DockPanel.Dock="Left" Text="SharpZipLib"/> | ||
</DockPanel> | ||
|
||
<Grid Height="1" Margin="25,5,25,5" Background="LightGray"/> | ||
|
||
<DockPanel Margin="30,0,30,0"> | ||
<TextBlock DockPanel.Dock="Right" Text="{Binding Commit}"/> | ||
<TextBlock DockPanel.Dock="Left" Text="{DynamicResource Version.Commit}"/> | ||
</DockPanel> | ||
|
||
<DockPanel Margin="30,0,30,0"> | ||
<TextBlock DockPanel.Dock="Right" Text="{Binding Tag}"/> | ||
<TextBlock DockPanel.Dock="Left" Text="{DynamicResource Version.Tag}"/> | ||
</DockPanel> | ||
</StackPanel> | ||
</DockPanel> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters