add version info to main window

This commit is contained in:
2025-12-15 10:03:38 +01:00
parent fbf3b6826c
commit 21acb733b6
4 changed files with 5 additions and 2 deletions

View File

@@ -53,9 +53,10 @@ namespace BlueMine
/// </summary> /// </summary>
private async void OnStartup(object sender, StartupEventArgs e) private async void OnStartup(object sender, StartupEventArgs e)
{ {
#if !DEBUG
var update = new UpdateManager(); var update = new UpdateManager();
await update.CheckAndInstallAsync(); await update.CheckAndInstallAsync();
#endif
await _host.StartAsync(); await _host.StartAsync();
var mainWindow = _host.Services.GetRequiredService<MainWindow>(); var mainWindow = _host.Services.GetRequiredService<MainWindow>();
mainWindow.Show(); mainWindow.Show();

View File

@@ -256,5 +256,6 @@
<ui:ProgressRing x:Name="progressRing" Grid.Row="4" Height="10" Width="10" Margin="10" HorizontalAlignment="Left" IsIndeterminate="True" /> <ui:ProgressRing x:Name="progressRing" Grid.Row="4" Height="10" Width="10" Margin="10" HorizontalAlignment="Left" IsIndeterminate="True" />
<ui:TextBlock x:Name="statusTextBlock" Grid.Row="4" Grid.ColumnSpan="6" FontSize="8" Text="Staus: OK" Margin="30, 10, 10, 10" /> <ui:TextBlock x:Name="statusTextBlock" Grid.Row="4" Grid.ColumnSpan="6" FontSize="8" Text="Staus: OK" Margin="30, 10, 10, 10" />
<ui:TextBlock x:Name="versionTextBlock" Grid.Row="4" Grid.Column="2" HorizontalAlignment="Right" FontSize="8" Text="0.0.0" Margin="10" />
</Grid> </Grid>
</ui:FluentWindow> </ui:FluentWindow>

View File

@@ -37,6 +37,7 @@ namespace BlueMine
apiUrlTextBox.Text = _config.RedmineUrl; apiUrlTextBox.Text = _config.RedmineUrl;
apiPasswordBox.PlaceholderText = new string('●', _config.ApiKey.Length); apiPasswordBox.PlaceholderText = new string('●', _config.ApiKey.Length);
mainCalendar.SelectedDate = DateTime.Today; mainCalendar.SelectedDate = DateTime.Today;
versionTextBlock.Text = UpdateManager.CurrentVersion;
if(await TestConnection()) if(await TestConnection())
{ {

View File

@@ -8,7 +8,7 @@ namespace Blueberry
public class UpdateManager public class UpdateManager
{ {
private const string releaseUrl = "https://git.technopunk.space/api/v1/repos/tomi/Blueberry/releases/latest"; private const string releaseUrl = "https://git.technopunk.space/api/v1/repos/tomi/Blueberry/releases/latest";
private const string CurrentVersion = "0.1.0"; public const string CurrentVersion = "0.1.1";
public async Task CheckAndInstallAsync() public async Task CheckAndInstallAsync()
{ {