mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 06:52:35 +01:00
Minor UI adjustments for generate video
This commit is contained in:
parent
bfdf7dc065
commit
17afb5c964
@ -74,20 +74,19 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
|
|
||||||
private void buttonOK_Click(object sender, EventArgs e)
|
private void buttonOK_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
buttonOK.Enabled = false;
|
EnableDisableControls(false);
|
||||||
var fileName = radioButtonColor.Checked ? "blank_video_solid" : "blank_video_checkered";
|
var fileName = radioButtonColor.Checked ? "blank_video_solid" : "blank_video_checkered";
|
||||||
using (var saveDialog = new SaveFileDialog { FileName = fileName, Filter = "MP4|*.mp4|Matroska|*.mkv|WebM|*.webm" })
|
using (var saveDialog = new SaveFileDialog { FileName = fileName, Filter = "MP4|*.mp4|Matroska|*.mkv|WebM|*.webm" })
|
||||||
{
|
{
|
||||||
if (saveDialog.ShowDialog(this) != DialogResult.OK)
|
if (saveDialog.ShowDialog(this) != DialogResult.OK)
|
||||||
{
|
{
|
||||||
buttonOK.Enabled = true;
|
EnableDisableControls(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoFileName = saveDialog.FileName;
|
VideoFileName = saveDialog.FileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
buttonOK.Enabled = true;
|
|
||||||
if (File.Exists(VideoFileName))
|
if (File.Exists(VideoFileName))
|
||||||
{
|
{
|
||||||
File.Delete(VideoFileName);
|
File.Delete(VideoFileName);
|
||||||
@ -122,6 +121,16 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
DialogResult = _abort ? DialogResult.Cancel : DialogResult.OK;
|
DialogResult = _abort ? DialogResult.Cancel : DialogResult.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void EnableDisableControls(bool enable)
|
||||||
|
{
|
||||||
|
buttonOK.Enabled = enable;
|
||||||
|
numericUpDownDurationMinutes.Enabled = enable;
|
||||||
|
numericUpDownWidth.Enabled = enable;
|
||||||
|
numericUpDownHeight.Enabled = enable;
|
||||||
|
comboBoxFrameRate.Enabled = enable;
|
||||||
|
groupBoxBackground.Enabled = enable;
|
||||||
|
}
|
||||||
|
|
||||||
private void buttonColor_Click(object sender, EventArgs e)
|
private void buttonColor_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
using (var colorChooser = new ColorChooser { Color = panelColor.BackColor, ShowAlpha = false })
|
using (var colorChooser = new ColorChooser { Color = panelColor.BackColor, ShowAlpha = false })
|
||||||
|
@ -54,18 +54,19 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
private void buttonOK_Click(object sender, EventArgs e)
|
private void buttonOK_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
buttonOK.Enabled = false;
|
buttonOK.Enabled = false;
|
||||||
|
numericUpDownFontSize.Enabled = false;
|
||||||
using (var saveDialog = new SaveFileDialog { FileName = string.Empty, Filter = "MP4|*.mp4|Matroska|*.mkv|WebM|*.webm" })
|
using (var saveDialog = new SaveFileDialog { FileName = string.Empty, Filter = "MP4|*.mp4|Matroska|*.mkv|WebM|*.webm" })
|
||||||
{
|
{
|
||||||
if (saveDialog.ShowDialog(this) != DialogResult.OK)
|
if (saveDialog.ShowDialog(this) != DialogResult.OK)
|
||||||
{
|
{
|
||||||
buttonOK.Enabled = true;
|
buttonOK.Enabled = true;
|
||||||
|
numericUpDownFontSize.Enabled = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoFileName = saveDialog.FileName;
|
VideoFileName = saveDialog.FileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
buttonOK.Enabled = true;
|
|
||||||
if (File.Exists(VideoFileName))
|
if (File.Exists(VideoFileName))
|
||||||
{
|
{
|
||||||
File.Delete(VideoFileName);
|
File.Delete(VideoFileName);
|
||||||
|
@ -31541,7 +31541,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
|
|
||||||
var sub = new Subtitle(_subtitle, false);
|
var sub = new Subtitle(_subtitle, false);
|
||||||
int? fontSize = null;
|
int? fontSize = null;
|
||||||
if (string.IsNullOrEmpty(sub.Header))
|
if (string.IsNullOrEmpty(sub.Header) || !IsAssa())
|
||||||
{
|
{
|
||||||
sub.Header = AdvancedSubStationAlpha.DefaultHeader;
|
sub.Header = AdvancedSubStationAlpha.DefaultHeader;
|
||||||
var style = AdvancedSubStationAlpha.GetSsaStyle("Default", sub.Header);
|
var style = AdvancedSubStationAlpha.GetSsaStyle("Default", sub.Header);
|
||||||
|
Loading…
Reference in New Issue
Block a user