Added Scrolling capture tab for AutoClose setting

This commit is contained in:
Jaex 2015-10-04 20:59:47 +03:00
parent b85d9a3086
commit 4dc9ed8397
6 changed files with 113 additions and 16 deletions

View file

@ -24,30 +24,54 @@
#endregion License Information (GPL v3)
using ShareX.ScreenCaptureLib;
using System.ComponentModel;
namespace ShareX
{
public class ScrollingCaptureOptions
{
[DefaultValue(ScrollingCaptureScrollMethod.Automatic)]
public ScrollingCaptureScrollMethod ScrollMethod { get; set; } = ScrollingCaptureScrollMethod.Automatic;
[DefaultValue(500)]
public int StartDelay { get; set; } = 500;
[DefaultValue(500)]
public int ScrollDelay { get; set; } = 500;
[DefaultValue(20)]
public int MaximumScrollCount { get; set; } = 20;
[DefaultValue(true)]
public bool StartSelectionAutomatically { get; set; } = true;
[DefaultValue(false)]
public bool StartCaptureAutomatically { get; set; } = false;
[DefaultValue(true)]
public bool ScrollTopBeforeCapture { get; set; } = true;
[DefaultValue(true)]
public bool AutoDetectScrollEnd { get; set; } = true;
[DefaultValue(true)]
public bool RemoveDuplicates { get; set; } = true;
[DefaultValue(true)]
public bool AfterCaptureAutomaticallyCombine { get; set; } = true;
[DefaultValue(false)]
public bool AutoUpload { get; set; } = false;
[DefaultValue(false), Description("Automatically close scrolling capture window after completing the task.")]
public bool AutoClose { get; set; } = false;
public int TrimLeftEdge { get; set; } = 0;
public int TrimTopEdge { get; set; } = 0;
public int TrimRightEdge { get; set; } = 0;
public int TrimBottomEdge { get; set; } = 0;
public int CombineAdjustmentVertical { get; set; } = 0;
public int CombineAdjustmentLastVertical { get; set; } = 0;
public int IgnoreLast { get; set; } = 0;
public int TrimLeftEdge = 0;
public int TrimTopEdge = 0;
public int TrimRightEdge = 0;
public int TrimBottomEdge = 0;
public int CombineAdjustmentVertical = 0;
public int CombineAdjustmentLastVertical = 0;
public int IgnoreLast = 0;
}
}

View file

@ -200,6 +200,8 @@ private void InitializeComponent()
this.pgTaskSettings = new System.Windows.Forms.PropertyGrid();
this.chkUseDefaultAdvancedSettings = new System.Windows.Forms.CheckBox();
this.tttvMain = new ShareX.HelpersLib.TabToTreeView();
this.tpScrollingCapture = new System.Windows.Forms.TabPage();
this.pgScrollingCapture = new System.Windows.Forms.PropertyGrid();
this.tcTaskSettings.SuspendLayout();
this.tpTask.SuspendLayout();
this.cmsDestinations.SuspendLayout();
@ -247,6 +249,7 @@ private void InitializeComponent()
this.tpVideoThumbnailer.SuspendLayout();
this.tpIRCClient.SuspendLayout();
this.tpAdvanced.SuspendLayout();
this.tpScrollingCapture.SuspendLayout();
this.SuspendLayout();
//
// cmsAfterCapture
@ -786,6 +789,7 @@ private void InitializeComponent()
this.tcCapture.Controls.Add(this.tpCaptureGeneral);
this.tcCapture.Controls.Add(this.tpRegionCapture);
this.tcCapture.Controls.Add(this.tpScreenRecorder);
this.tcCapture.Controls.Add(this.tpScrollingCapture);
this.tcCapture.Controls.Add(this.tpRectangleAnnotate);
resources.ApplyResources(this.tcCapture, "tcCapture");
this.tcCapture.Name = "tcCapture";
@ -1655,6 +1659,21 @@ private void InitializeComponent()
this.tttvMain.TreeViewSize = 190;
this.tttvMain.TabChanged += new ShareX.HelpersLib.TabToTreeView.TabChangedEventHandler(this.tttvMain_TabChanged);
//
// tpScrollingCapture
//
this.tpScrollingCapture.Controls.Add(this.pgScrollingCapture);
resources.ApplyResources(this.tpScrollingCapture, "tpScrollingCapture");
this.tpScrollingCapture.Name = "tpScrollingCapture";
this.tpScrollingCapture.UseVisualStyleBackColor = true;
//
// pgScrollingCapture
//
this.pgScrollingCapture.CategoryForeColor = System.Drawing.SystemColors.InactiveCaptionText;
resources.ApplyResources(this.pgScrollingCapture, "pgScrollingCapture");
this.pgScrollingCapture.Name = "pgScrollingCapture";
this.pgScrollingCapture.PropertySort = System.Windows.Forms.PropertySort.NoSort;
this.pgScrollingCapture.ToolbarVisible = false;
//
// TaskSettingsForm
//
resources.ApplyResources(this, "$this");
@ -1730,6 +1749,7 @@ private void InitializeComponent()
this.tpIRCClient.ResumeLayout(false);
this.tpAdvanced.ResumeLayout(false);
this.tpAdvanced.PerformLayout();
this.tpScrollingCapture.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -1906,5 +1926,7 @@ private void InitializeComponent()
private System.Windows.Forms.PropertyGrid pgVideoThumbnailer;
private System.Windows.Forms.TabPage tpIRCClient;
private System.Windows.Forms.PropertyGrid pgIRCClient;
private System.Windows.Forms.TabPage tpScrollingCapture;
private System.Windows.Forms.PropertyGrid pgScrollingCapture;
}
}

