mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-01 04:30:49 +12:00
Make sure preset name is not empty
This commit is contained in:
parent
b8579bc0a8
commit
41cf8ff133
|
@ -81,6 +81,7 @@ private void InitializeComponent()
|
|||
this.Controls.Add(this.txtAssetsFolder);
|
||||
this.Controls.Add(this.lblAssetsFolder);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "ImageEffectPackagerForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "ShareX - Image effect packager";
|
||||
|
|
|
@ -637,14 +637,22 @@ private void btnPackager_Click(object sender, EventArgs e)
|
|||
|
||||
if (preset != null)
|
||||
{
|
||||
string json = eiImageEffects.Serialize(preset);
|
||||
|
||||
if (!string.IsNullOrEmpty(json))
|
||||
if (string.IsNullOrEmpty(preset.Name))
|
||||
{
|
||||
using (ImageEffectPackagerForm packagerForm = new ImageEffectPackagerForm(json, preset.Name,
|
||||
HelpersOptions.ShareXSpecialFolders["ShareXImageEffects"]))
|
||||
// TODO: Translate
|
||||
MessageBox.Show("Preset name cannot be empty.", "ShareX - " + "Missing preset name", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
else
|
||||
{
|
||||
string json = eiImageEffects.Serialize(preset);
|
||||
|
||||
if (!string.IsNullOrEmpty(json))
|
||||
{
|
||||
packagerForm.ShowDialog();
|
||||
using (ImageEffectPackagerForm packagerForm = new ImageEffectPackagerForm(json, preset.Name,
|
||||
HelpersOptions.ShareXSpecialFolders["ShareXImageEffects"]))
|
||||
{
|
||||
packagerForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue