diff --git a/DiscordChatExporter.Gui/App.xaml.cs b/DiscordChatExporter.Gui/App.xaml.cs index c16022b..0116f6b 100644 --- a/DiscordChatExporter.Gui/App.xaml.cs +++ b/DiscordChatExporter.Gui/App.xaml.cs @@ -15,9 +15,11 @@ public partial class App public static string VersionString { get; } = Version.ToString(3); - public static string GitHubProjectUrl { get; } = "https://github.com/Tyrrrz/DiscordChatExporter"; + public static string ProjectUrl { get; } = "https://github.com/Tyrrrz/DiscordChatExporter"; - public static string GitHubProjectDocsUrl { get; } = GitHubProjectUrl + "/blob/master/.docs"; + public static string ChangelogUrl { get; } = ProjectUrl + "/blob/master/Changelog.md"; + + public static string DocumentationUrl { get; } = ProjectUrl + "/blob/master/.docs"; } public partial class App diff --git a/DiscordChatExporter.Gui/Services/SettingsService.cs b/DiscordChatExporter.Gui/Services/SettingsService.cs index f50809a..8b72cd3 100644 --- a/DiscordChatExporter.Gui/Services/SettingsService.cs +++ b/DiscordChatExporter.Gui/Services/SettingsService.cs @@ -1,4 +1,5 @@ -using DiscordChatExporter.Core.Exporting; +using System; +using DiscordChatExporter.Core.Exporting; using Microsoft.Win32; using Tyrrrz.Settings; @@ -20,6 +21,8 @@ public partial class SettingsService : SettingsManager public bool ShouldReuseAssets { get; set; } + public Version? LastAppVersion { get; set; } + public string? LastToken { get; set; } public ExportFormat LastExportFormat { get; set; } = ExportFormat.HtmlDark; diff --git a/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs b/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs index 1b920c1..47dc6df 100644 --- a/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs +++ b/DiscordChatExporter.Gui/ViewModels/Components/DashboardViewModel.cs @@ -83,7 +83,7 @@ public class DashboardViewModel : PropertyChangedBase await _dialogManager.ShowDialogAsync(dialog); } - public void ShowHelp() => ProcessEx.StartShellExecute(App.GitHubProjectDocsUrl); + public void ShowHelp() => ProcessEx.StartShellExecute(App.DocumentationUrl); public bool CanPopulateGuildsAndChannels => !IsBusy && !string.IsNullOrWhiteSpace(Token); diff --git a/DiscordChatExporter.Gui/ViewModels/RootViewModel.cs b/DiscordChatExporter.Gui/ViewModels/RootViewModel.cs index c8bdd23..e0b787f 100644 --- a/DiscordChatExporter.Gui/ViewModels/RootViewModel.cs +++ b/DiscordChatExporter.Gui/ViewModels/RootViewModel.cs @@ -106,6 +106,7 @@ public class RootViewModel : Screen, IHandle, IDisposable _settingsService.Load(); + // Sync theme with settings if (_settingsService.IsDarkModeEnabled) { App.SetDarkTheme(); @@ -114,6 +115,18 @@ public class RootViewModel : Screen, IHandle, IDisposable { App.SetLightTheme(); } + + // App has just been updated, display changelog + if (_settingsService.LastAppVersion != App.Version) + { + Notifications.Enqueue( + $"Successfully updated to {App.Name} v{App.VersionString}", + "CHANGELOG", () => ProcessEx.StartShellExecute(App.ChangelogUrl) + ); + + _settingsService.LastAppVersion = App.Version; + _settingsService.Save(); + } } protected override void OnClose()