From fdce8e2f1b5f0dfe725b4acd9c7e5d490555e6c0 Mon Sep 17 00:00:00 2001 From: Aidan M Date: Wed, 3 Jul 2024 20:24:50 +0100 Subject: [PATCH 1/8] Use default Windows file handler --- Wabbajack.App.Wpf/Util/UIUtils.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Wabbajack.App.Wpf/Util/UIUtils.cs b/Wabbajack.App.Wpf/Util/UIUtils.cs index 152de857..63cfb9e7 100644 --- a/Wabbajack.App.Wpf/Util/UIUtils.cs +++ b/Wabbajack.App.Wpf/Util/UIUtils.cs @@ -56,7 +56,6 @@ namespace Wabbajack } } - public static void OpenWebsite(Uri url) { Process.Start(new ProcessStartInfo("cmd.exe", $"/c start {url}") @@ -64,16 +63,17 @@ namespace Wabbajack CreateNoWindow = true, }); } - + public static void OpenFolder(AbsolutePath path) { - Process.Start(new ProcessStartInfo(KnownFolders.Windows.Combine("explorer.exe").ToString(), path.ToString()) + Process.Start(new ProcessStartInfo() { - CreateNoWindow = true, + FileName = path.ToString(), + UseShellExecute = true, + Verb = "open" }); } - public static AbsolutePath OpenFileDialog(string filter, string initialDirectory = null) { OpenFileDialog ofd = new OpenFileDialog(); From 22fcd4b5c8f1cd996e8be884a11f4708c8985145 Mon Sep 17 00:00:00 2001 From: Aidan M Date: Wed, 3 Jul 2024 20:53:35 +0100 Subject: [PATCH 2/8] Add check to ensure it is definitely a folder being opened, and modify other hard-coded `explorer.exe` reference --- Wabbajack.App.Wpf/Util/UIUtils.cs | 9 ++++++++- .../View Models/Installers/MO2InstallerVM.cs | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Wabbajack.App.Wpf/Util/UIUtils.cs b/Wabbajack.App.Wpf/Util/UIUtils.cs index 63cfb9e7..7368d2bc 100644 --- a/Wabbajack.App.Wpf/Util/UIUtils.cs +++ b/Wabbajack.App.Wpf/Util/UIUtils.cs @@ -19,6 +19,7 @@ using Wabbajack.Extensions; using Wabbajack.Models; using Wabbajack.Paths; using Wabbajack.Paths.IO; +using System.Linq; namespace Wabbajack { @@ -66,9 +67,15 @@ namespace Wabbajack public static void OpenFolder(AbsolutePath path) { + String folderPath = path.ToString(); + if (!folderPath.EndsWith(Path.DirectorySeparatorChar.ToString())) + { + folderPath += Path.DirectorySeparatorChar.ToString(); + } + Process.Start(new ProcessStartInfo() { - FileName = path.ToString(), + FileName = folderPath, UseShellExecute = true, Verb = "open" }); diff --git a/Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs b/Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs index f9bc25a4..623381e0 100644 --- a/Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Installers/MO2InstallerVM.cs @@ -77,7 +77,7 @@ namespace Wabbajack public void AfterInstallNavigation() { - Process.Start("explorer.exe", Location.TargetPath.ToString()); + UIUtils.OpenFolder(Location.TargetPath); } public async Task Install() From 2d72370c32bc0762cbb0c0f849e703ecd19ac22d Mon Sep 17 00:00:00 2001 From: Aidan M Date: Wed, 3 Jul 2024 20:55:24 +0100 Subject: [PATCH 3/8] Remove accidentally added import --- Wabbajack.App.Wpf/Util/UIUtils.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Wabbajack.App.Wpf/Util/UIUtils.cs b/Wabbajack.App.Wpf/Util/UIUtils.cs index 7368d2bc..53e45eff 100644 --- a/Wabbajack.App.Wpf/Util/UIUtils.cs +++ b/Wabbajack.App.Wpf/Util/UIUtils.cs @@ -19,7 +19,6 @@ using Wabbajack.Extensions; using Wabbajack.Models; using Wabbajack.Paths; using Wabbajack.Paths.IO; -using System.Linq; namespace Wabbajack { From c8bce3a84984432ed37e695bda6e7467b26fac30 Mon Sep 17 00:00:00 2001 From: Aidan M Date: Fri, 5 Jul 2024 12:13:31 +0100 Subject: [PATCH 4/8] Change `String` to `string` to align more with overall style --- Wabbajack.App.Wpf/Util/UIUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Wabbajack.App.Wpf/Util/UIUtils.cs b/Wabbajack.App.Wpf/Util/UIUtils.cs index 53e45eff..b4fc10ac 100644 --- a/Wabbajack.App.Wpf/Util/UIUtils.cs +++ b/Wabbajack.App.Wpf/Util/UIUtils.cs @@ -66,7 +66,7 @@ namespace Wabbajack public static void OpenFolder(AbsolutePath path) { - String folderPath = path.ToString(); + string folderPath = path.ToString(); if (!folderPath.EndsWith(Path.DirectorySeparatorChar.ToString())) { folderPath += Path.DirectorySeparatorChar.ToString(); From 1c5726245ae164a935565606d6f85ca45aadfed3 Mon Sep 17 00:00:00 2001 From: JanuarySnow Date: Wed, 17 Jul 2024 14:03:05 +0100 Subject: [PATCH 5/8] added sanity checks for dragmove for actual button being pressed --- Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs | 7 +++++-- Wabbajack.App.Wpf/Views/MainWindow.xaml.cs | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs b/Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs index a77c5b78..76f78e14 100644 --- a/Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs +++ b/Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs @@ -9,6 +9,7 @@ using System.Windows.Controls; using System.Windows.Input; using MahApps.Metro.Controls; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; using Microsoft.Web.WebView2.Wpf; using ReactiveUI; using Wabbajack.Common; @@ -25,7 +26,6 @@ public partial class BrowserWindow : MetroWindow { InitializeComponent(); - _disposable = new CompositeDisposable(); _serviceProvider = serviceProvider; Browser = _serviceProvider.GetRequiredService(); @@ -43,7 +43,10 @@ public partial class BrowserWindow : MetroWindow private void UIElement_OnMouseDown(object sender, MouseButtonEventArgs e) { - base.DragMove(); + if (e.LeftButton == MouseButtonState.Pressed) + { + base.DragMove(); + } } private void BrowserWindow_OnActivated(object sender, EventArgs e) diff --git a/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs b/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs index 2135f5c0..dd43c0cd 100644 --- a/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs +++ b/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs @@ -8,6 +8,7 @@ using System.Windows.Input; using DynamicData.Binding; using MahApps.Metro.Controls; using Microsoft.Extensions.Logging; +using NLog; using ReactiveUI; using Wabbajack.Common; using Wabbajack.Messages; @@ -144,7 +145,10 @@ namespace Wabbajack private void UIElement_OnMouseDown(object sender, MouseButtonEventArgs e) { - this.DragMove(); + if (e.LeftButton == MouseButtonState.Pressed) + { + this.DragMove(); + } } } From d911eab6d868a517ffd39489caf74dca078297ed Mon Sep 17 00:00:00 2001 From: JanuarySnow Date: Wed, 17 Jul 2024 14:04:02 +0100 Subject: [PATCH 6/8] redundant includes --- Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs | 1 - Wabbajack.App.Wpf/Views/MainWindow.xaml.cs | 1 - 2 files changed, 2 deletions(-) diff --git a/Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs b/Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs index 76f78e14..d9fb6645 100644 --- a/Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs +++ b/Wabbajack.App.Wpf/Views/BrowserWindow.xaml.cs @@ -9,7 +9,6 @@ using System.Windows.Controls; using System.Windows.Input; using MahApps.Metro.Controls; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; using Microsoft.Web.WebView2.Wpf; using ReactiveUI; using Wabbajack.Common; diff --git a/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs b/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs index dd43c0cd..13c14e6f 100644 --- a/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs +++ b/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs @@ -8,7 +8,6 @@ using System.Windows.Input; using DynamicData.Binding; using MahApps.Metro.Controls; using Microsoft.Extensions.Logging; -using NLog; using ReactiveUI; using Wabbajack.Common; using Wabbajack.Messages; From 8281e77247fd9abf967c6a6e4aac5436738fb508 Mon Sep 17 00:00:00 2001 From: trawzified <55751269+tr4wzified@users.noreply.github.com> Date: Tue, 13 Aug 2024 22:13:56 +0200 Subject: [PATCH 7/8] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d76f815..2ecfdf9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * This issue only affected Fallout 3, Fallout NV and Skyrim LE * Added logging to determine which downloaded files cannot be hashed * This could occur in the downloading phase when installing a modlist when there are broken/corrupted files in the downloads folder +* Fixed Wabbajack crashing when double-clicking the browser window titlebar or URL #### Version - 3.7.0.0 - 6/21/2024 * Added Starfield support From f58b6190c6feeec89a7a5df69b98dab919e40731 Mon Sep 17 00:00:00 2001 From: trawzified <55751269+tr4wzified@users.noreply.github.com> Date: Tue, 13 Aug 2024 22:27:48 +0200 Subject: [PATCH 8/8] Update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ecfdf9e..0d6e32ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Added logging to determine which downloaded files cannot be hashed * This could occur in the downloading phase when installing a modlist when there are broken/corrupted files in the downloads folder * Fixed Wabbajack crashing when double-clicking the browser window titlebar or URL +* Fixed Wabbajack always using explorer.exe instead of the default file browser #### Version - 3.7.0.0 - 6/21/2024 * Added Starfield support