diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1d1c1e924..8997b4ba6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,7 +15,7 @@ steps: - task: DotNetCoreInstaller@0 displayName: 'Use .NET Core sdk 3.0' inputs: - version: '3.0.100-preview-009996' + version: '3.0.100-preview-009812' - task: NuGetToolInstaller@0 displayName: 'Use NuGet 4.9.2' diff --git a/src/Greenshot.Addon.Win10/Win10FormEnhancer.cs b/src/Greenshot.Addon.Win10/Win10FormEnhancer.cs index 7a19198ee..e43e33a68 100644 --- a/src/Greenshot.Addon.Win10/Win10FormEnhancer.cs +++ b/src/Greenshot.Addon.Win10/Win10FormEnhancer.cs @@ -24,6 +24,7 @@ #if !NETCOREAPP3_0 using System; +using System.Drawing; using System.Windows.Forms; using Greenshot.Addons.Interfaces; using Microsoft.Toolkit.Forms.UI.XamlHost; @@ -41,7 +42,6 @@ namespace Greenshot.Addon.Win10 { // TODO: Fix the code below, when the following is solved: https://github.com/windows-toolkit/Microsoft.Toolkit.Win32/issues/16#issuecomment-451337186 return; - // InkCanvas inkCanvasHost = new WindowsXamlHost(); inkCanvasHost.InitialTypeName = "Windows.UI.Xaml.Controls.InkCanvas"; @@ -57,6 +57,8 @@ namespace Greenshot.Addon.Win10 inkToolbarHost.Dock = DockStyle.Top; inkCanvasHost.Dock = DockStyle.Fill; + inkCanvasHost.BackColor = Color.Transparent; + // Add to Window target.Controls.Add(inkToolbarHost); target.Controls.Add(inkCanvasHost); diff --git a/src/Greenshot.Addons/ViewModels/FileConfigPartViewModel.cs b/src/Greenshot.Addons/ViewModels/FileConfigPartViewModel.cs index 26de11e8b..d6ddaed52 100644 --- a/src/Greenshot.Addons/ViewModels/FileConfigPartViewModel.cs +++ b/src/Greenshot.Addons/ViewModels/FileConfigPartViewModel.cs @@ -97,6 +97,26 @@ namespace Greenshot.Addons.ViewModels } } + /// + /// This opens the directory selection dialog + /// + public void SelectOutputPath() + { + using (var folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog()) + { + // Get the storage location and replace the environment variables + folderBrowserDialog.SelectedPath = FilenameHelper.FillVariables(CoreConfiguration.OutputFilePath, false); + if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + // Only change if there is a change, otherwise we might overwrite the environment variables + if (folderBrowserDialog.SelectedPath != null && !folderBrowserDialog.SelectedPath.Equals(FilenameHelper.FillVariables(CoreConfiguration.OutputFilePath, false))) + { + CoreConfiguration.OutputFilePath = folderBrowserDialog.SelectedPath; + } + } + } + } + /// /// Specifies if the global settings can be modified, which is the case when there are is no DestinationFileConfiguration /// diff --git a/src/Greenshot.Addons/Views/FileConfigPartView.xaml b/src/Greenshot.Addons/Views/FileConfigPartView.xaml index fd7d92d5e..78ff968d0 100644 --- a/src/Greenshot.Addons/Views/FileConfigPartView.xaml +++ b/src/Greenshot.Addons/Views/FileConfigPartView.xaml @@ -23,6 +23,12 @@ + +