From 4e95e78a69bdcc7c56a2ee7e77351dad4d0c3cb9 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Tue, 17 Sep 2019 20:17:12 -0600 Subject: [PATCH] fix issue #27 --- CHANGELOG.md | 1 + Wabbajack/AppState.cs | 30 +++++++++++++++--------------- Wabbajack/Installer.cs | 9 +++------ Wabbajack/Wabbajack.csproj | 10 +++++++--- Wabbajack/packages.config | 4 ++-- 5 files changed, 28 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 274d6a8e..107dc0cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ * Include WABBAJACK_INCLUDE files before including patches * Ignore .bin and .refcache files (DynDOLOD temp files) * Shell out to cmd.exe for VFS cleaning should fix "ReadOnlyFile" errors once and for all +* Switch out folder selection routines for Win32 APIs, should fix issue #27 #### Version 0.9.1 - 9/5/2019 * Fixed a bug where having only one profile selected would result in no profiles being selected diff --git a/Wabbajack/AppState.cs b/Wabbajack/AppState.cs index ee261fa9..0f5735f3 100644 --- a/Wabbajack/AppState.cs +++ b/Wabbajack/AppState.cs @@ -9,7 +9,6 @@ using System.Threading; using System.Windows; using System.Windows.Input; using System.Windows.Threading; -using Ookii.Dialogs.Wpf; using Wabbajack.Common; namespace Wabbajack @@ -280,24 +279,27 @@ namespace Wabbajack { if (Mode == "Installing") { - var ofd = new VistaFolderBrowserDialog(); - ofd.Description = "Select Installation Directory"; - ofd.UseDescriptionForTitle = true; - if (ofd.ShowDialog() == true) + var folder = UIUtils.ShowFolderSelectionDialoag("Select Installation directory"); + if (folder != null) { - Location = ofd.SelectedPath; + Location = folder; if (_downloadLocation == null) DownloadLocation = Path.Combine(Location, "downloads"); } } else { - var fsd = new VistaOpenFileDialog(); - fsd.Title = "Select a ModOrganizer modlist.txt file"; - fsd.Filter = "modlist.txt|modlist.txt"; - if (fsd.ShowDialog() == true) + var folder = UIUtils.ShowFolderSelectionDialoag("Select Your MO2 profile directory"); + + if (folder != null) { - Location = fsd.FileName; + var file = Path.Combine(folder, "modlist.txt"); + if (!File.Exists(file)) + { + Utils.Log($"No modlist.txt found at {file}"); + } + + Location = file; ConfigureForBuild(); } } @@ -305,10 +307,8 @@ namespace Wabbajack private void ExecuteChangeDownloadPath() { - var ofd = new VistaFolderBrowserDialog(); - ofd.Description = "Select a location for MO2 downloads"; - ofd.UseDescriptionForTitle = true; - if (ofd.ShowDialog() == true) DownloadLocation = ofd.SelectedPath; + var folder = UIUtils.ShowFolderSelectionDialoag("Select a location for MO2 downloads"); + if (folder != null) DownloadLocation = folder; } private void ConfigureForBuild() diff --git a/Wabbajack/Installer.cs b/Wabbajack/Installer.cs index c91ff243..e8ffbe5b 100644 --- a/Wabbajack/Installer.cs +++ b/Wabbajack/Installer.cs @@ -12,7 +12,6 @@ using System.Windows; using CG.Web.MegaApiClient; using Compression.BSA; using K4os.Compression.LZ4.Streams; -using Ookii.Dialogs.Wpf; using VFS; using Wabbajack.Common; @@ -173,12 +172,10 @@ namespace Wabbajack private bool LocateGameFolder() { - var vf = new VistaFolderBrowserDialog(); - vf.Description = "Please Locate Your Game Installation Path"; - vf.UseDescriptionForTitle = true; - if (vf.ShowDialog() == true) + var fs = UIUtils.ShowFolderSelectionDialoag("Please locate your game installation path"); + if (fs != null) { - GameFolder = vf.SelectedPath; + GameFolder = fs; return true; } diff --git a/Wabbajack/Wabbajack.csproj b/Wabbajack/Wabbajack.csproj index c90ed6f6..958472a9 100644 --- a/Wabbajack/Wabbajack.csproj +++ b/Wabbajack/Wabbajack.csproj @@ -117,15 +117,18 @@ ..\packages\MegaApiClient.1.7.1\lib\net46\MegaApiClient.dll + + ..\packages\Microsoft-WindowsAPICodePack-Core.1.1.3.3\lib\net452\Microsoft.WindowsAPICodePack.dll + + + ..\packages\Microsoft-WindowsAPICodePack-Shell.1.1.3.3\lib\net452\Microsoft.WindowsAPICodePack.Shell.dll + ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll ..\packages\Newtonsoft.Json.Bson.1.0.2\lib\net45\Newtonsoft.Json.Bson.dll - - ..\packages\Ookii.Dialogs.Wpf.1.1.0\lib\net45\Ookii.Dialogs.Wpf.dll - ..\packages\SharpCompress.0.23.0\lib\net45\SharpCompress.dll @@ -178,6 +181,7 @@ + MSBuild:Compile Designer diff --git a/Wabbajack/packages.config b/Wabbajack/packages.config index 080cca2b..6f2badc6 100644 --- a/Wabbajack/packages.config +++ b/Wabbajack/packages.config @@ -1,5 +1,4 @@  - @@ -9,9 +8,10 @@ + + -