Removed BuildInfo constant

Indicate which version is currently installed in release list
This commit is contained in:
Robert committed 2023-02-28 22:45:34 +01:00
1 parent 1351796f42
commit 0852769cc9
9 files changed
+47 -55

No files matched your search

@@ -57,7 +57,7 @@ public class AboutTabViewModel : ActivatableViewModelBase
private async Task Activate()
{
AssemblyInformationalVersionAttribute? versionAttribute = typeof(AboutTabViewModel).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
Version = $"Version {versionAttribute?.InformationalVersion} build {Constants.BuildInfo.BuildNumberDisplay}";
Version = $"Version {Constants.CurrentVersion}";
try
{
@@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:settings="clr-namespace:Artemis.UI.Screens.Settings"
xmlns:updating="clr-namespace:Artemis.UI.Screens.Settings.Updating"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="1400"
x:Class="Artemis.UI.Screens.Settings.ReleasesTabView"
x:DataType="settings:ReleasesTabViewModel">
@@ -12,15 +13,29 @@
<ListBox Items="{CompiledBinding ReleaseViewModels}" SelectedItem="{CompiledBinding SelectedReleaseViewModel}">
<ListBox.ItemTemplate>
<DataTemplate x:DataType="updating:ReleaseViewModel">
<StackPanel Margin="4">
<TextBlock Text="{CompiledBinding Version}" VerticalAlignment="Center" />
<TextBlock Text="{CompiledBinding CreatedAt, StringFormat={}{0:g}}" VerticalAlignment="Center" Classes="subtitle" FontSize="13" />
</StackPanel>
<Panel>
<Grid Margin="4" IsVisible="{CompiledBinding IsCurrentVersion}" RowDefinitions="*,*" ColumnDefinitions="*,Auto">
<TextBlock Grid.Row="0" Grid.Column="0" Text="{CompiledBinding Version}" VerticalAlignment="Center" IsVisible="{CompiledBinding IsCurrentVersion}" FontWeight="SemiBold" />
<TextBlock Grid.Row="1" Grid.Column="0" Text="{CompiledBinding CreatedAt, StringFormat={}{0:g}}" VerticalAlignment="Center" Classes="subtitle" FontSize="13" />
<avalonia:MaterialIcon Grid.Row="0"
Grid.Column="1"
Grid.RowSpan="2"
Kind="CheckCircle"
ToolTip.Tip="Currently installed"
Foreground="{DynamicResource SystemAccentColorLight3}"
Width="20"
Height="20" />
</Grid>
<StackPanel Margin="4" IsVisible="{CompiledBinding !IsCurrentVersion}">
<TextBlock Text="{CompiledBinding Version}" VerticalAlignment="Center" />
<TextBlock Text="{CompiledBinding CreatedAt, StringFormat={}{0:g}}" VerticalAlignment="Center" Classes="subtitle" FontSize="13" />
</StackPanel>
</Panel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Border>
<ContentControl Grid.Column="1" Content="{CompiledBinding SelectedReleaseViewModel}"/>
<ContentControl Grid.Column="1" Content="{CompiledBinding SelectedReleaseViewModel}" />
</Grid>
</UserControl>
@@ -61,6 +61,7 @@ public class ReleaseViewModel : ActivatableViewModelBase
else
throw new PlatformNotSupportedException("Cannot auto update on the current platform");
ReleaseId = releaseId;
Version = version;
CreatedAt = createdAt;
@@ -144,6 +145,8 @@ public class ReleaseViewModel : ActivatableViewModelBase
set => RaiseAndSetIfChanged(ref _installationFinished, value);
}
public bool IsCurrentVersion => Version == Constants.CurrentVersion;
public void NavigateToSource()
{
Utilities.OpenUrl($"https://github.com/Artemis-RGB/Artemis/commit/{Commit}");