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
|
get
|
||||||
{
|
{
|
||||||
if (_subtitle == null || _subtitle.Paragraphs.Count == 0)
|
return _subtitle != null && (_subtitle.Paragraphs.Count > 1 || (_subtitle.Paragraphs.Count == 1 && !string.IsNullOrWhiteSpace(_subtitle.Paragraphs[0].Text)));
|
||||||
return false;
|
|
||||||
if (_subtitle.Paragraphs.Count == 1 && string.IsNullOrEmpty(_subtitle.Paragraphs[0].Text))
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3110,12 +3106,22 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
|
|
||||||
private void SaveToolStripMenuItemClick(object sender, EventArgs e)
|
private void SaveToolStripMenuItemClick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (!IsSubtitleLoaded)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ReloadFromSourceView();
|
ReloadFromSourceView();
|
||||||
SaveSubtitle(GetCurrentSubtitleFormat());
|
SaveSubtitle(GetCurrentSubtitleFormat());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveAsToolStripMenuItemClick(object sender, EventArgs e)
|
private void SaveAsToolStripMenuItemClick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (!IsSubtitleLoaded)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ReloadFromSourceView();
|
ReloadFromSourceView();
|
||||||
FileSaveAs(true);
|
FileSaveAs(true);
|
||||||
}
|
}
|
||||||
@ -3903,6 +3909,11 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
|
|
||||||
private void ToolStripButtonSaveClick(object sender, EventArgs e)
|
private void ToolStripButtonSaveClick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (!IsSubtitleLoaded)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ReloadFromSourceView();
|
ReloadFromSourceView();
|
||||||
bool oldChange = _changeSubtitleToString != _subtitle.GetFastHashCode();
|
bool oldChange = _changeSubtitleToString != _subtitle.GetFastHashCode();
|
||||||
SaveSubtitle(GetCurrentSubtitleFormat());
|
SaveSubtitle(GetCurrentSubtitleFormat());
|
||||||
|
Loading…
Reference in New Issue
Block a user