mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Don't allow saving empty subtitle
This commit is contained in:
parent
22c96def55
commit
19b2a9d378
@ -1537,11 +1537,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_subtitle == null || _subtitle.Paragraphs.Count == 0)
|
||||
return false;
|
||||
if (_subtitle.Paragraphs.Count == 1 && string.IsNullOrEmpty(_subtitle.Paragraphs[0].Text))
|
||||
return false;
|
||||
return true;
|
||||
return _subtitle != null && (_subtitle.Paragraphs.Count > 1 || (_subtitle.Paragraphs.Count == 1 && !string.IsNullOrWhiteSpace(_subtitle.Paragraphs[0].Text)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3110,12 +3106,22 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void SaveToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsSubtitleLoaded)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ReloadFromSourceView();
|
||||
SaveSubtitle(GetCurrentSubtitleFormat());
|
||||
}
|
||||
|
||||
private void SaveAsToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsSubtitleLoaded)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ReloadFromSourceView();
|
||||
FileSaveAs(true);
|
||||
}
|
||||
@ -3903,6 +3909,11 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void ToolStripButtonSaveClick(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsSubtitleLoaded)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ReloadFromSourceView();
|
||||
bool oldChange = _changeSubtitleToString != _subtitle.GetFastHashCode();
|
||||
SaveSubtitle(GetCurrentSubtitleFormat());
|
||||
|
Loading…
Reference in New Issue
Block a user