fixed #3946: Also update current task after capture tasks

This commit is contained in:
Jaex 2019-02-11 18:43:47 +03:00
parent 45d3d4d990
commit 8d684fd286
2 changed files with 9 additions and 7 deletions

View file

@ -164,9 +164,6 @@ public ApplicationConfig()
[Category("Application"), DefaultValue(true), Description("Show Discord button in main window when task list is empty.")]
public bool ShowDiscordButton { get; set; }
[Category("Application"), DefaultValue(100), Description("Large file size defined in MB. ShareX will warn before uploading large files. 0 disables this feature.")]
public int LargeFileSizeWarning { get; set; }
[Category("Application"), DefaultValue(""), Description("URLs will open using this path instead of default browser. Example path: chrome.exe")]
[Editor(typeof(ExeFileNameEditor), typeof(UITypeEditor))]
public string BrowserPath { get; set; }
@ -231,6 +228,9 @@ public int HotkeyRepeatLimit
[Category("Upload"), DefaultValue(true), Description("Show more than 10 files upload warning.")]
public bool ShowMultiUploadWarning { get; set; }
[Category("Upload"), DefaultValue(100), Description("Large file size defined in MB. ShareX will warn before uploading large files. 0 disables this feature.")]
public int ShowLargeFileSizeWarning { get; set; }
[Category("Paths"), Description("Custom uploaders configuration path. If you have already configured this setting in another device and you are attempting to use the same location, then backup the file before configuring this setting and restore after exiting ShareX.")]
[Editor(typeof(DirectoryNameEditor), typeof(UITypeEditor))]
public string CustomUploadersConfigPath { get; set; }

View file

@ -343,20 +343,22 @@ private void DoUploadJob()
{
Program.Settings.ShowUploadWarning = false;
Program.DefaultTaskSettings.AfterCaptureJob = Program.DefaultTaskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.UploadImageToHost);
Info.TaskSettings.AfterCaptureJob = Info.TaskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.UploadImageToHost);
Info.Result.IsURLExpected = false;
RequestSettingUpdate = true;
Stop();
return;
}
if (Program.Settings.LargeFileSizeWarning > 0)
if (Program.Settings.ShowLargeFileSizeWarning > 0)
{
long dataSize = Program.Settings.BinaryUnits ? Program.Settings.LargeFileSizeWarning * 1024 * 1024 : Program.Settings.LargeFileSizeWarning * 1000 * 1000;
long dataSize = Program.Settings.BinaryUnits ? Program.Settings.ShowLargeFileSizeWarning * 1024 * 1024 : Program.Settings.ShowLargeFileSizeWarning * 1000 * 1000;
if (Data != null && Data.Length > dataSize)
{
using (MyMessageBox msgbox = new MyMessageBox(Resources.UploadTask_DoUploadJob_You_are_attempting_to_upload_a_large_file, "ShareX",
MessageBoxButtons.YesNo, Resources.UploadManager_IsUploadConfirmed_Don_t_show_this_message_again_))
{
msgbox.ShowDialog();
if (msgbox.IsChecked) Program.Settings.LargeFileSizeWarning = 0;
if (msgbox.IsChecked) Program.Settings.ShowLargeFileSizeWarning = 0;
if (msgbox.DialogResult == DialogResult.No) Stop();
}
}