From 2e8cf7a1610d2f0eea7cc5448e45b19f4ee961b4 Mon Sep 17 00:00:00 2001 From: Michael Delpach Date: Sat, 3 Oct 2015 09:29:47 +0800 Subject: [PATCH] Scrolling Capture close setting change --- ShareX.ScreenCaptureLib/Forms/ScrollingCaptureForm.cs | 7 ++----- ShareX.ScreenCaptureLib/ScrollingCaptureOptions.cs | 1 + ShareX/TaskHelpers.cs | 1 + ShareX/TaskSettings.cs | 3 +++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ShareX.ScreenCaptureLib/Forms/ScrollingCaptureForm.cs b/ShareX.ScreenCaptureLib/Forms/ScrollingCaptureForm.cs index 274b2396c..1e5c94087 100644 --- a/ShareX.ScreenCaptureLib/Forms/ScrollingCaptureForm.cs +++ b/ShareX.ScreenCaptureLib/Forms/ScrollingCaptureForm.cs @@ -251,11 +251,8 @@ private void StopCapture() EndingProcess(); isCapturing = false; - if (Options.AutoUpload) - { - StartProcess(); - Close(); - } + if (Options.AutoUpload) StartProcess(); + if (Options.AutoClose) Close(); } private void Clean() diff --git a/ShareX.ScreenCaptureLib/ScrollingCaptureOptions.cs b/ShareX.ScreenCaptureLib/ScrollingCaptureOptions.cs index 200724774..cb3fba2d3 100644 --- a/ShareX.ScreenCaptureLib/ScrollingCaptureOptions.cs +++ b/ShareX.ScreenCaptureLib/ScrollingCaptureOptions.cs @@ -40,6 +40,7 @@ public class ScrollingCaptureOptions public bool RemoveDuplicates { get; set; } = true; public bool AfterCaptureAutomaticallyCombine { get; set; } = true; public bool AutoUpload { get; set; } = false; + public bool AutoClose { get; set; } = false; public int TrimLeftEdge { get; set; } = 0; public int TrimTopEdge { get; set; } = 0; diff --git a/ShareX/TaskHelpers.cs b/ShareX/TaskHelpers.cs index b92a1f615..e6360d2d8 100644 --- a/ShareX/TaskHelpers.cs +++ b/ShareX/TaskHelpers.cs @@ -453,6 +453,7 @@ public static void OpenScrollingCapture(TaskSettings taskSettings = null, bool f { if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings(); + taskSettings.CaptureSettingsReference.ScrollingCaptureOptions.AutoClose = taskSettings.AdvancedSettings.AutoCloseScrollingCaptureWindow; ScrollingCaptureForm scrollingCaptureForm = new ScrollingCaptureForm(taskSettings.CaptureSettingsReference.ScrollingCaptureOptions, forceSelection); scrollingCaptureForm.ProcessRequested += image => UploadManager.RunImageTask(image, taskSettings); scrollingCaptureForm.Show(); diff --git a/ShareX/TaskSettings.cs b/ShareX/TaskSettings.cs index ec2bb8496..aeaa30ed9 100644 --- a/ShareX/TaskSettings.cs +++ b/ShareX/TaskSettings.cs @@ -417,6 +417,9 @@ public class TaskSettingsAdvanced Editor(typeof(DirectoryNameEditor), typeof(UITypeEditor))] public string CapturePath { get; set; } + [Category("Scrolling capture"), DefaultValue(false), Description("Automatically close scrolling capture window after completing the task.")] + public bool AutoCloseScrollingCaptureWindow { get; set; } + [Category("Upload"), Description("Files with these file extensions will be uploaded using image uploader."), Editor("System.Windows.Forms.Design.StringCollectionEditor,System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] public List ImageExtensions { get; set; }