Remember layout

This commit is contained in:
niksedk 2023-09-16 17:18:21 +02:00
parent df3cf63b88
commit c4df5b4b27
4 changed files with 20 additions and 2 deletions

View File

@ -1486,8 +1486,7 @@ To use an API key, go to "Options -> Settings -> Tools" to enter your Goog
<BeautifyTimeCodes>Beautify time codes</BeautifyTimeCodes>
<Settings>Settings</Settings>
<Help>Help</Help>
<ShowHideWaveform>Show/hide waveform</ShowHideWaveform>
<ShowHideVideo>Show/hide video</ShowHideVideo>
<Layout>Layout</Layout>
<AssaDraw>Advanced Sub Station Alpha draw</AssaDraw>
</ToolBar>
<ContextMenu>

View File

@ -1302,6 +1302,7 @@ $HorzAlign = Center
public bool ShowToolbarSettings { get; set; }
public bool ShowToolbarHelp { get; set; }
public int LayoutNumber { get; set; }
public bool ShowVideoPlayer { get; set; }
public bool ShowAudioVisualizer { get; set; }
public bool ShowWaveform { get; set; }
@ -3531,6 +3532,12 @@ $HorzAlign = Center
settings.General.TextAndOrigianlTextBoxesSwitched = Convert.ToBoolean(subNode.InnerText, CultureInfo.InvariantCulture);
}
subNode = node.SelectSingleNode("LayoutNumber");
if (subNode != null)
{
settings.General.LayoutNumber = Convert.ToInt32(subNode.InnerText, CultureInfo.InvariantCulture);
}
subNode = node.SelectSingleNode("ShowVideoPlayer");
if (subNode != null)
{
@ -11015,6 +11022,7 @@ $HorzAlign = Center
textWriter.WriteElementString("ShowFrameRate", settings.General.ShowFrameRate.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("ShowVideoControls", settings.General.ShowVideoControls.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("TextAndOrigianlTextBoxesSwitched", settings.General.TextAndOrigianlTextBoxesSwitched.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("LayoutNumber", settings.General.LayoutNumber.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("ShowVideoPlayer", settings.General.ShowVideoPlayer.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("ShowAudioVisualizer", settings.General.ShowAudioVisualizer.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("ShowWaveform", settings.General.ShowWaveform.ToString(CultureInfo.InvariantCulture));

View File

@ -13375,6 +13375,7 @@ namespace Nikse.SubtitleEdit.Forms
Configuration.Settings.General.SyncListViewWithVideoWhilePlaying = checkBoxSyncListViewWithVideoWhilePlaying.Checked;
Configuration.Settings.General.ShowWaveform = audioVisualizer.ShowWaveform;
Configuration.Settings.General.ShowSpectrogram = audioVisualizer.ShowSpectrogram;
Configuration.Settings.General.LayoutNumber = _layout;
if (Configuration.Settings.General.ShowRecentFiles)
{
if (!string.IsNullOrEmpty(_fileName))
@ -25272,6 +25273,13 @@ namespace Nikse.SubtitleEdit.Forms
SetShortcuts();
MainResize();
_loading = false;
_layout = Configuration.Settings.General.LayoutNumber;
if (_layout != 0)
{
LayoutManager.SetLayout(_layout, Controls, panelVideoPlayer, SubtitleListview1, groupBoxVideo, groupBoxEdit);
}
OpenVideo(_videoFileName, VideoAudioTrackNumber);
ShowSubtitleTimer.Stop();
lock (_syncUndo)

View File

@ -4795,6 +4795,9 @@ namespace Nikse.SubtitleEdit.Logic
case "Main/Menu/ToolBar/Help":
language.Main.Menu.ToolBar.Help = reader.Value;
break;
case "Main/Menu/ToolBar/Layout":
language.Main.Menu.ToolBar.Layout = reader.Value;
break;
case "Main/Menu/ToolBar/AssaDraw":
language.Main.Menu.ToolBar.AssaDraw = reader.Value;
break;