Added confirmation for package overwrite

This commit is contained in:
Jaex 2020-07-04 09:45:52 +03:00
parent 5fdf602200
commit a98333c1ab
2 changed files with 6 additions and 5 deletions

View file

@ -67,7 +67,7 @@ public Font TextFont
}
}
[DefaultValue(typeof(Color), "White"), Editor(typeof(MyColorEditor), typeof(UITypeEditor)), TypeConverter(typeof(MyColorConverter))]
[DefaultValue(typeof(Color), "235, 235, 235"), Editor(typeof(MyColorEditor), typeof(UITypeEditor)), TypeConverter(typeof(MyColorConverter))]
public Color TextColor { get; set; }
[DefaultValue(true)]
@ -109,7 +109,7 @@ public int CornerRadius
[DefaultValue(true)]
public bool DrawBackground { get; set; }
[DefaultValue(typeof(Color), "10, 110, 230"), Editor(typeof(MyColorEditor), typeof(UITypeEditor)), TypeConverter(typeof(MyColorConverter))]
[DefaultValue(typeof(Color), "42, 47, 56"), Editor(typeof(MyColorEditor), typeof(UITypeEditor)), TypeConverter(typeof(MyColorConverter))]
public Color BackgroundColor { get; set; }
[DefaultValue(true)]
@ -118,7 +118,7 @@ public int CornerRadius
[DefaultValue(LinearGradientMode.Vertical)]
public LinearGradientMode GradientType { get; set; }
[DefaultValue(typeof(Color), "0, 30, 80"), Editor(typeof(MyColorEditor), typeof(UITypeEditor)), TypeConverter(typeof(MyColorConverter))]
[DefaultValue(typeof(Color), "28, 32, 38"), Editor(typeof(MyColorEditor), typeof(UITypeEditor)), TypeConverter(typeof(MyColorConverter))]
public Color BackgroundColor2 { get; set; }
[DefaultValue(false)]

View file

@ -93,8 +93,9 @@ private void btnPackage_Click(object sender, EventArgs e)
// TODO: Translate
MessageBox.Show("Assets folder must be inside ShareX image effects folder.", "ShareX - " + "Invalid assets folder path",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
} // TODO: Translate
else if (!File.Exists(PackageFilePath) || MessageBox.Show("Package with this file name already exists.\r\nWould you like to overwrite it?", "ShareX",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
string outputFilePath = ImageEffectPackager.Package(PackageFilePath, ImageEffectJson, AssetsFolderPath);