View file

@ -235,6 +235,10 @@ public TaskSettingsForm(TaskSettings hotkeySetting, bool isDefault = false)
chkRunScreencastCLI.Checked = cboEncoder.Enabled = btnEncoderConfig.Enabled = TaskSettings.CaptureSettings.RunScreencastCLI;
UpdateVideoEncoders();
// Capture / Scrolling capture
if (TaskSettings.CaptureSettings.ScrollingCaptureOptions == null) TaskSettings.CaptureSettings.ScrollingCaptureOptions = new ScrollingCaptureOptions();
pgScrollingCapture.SelectedObject = TaskSettings.CaptureSettings.ScrollingCaptureOptions;
// Actions
TaskHelpers.AddDefaultExternalPrograms(TaskSettings);
TaskSettings.ExternalPrograms.ForEach(AddFileAction);

View file

@ -1187,7 +1187,7 @@
</data>
<data name="lblImageJPEGQualityHint.Text" xml:space="preserve">
<value>0 - 100</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;lblImageJPEGQualityHint.Name" xml:space="preserve">
<value>lblImageJPEGQualityHint</value>
</data>
@ -1817,7 +1817,7 @@
</data>
<data name="btnCaptureTransmitBoundsFromMonitorToCustomBounds.Text" xml:space="preserve">
<value>&gt;&gt;</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;btnCaptureTransmitBoundsFromMonitorToCustomBounds.Name" xml:space="preserve">
<value>btnCaptureTransmitBoundsFromMonitorToCustomBounds</value>
</data>
@ -1907,7 +1907,7 @@
</data>
<data name="lblCaptureCustomRegionY.Text" xml:space="preserve">
<value>Y</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;lblCaptureCustomRegionY.Name" xml:space="preserve">
<value>lblCaptureCustomRegionY</value>
</data>
@ -1937,7 +1937,7 @@
</data>
<data name="lblCaptureCustomRegionX.Text" xml:space="preserve">
<value>X</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;lblCaptureCustomRegionX.Name" xml:space="preserve">
<value>lblCaptureCustomRegionX</value>
</data>
@ -2994,6 +2994,57 @@
<data name="&gt;&gt;tpScreenRecorder.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="pgScrollingCapture.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="pgScrollingCapture.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value>
</data>
<data name="pgScrollingCapture.Size" type="System.Drawing.Size, System.Drawing">
<value>551, 322</value>
</data>
<data name="pgScrollingCapture.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;pgScrollingCapture.Name" xml:space="preserve">
<value>pgScrollingCapture</value>
</data>
<data name="&gt;&gt;pgScrollingCapture.Type" xml:space="preserve">
<value>System.Windows.Forms.PropertyGrid, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;pgScrollingCapture.Parent" xml:space="preserve">
<value>tpScrollingCapture</value>
</data>
<data name="&gt;&gt;pgScrollingCapture.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tpScrollingCapture.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>
</data>
<data name="tpScrollingCapture.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data>
<data name="tpScrollingCapture.Size" type="System.Drawing.Size, System.Drawing">
<value>557, 328</value>
</data>
<data name="tpScrollingCapture.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="tpScrollingCapture.Text" xml:space="preserve">
<value>Scrolling capture</value>
</data>
<data name="&gt;&gt;tpScrollingCapture.Name" xml:space="preserve">
<value>tpScrollingCapture</value>
</data>
<data name="&gt;&gt;tpScrollingCapture.Type" xml:space="preserve">
<value>System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tpScrollingCapture.Parent" xml:space="preserve">
<value>tcCapture</value>
</data>
<data name="&gt;&gt;tpScrollingCapture.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="pgRectangleAnnotate.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
@ -3043,7 +3094,7 @@
<value>tcCapture</value>
</data>
<data name="&gt;&gt;tpRectangleAnnotate.ZOrder" xml:space="preserve">
<value>3</value>
<value>4</value>
</data>
<data name="tcCapture.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>

View file

@ -453,7 +453,6 @@ 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();

View file

@ -417,9 +417,6 @@ 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<string> ImageExtensions { get; set; }