mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-05 20:54:31 +13:00
LargeFileSizeWarning uses MB or MiB
This commit is contained in:
parent
557d375309
commit
9ecbf3c30f
2 changed files with 14 additions and 11 deletions
|
@ -40,7 +40,6 @@ public class ApplicationConfig : SettingsBase<ApplicationConfig>
|
|||
public string FileUploadDefaultDirectory = "";
|
||||
public bool ShowUploadWarning = true; // First time upload warning
|
||||
public bool ShowMultiUploadWarning = true; // More than 10 files upload warning
|
||||
public bool ShowLargeFileUploadWarning = true;
|
||||
public bool ShowTrayLeftClickTip = true; // Tray icon left click tip
|
||||
public int NameParserAutoIncrementNumber = 0;
|
||||
public RecentItem[] RecentLinks = null;
|
||||
|
@ -152,8 +151,8 @@ public ApplicationConfig()
|
|||
[Category("Application"), DefaultValue(10), Description("In recent links tray menu max how many links to show.")]
|
||||
public int RecentLinksMaxCount { get; set; }
|
||||
|
||||
[Category("Application"), DefaultValue(104857600), Description("Large file size defined in bytes. ShareX will warn before uploading large files. 0 disables this feature.")]
|
||||
public long LargeFileSize { get; set; }
|
||||
[Category("Application"), DefaultValue(100), Description("Large file size defined in MiB or 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))]
|
||||
|
|
|
@ -311,7 +311,10 @@ private void DoUploadJob()
|
|||
Stop();
|
||||
}
|
||||
|
||||
if (Program.Settings.LargeFileSize != 0 && Data.Length > Program.Settings.LargeFileSize)
|
||||
if (Program.Settings.LargeFileSizeWarning != 0)
|
||||
{
|
||||
long dataSize = Program.Settings.BinaryUnits ? Program.Settings.LargeFileSizeWarning * 1024 * 1024 : Program.Settings.LargeFileSizeWarning * 1000 * 1000;
|
||||
if (Data != null && Data.Length > dataSize)
|
||||
{
|
||||
using (MyMessageBox msgbox = new MyMessageBox(
|
||||
"You are attempting to upload a large file.\n\nAre you sure you want to continue?",
|
||||
|
@ -319,10 +322,11 @@ private void DoUploadJob()
|
|||
MessageBoxButtons.YesNo, Resources.UploadManager_IsUploadConfirmed_Don_t_show_this_message_again_))
|
||||
{
|
||||
msgbox.ShowDialog();
|
||||
Program.Settings.ShowLargeFileUploadWarning = !msgbox.IsChecked;
|
||||
if (msgbox.IsChecked) Program.Settings.LargeFileSizeWarning = 0;
|
||||
if (msgbox.DialogResult == DialogResult.No) Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!StopRequested)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue