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}");
@@ -25,29 +25,29 @@ public class StartupWizardViewModel : DialogViewModelBase<bool>
private readonly IAutoRunProvider? _autoRunProvider;
private readonly IRgbService _rgbService;
private readonly ISettingsService _settingsService;
private readonly IUpdateService _updateService;
private readonly IWindowService _windowService;
private int _currentStep;
private bool _showContinue;
private bool _showFinish;
private bool _showGoBack;
public StartupWizardViewModel(IContainer container, ISettingsService settingsService, IRgbService rgbService, IPluginManagementService pluginManagementService, IWindowService windowService,
IUpdateService updateService, ISettingsVmFactory settingsVmFactory)
public StartupWizardViewModel(IContainer container,
ISettingsService settingsService,
IRgbService rgbService,
IPluginManagementService pluginManagementService,
IWindowService windowService,
ISettingsVmFactory settingsVmFactory)
{
_settingsService = settingsService;
_rgbService = rgbService;
_windowService = windowService;
_updateService = updateService;
_autoRunProvider = container.Resolve<IAutoRunProvider>(IfUnresolved.ReturnDefault);
Continue = ReactiveCommand.Create(ExecuteContinue);
GoBack = ReactiveCommand.Create(ExecuteGoBack);
SkipOrFinishWizard = ReactiveCommand.Create(ExecuteSkipOrFinishWizard);
SelectLayout = ReactiveCommand.Create<string>(ExecuteSelectLayout);
AssemblyInformationalVersionAttribute? versionAttribute = typeof(StartupWizardViewModel).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
Version = $"Version {versionAttribute?.InformationalVersion} build {Constants.BuildInfo.BuildNumberDisplay}";
Version = $"Version {Constants.CurrentVersion}";
// Take all compatible plugins that have an always-enabled device provider
DeviceProviders = new ObservableCollection<PluginViewModel>(pluginManagementService.GetAllPlugins()