From e9d28eb0799066dea33ea747d725bddd82442274 Mon Sep 17 00:00:00 2001 From: niksedk Date: Wed, 17 Nov 2021 10:57:50 +0100 Subject: [PATCH] Allow permanently dismiss of ASSA change res - thx Ricky :) --- .../Assa/ResolutionResampler.Designer.cs | 21 ++++++++++++++++--- src/ui/Forms/Assa/ResolutionResampler.cs | 11 +++++++++- src/ui/Forms/Main.cs | 10 ++++++--- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/ui/Forms/Assa/ResolutionResampler.Designer.cs b/src/ui/Forms/Assa/ResolutionResampler.Designer.cs index a620adc0c..7d188566c 100644 --- a/src/ui/Forms/Assa/ResolutionResampler.Designer.cs +++ b/src/ui/Forms/Assa/ResolutionResampler.Designer.cs @@ -45,6 +45,7 @@ namespace Nikse.SubtitleEdit.Forms.Assa this.checkBoxFontSize = new System.Windows.Forms.CheckBox(); this.checkBoxPosition = new System.Windows.Forms.CheckBox(); this.checkBoxDrawing = new System.Windows.Forms.CheckBox(); + this.buttonNever = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTargetHeight)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTargetWidth)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownSourceHeight)).BeginInit(); @@ -180,7 +181,7 @@ namespace Nikse.SubtitleEdit.Forms.Assa this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonCancel.Location = new System.Drawing.Point(371, 189); + this.buttonCancel.Location = new System.Drawing.Point(381, 205); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.TabIndex = 1; @@ -192,7 +193,7 @@ namespace Nikse.SubtitleEdit.Forms.Assa // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonOK.Location = new System.Drawing.Point(290, 189); + this.buttonOK.Location = new System.Drawing.Point(300, 205); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(75, 23); this.buttonOK.TabIndex = 0; @@ -246,11 +247,24 @@ namespace Nikse.SubtitleEdit.Forms.Assa this.checkBoxDrawing.Text = "Change resolution for drawing"; this.checkBoxDrawing.UseVisualStyleBackColor = true; // + // buttonNever + // + this.buttonNever.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonNever.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonNever.Location = new System.Drawing.Point(166, 205); + this.buttonNever.Name = "buttonNever"; + this.buttonNever.Size = new System.Drawing.Size(128, 23); + this.buttonNever.TabIndex = 16; + this.buttonNever.Text = "No, never"; + this.buttonNever.UseVisualStyleBackColor = true; + this.buttonNever.Click += new System.EventHandler(this.buttonNever_Click); + // // ResolutionResampler // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(458, 224); + this.ClientSize = new System.Drawing.Size(468, 240); + this.Controls.Add(this.buttonNever); this.Controls.Add(this.checkBoxDrawing); this.Controls.Add(this.checkBoxPosition); this.Controls.Add(this.checkBoxFontSize); @@ -304,5 +318,6 @@ namespace Nikse.SubtitleEdit.Forms.Assa private System.Windows.Forms.CheckBox checkBoxFontSize; private System.Windows.Forms.CheckBox checkBoxPosition; private System.Windows.Forms.CheckBox checkBoxDrawing; + private System.Windows.Forms.Button buttonNever; } } \ No newline at end of file diff --git a/src/ui/Forms/Assa/ResolutionResampler.cs b/src/ui/Forms/Assa/ResolutionResampler.cs index 56be187c4..fd92c38f5 100644 --- a/src/ui/Forms/Assa/ResolutionResampler.cs +++ b/src/ui/Forms/Assa/ResolutionResampler.cs @@ -13,7 +13,7 @@ namespace Nikse.SubtitleEdit.Forms.Assa private readonly string _videoFileName; private readonly Subtitle _subtitle; - public ResolutionResampler(Subtitle subtitle, string videoFileName, VideoInfo videoInfo) + public ResolutionResampler(Subtitle subtitle, string videoFileName, VideoInfo videoInfo, bool showNeverButton) { UiUtil.PreInitialize(this); InitializeComponent(); @@ -57,6 +57,9 @@ namespace Nikse.SubtitleEdit.Forms.Assa numericUpDownTargetWidth.Value = videoInfo1.Width; numericUpDownTargetHeight.Value = videoInfo1.Height; } + + buttonNever.Text = LanguageSettings.Current.TimedTextSmpteTiming.NoNever; + buttonNever.Visible = showNeverButton; } private void buttonSourceRes_Click(object sender, EventArgs e) @@ -206,5 +209,11 @@ namespace Nikse.SubtitleEdit.Forms.Assa DialogResult = DialogResult.Cancel; } } + + private void buttonNever_Click(object sender, EventArgs e) + { + Configuration.Settings.SubtitleSettings.AssaResolutionAutoNew = false; + DialogResult = DialogResult.Cancel; + } } } diff --git a/src/ui/Forms/Main.cs b/src/ui/Forms/Main.cs index 7a4f20da2..35ff7a962 100644 --- a/src/ui/Forms/Main.cs +++ b/src/ui/Forms/Main.cs @@ -20582,7 +20582,6 @@ namespace Nikse.SubtitleEdit.Forms _subtitle.Header = AdvancedSubStationAlpha.GetHeaderAndStylesFromAdvancedSubStationAlpha(_subtitle.Header, styles); } - else if (Configuration.Settings.SubtitleSettings.AssaResolutionPromptChange) { if (_subtitle.Paragraphs.Count == 0 && int.TryParse(oldPlayResX, out var sourceWidth) && int.TryParse(oldPlayResX, out var sourceHeight)) @@ -20599,7 +20598,7 @@ namespace Nikse.SubtitleEdit.Forms } else { - videoResolutionResamplerToolStripMenuItem_Click(null, null); + ShowAssaResolutionChanger(true); } } } @@ -32259,7 +32258,12 @@ namespace Nikse.SubtitleEdit.Forms private void videoResolutionResamplerToolStripMenuItem_Click(object sender, EventArgs e) { - using (var form = new ResolutionResampler(_subtitle, VideoFileName, _videoInfo)) + ShowAssaResolutionChanger(false); + } + + private void ShowAssaResolutionChanger(bool showNeverButton) + { + using (var form = new ResolutionResampler(_subtitle, VideoFileName, _videoInfo, showNeverButton)) { var result = form.ShowDialog(this); if (result != DialogResult.OK)