From 7cfcd7ea440de4df45239a69767bf56ba8c1ddb9 Mon Sep 17 00:00:00 2001 From: "sushi.at" Date: Thu, 23 Nov 2023 14:22:38 +0000 Subject: [PATCH 1/2] Moved canexexute change into reportprogress Bumped version and added changelog Added opensky folder check to error handling --- OpenSky.Agent/App.xaml.cs | 6 ++++++ OpenSky.Agent/Properties/AssemblyInfo.cs | 4 ++-- OpenSky.Agent/Views/Models/AircraftTypesViewModel.cs | 7 +++++-- changelog.txt | 5 +++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/OpenSky.Agent/App.xaml.cs b/OpenSky.Agent/App.xaml.cs index 97ffc8b..9852faa 100644 --- a/OpenSky.Agent/App.xaml.cs +++ b/OpenSky.Agent/App.xaml.cs @@ -305,6 +305,12 @@ private static void AppDispatcherUnhandledException( try { + var openSkyFolder = Environment.ExpandEnvironmentVariables("%localappdata%\\OpenSky"); + if (!Directory.Exists(openSkyFolder)) + { + Directory.CreateDirectory(openSkyFolder); + } + File.AppendAllText(filePath, crashReport); ModernWpf.MessageBox.Show( e.Exception.Message + "\r\n\r\nPlease check agent_crash.log for details!", diff --git a/OpenSky.Agent/Properties/AssemblyInfo.cs b/OpenSky.Agent/Properties/AssemblyInfo.cs index c4e0140..ccc5344 100644 --- a/OpenSky.Agent/Properties/AssemblyInfo.cs +++ b/OpenSky.Agent/Properties/AssemblyInfo.cs @@ -21,8 +21,8 @@ [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] -[assembly: AssemblyVersion("0.5.0")] -[assembly: AssemblyFileVersion("0.5.0")] +[assembly: AssemblyVersion("0.5.1")] +[assembly: AssemblyFileVersion("0.5.1")] // This allows us to detect debug mode in XAML #if DEBUG diff --git a/OpenSky.Agent/Views/Models/AircraftTypesViewModel.cs b/OpenSky.Agent/Views/Models/AircraftTypesViewModel.cs index 06f8003..e29013f 100644 --- a/OpenSky.Agent/Views/Models/AircraftTypesViewModel.cs +++ b/OpenSky.Agent/Views/Models/AircraftTypesViewModel.cs @@ -1906,8 +1906,11 @@ private void GetUserRoles() var result = UserSessionService.Instance.UpdateUserRoles().Result; if (result) { - this.GetUserRolesCommand.ReportProgress(() => this.RefreshAircraftTypesCommand.DoExecute(null)); - this.GetAircraftUpgradesCommand.CanExecute = UserSessionService.Instance.IsModerator; + this.GetUserRolesCommand.ReportProgress(() => + { + this.RefreshAircraftTypesCommand.DoExecute(null); + this.GetAircraftUpgradesCommand.CanExecute = UserSessionService.Instance.IsModerator; + }); } else { diff --git a/changelog.txt b/changelog.txt index 19b7cf7..f1daef4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,11 @@ OpenSky Flight Tracking Agent Changelog ====================================================================================== +-------------------------------------------------------------------------------------- +Version 0.5.1 (ALPHA5) +-------------------------------------------------------------------------------------- +- Fixed crash in aircraft type editor + -------------------------------------------------------------------------------------- Version 0.5.0 (ALPHA5) -------------------------------------------------------------------------------------- From 44938a6cf3a907477fe276c47596ae53476eb2cf Mon Sep 17 00:00:00 2001 From: "sushi.at" Date: Thu, 23 Nov 2023 14:25:06 +0000 Subject: [PATCH 2/2] Showing full folder location for crash log in crash event --- OpenSky.Agent/App.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSky.Agent/App.xaml.cs b/OpenSky.Agent/App.xaml.cs index 9852faa..8f6b66c 100644 --- a/OpenSky.Agent/App.xaml.cs +++ b/OpenSky.Agent/App.xaml.cs @@ -313,7 +313,7 @@ private static void AppDispatcherUnhandledException( File.AppendAllText(filePath, crashReport); ModernWpf.MessageBox.Show( - e.Exception.Message + "\r\n\r\nPlease check agent_crash.log for details!", + $"{e.Exception.Message}\r\n\r\nPlease check {filePath} for details!", "Unexpected error!", MessageBoxButton.OK, MessageBoxImage.Error);