diff --git a/ShareX.HelpersLib/Colors/GradientInfo.cs b/ShareX.HelpersLib/Colors/GradientInfo.cs index cb2b02e21..9b5347e64 100644 --- a/ShareX.HelpersLib/Colors/GradientInfo.cs +++ b/ShareX.HelpersLib/Colors/GradientInfo.cs @@ -23,6 +23,7 @@ You should have received a copy of the GNU General Public License #endregion License Information (GPL v3) +using Newtonsoft.Json; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; @@ -38,6 +39,7 @@ public class GradientInfo public List Colors { get; set; } + [JsonIgnore] public bool IsValid => Colors != null && Colors.Count > 0; public GradientInfo() diff --git a/ShareX.HelpersLib/Forms/GradientPickerForm.cs b/ShareX.HelpersLib/Forms/GradientPickerForm.cs index 315747ca3..5ee89266a 100644 --- a/ShareX.HelpersLib/Forms/GradientPickerForm.cs +++ b/ShareX.HelpersLib/Forms/GradientPickerForm.cs @@ -197,7 +197,7 @@ private void nudLocation_ValueChanged(object sender, EventArgs e) { if (isReady) { - GradientStop gradientStop = GetSelectedGradientStop(out ListViewItem lvi); + GradientStop gradientStop = GetSelectedGradientStop(); if (gradientStop != null) { diff --git a/ShareX/Program.cs b/ShareX/Program.cs index 9bf3f3f6b..675a9fabe 100644 --- a/ShareX/Program.cs +++ b/ShareX/Program.cs @@ -232,6 +232,7 @@ public static string ScreenshotsFolder } public static string ToolsFolder => Path.Combine(PersonalFolder, "Tools"); + public static string ImageEffectsFolder => Path.Combine(PersonalFolder, "ImageEffects"); public static string ScreenRecorderCacheFilePath => Path.Combine(PersonalFolder, "ScreenRecorder.avi"); public static string DefaultFFmpegFilePath => Path.Combine(ToolsFolder, "ffmpeg.exe"); public static string ChromeHostManifestFilePath => Path.Combine(ToolsFolder, "Chrome-host-manifest.json"); @@ -270,6 +271,7 @@ private static void Main(string[] args) if (CheckAdminTasks()) return; // If ShareX opened just for be able to execute task as Admin UpdatePersonalPath(); + CreateParentFolders(); DebugHelper.Init(LogsFilePath); @@ -470,6 +472,15 @@ private static void UpdatePersonalPath() } } + private static void CreateParentFolders() + { + Helpers.CreateDirectoryFromDirectoryPath(SettingManager.BackupFolder); + Helpers.CreateDirectoryFromDirectoryPath(ImageEffectsFolder); + Helpers.CreateDirectoryFromDirectoryPath(LogsFolder); + Helpers.CreateDirectoryFromDirectoryPath(ScreenshotsParentFolder); + Helpers.CreateDirectoryFromDirectoryPath(ToolsFolder); + } + private static void MigratePersonalPathConfig() { if (File.Exists(PreviousPersonalPathConfigFilePath))