From c0b595366c0b922c7abac563db07326353e31993 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Mon, 17 Feb 2020 22:15:57 +0100 Subject: [PATCH 1/5] Fix for default enc when upgrading - thx Jamakmake :) --- libse/Settings.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libse/Settings.cs b/libse/Settings.cs index 60123bfea..d1981bfb7 100644 --- a/libse/Settings.cs +++ b/libse/Settings.cs @@ -1768,9 +1768,9 @@ $HorzAlign = Center //too slow... :( - settings = Deserialize(settingsFileName); // 688 msecs settings = CustomDeserialize(settingsFileName); // 15 msecs - if (settings.General.AutoConvertToUtf8 && !settings.General.DefaultEncoding.StartsWith("UTF-8", StringComparison.Ordinal)) + if (settings.General.DefaultEncoding.StartsWith("utf-8", StringComparison.Ordinal)) { - settings.General.DefaultEncoding = "UTF-8 with BOM"; + settings.General.DefaultEncoding = TextEncoding.Utf8WithBom; } } catch (Exception exception) From 2e02d2eb4d5daa74c65e4162ceeb94c568498842 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Mon, 17 Feb 2020 22:31:56 +0100 Subject: [PATCH 2/5] More fixes for "open original" - thx OmrSi :) Fix #3991 --- libse/Settings.cs | 4 ++++ src/Forms/Main.cs | 8 ++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libse/Settings.cs b/libse/Settings.cs index d1981bfb7..e1af529e6 100644 --- a/libse/Settings.cs +++ b/libse/Settings.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Drawing; using System.Globalization; using System.IO; +using System.Linq; using System.Text; using System.Xml; using System.Xml.Serialization; @@ -39,10 +40,13 @@ namespace Nikse.SubtitleEdit.Core if (string.IsNullOrEmpty(fileName) && !string.IsNullOrEmpty(originalFileName)) { fileName = originalFileName; + originalFileName = null; } if (string.IsNullOrEmpty(fileName)) { + Files = Files.Where(p => !string.IsNullOrEmpty(p.FileName)).ToList(); + Files.Insert(0, new RecentFileEntry()); return; } diff --git a/src/Forms/Main.cs b/src/Forms/Main.cs index 1126cd27f..d463e00aa 100644 --- a/src/Forms/Main.cs +++ b/src/Forms/Main.cs @@ -2152,11 +2152,7 @@ namespace Nikse.SubtitleEdit.Forms var ext = file.Extension.ToLowerInvariant(); // save last first visible index + first selected index from listview - if (!string.IsNullOrEmpty(_fileName)) - { - Configuration.Settings.RecentFiles.Add(_fileName, FirstVisibleIndex, FirstSelectedIndex, _videoFileName, originalFileName, Configuration.Settings.General.CurrentVideoOffsetInMs); - } - + Configuration.Settings.RecentFiles.Add(_fileName, FirstVisibleIndex, FirstSelectedIndex, _videoFileName, originalFileName, Configuration.Settings.General.CurrentVideoOffsetInMs); Configuration.Settings.General.CurrentVideoOffsetInMs = 0; openFileDialog1.InitialDirectory = file.DirectoryName; @@ -4097,7 +4093,7 @@ namespace Nikse.SubtitleEdit.Forms { if (ContinueNewOrExit()) { - if (Configuration.Settings.General.ShowRecentFiles && !string.IsNullOrEmpty(_fileName)) + if (Configuration.Settings.General.ShowRecentFiles) { Configuration.Settings.RecentFiles.Add(_fileName, FirstVisibleIndex, FirstSelectedIndex, _videoFileName, _subtitleAlternateFileName, Configuration.Settings.General.CurrentVideoOffsetInMs); } From c4eb9f80887a889db0cfd8a4c2c74caaa57c67ce Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Mon, 17 Feb 2020 22:42:53 +0100 Subject: [PATCH 3/5] More #3991 --- libse/Settings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libse/Settings.cs b/libse/Settings.cs index e1af529e6..fc7b08dc7 100644 --- a/libse/Settings.cs +++ b/libse/Settings.cs @@ -46,7 +46,7 @@ namespace Nikse.SubtitleEdit.Core if (string.IsNullOrEmpty(fileName)) { Files = Files.Where(p => !string.IsNullOrEmpty(p.FileName)).ToList(); - Files.Insert(0, new RecentFileEntry()); + Files.Insert(0, new RecentFileEntry { FileName = string.Empty }); return; } From ad8da730acfe0f93356ed1b2aa43771786b49cf4 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Mon, 17 Feb 2020 23:09:35 +0100 Subject: [PATCH 4/5] Add "Collapse" context menu for "shortcuts treeview" --- LanguageMaster.xml | 1 + libse/Language.cs | 3 ++- libse/LanguageDeserializer.cs | 3 +++ libse/LanguageStructure.cs | 1 + src/Forms/Settings.Designer.cs | 22 ++++++++++++++++++++++ src/Forms/Settings.cs | 7 ++++++- src/Forms/Settings.resx | 3 +++ 7 files changed, 38 insertions(+), 2 deletions(-) diff --git a/LanguageMaster.xml b/LanguageMaster.xml index 031bf6d1a..2f2205fa2 100644 --- a/LanguageMaster.xml +++ b/LanguageMaster.xml @@ -81,6 +81,7 @@ Delete current line Width Height + Collapse About Subtitle Edit diff --git a/libse/Language.cs b/libse/Language.cs index cfaed72b7..81d28444a 100644 --- a/libse/Language.cs +++ b/libse/Language.cs @@ -198,7 +198,8 @@ namespace Nikse.SubtitleEdit.Core Search = "Search", DeleteCurrentLine = "Delete current line", Width = "Width", - Height = "Height" + Height = "Height", + Collapse = "Collapse" }; About = new LanguageStructure.About diff --git a/libse/LanguageDeserializer.cs b/libse/LanguageDeserializer.cs index b5039b52a..74dcd0e8d 100644 --- a/libse/LanguageDeserializer.cs +++ b/libse/LanguageDeserializer.cs @@ -298,6 +298,9 @@ namespace Nikse.SubtitleEdit.Core case "General/Height": language.General.Height = reader.Value; break; + case "General/Collapse": + language.General.Collapse = reader.Value; + break; case "About/Title": language.About.Title = reader.Value; break; diff --git a/libse/LanguageStructure.cs b/libse/LanguageStructure.cs index 4cb01cbb5..5e8516c54 100644 --- a/libse/LanguageStructure.cs +++ b/libse/LanguageStructure.cs @@ -85,6 +85,7 @@ public string DeleteCurrentLine { get; set; } public string Width { get; set; } public string Height { get; set; } + public string Collapse { get; set; } } public class About diff --git a/src/Forms/Settings.Designer.cs b/src/Forms/Settings.Designer.cs index bdea7c237..be958da7e 100644 --- a/src/Forms/Settings.Designer.cs +++ b/src/Forms/Settings.Designer.cs @@ -28,6 +28,7 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.buttonOK = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); this.tabControlSettings = new System.Windows.Forms.TabControl(); @@ -367,6 +368,8 @@ this.labelStatus = new System.Windows.Forms.Label(); this.openFileDialogFFmpeg = new System.Windows.Forms.OpenFileDialog(); this.buttonReset = new System.Windows.Forms.Button(); + this.contextMenuStripShortcuts = new System.Windows.Forms.ContextMenuStrip(this.components); + this.toolStripMenuItemShortcutsCollapse = new System.Windows.Forms.ToolStripMenuItem(); this.tabControlSettings.SuspendLayout(); this.tabPageGeneral.SuspendLayout(); this.groupBoxMiscellaneous.SuspendLayout(); @@ -445,6 +448,7 @@ this.groupBoxNetworkSession.SuspendLayout(); this.groupBoxProxySettings.SuspendLayout(); this.groupBoxProxyAuthentication.SuspendLayout(); + this.contextMenuStripShortcuts.SuspendLayout(); this.SuspendLayout(); // // buttonOK @@ -1497,6 +1501,7 @@ this.treeViewShortcuts.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.treeViewShortcuts.ContextMenuStrip = this.contextMenuStripShortcuts; this.treeViewShortcuts.HideSelection = false; this.treeViewShortcuts.Location = new System.Drawing.Point(16, 47); this.treeViewShortcuts.Name = "treeViewShortcuts"; @@ -4454,6 +4459,20 @@ this.buttonReset.UseVisualStyleBackColor = true; this.buttonReset.Click += new System.EventHandler(this.buttonReset_Click); // + // contextMenuStripShortcuts + // + this.contextMenuStripShortcuts.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripMenuItemShortcutsCollapse}); + this.contextMenuStripShortcuts.Name = "contextMenuStripShortcuts"; + this.contextMenuStripShortcuts.Size = new System.Drawing.Size(120, 26); + // + // toolStripMenuItemShortcutsCollapse + // + this.toolStripMenuItemShortcutsCollapse.Name = "toolStripMenuItemShortcutsCollapse"; + this.toolStripMenuItemShortcutsCollapse.Size = new System.Drawing.Size(119, 22); + this.toolStripMenuItemShortcutsCollapse.Text = "Collapse"; + this.toolStripMenuItemShortcutsCollapse.Click += new System.EventHandler(this.toolStripMenuItemShortcutsCollapse_Click); + // // Settings // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -4586,6 +4605,7 @@ this.groupBoxProxySettings.PerformLayout(); this.groupBoxProxyAuthentication.ResumeLayout(false); this.groupBoxProxyAuthentication.PerformLayout(); + this.contextMenuStripShortcuts.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -4932,5 +4952,7 @@ private System.Windows.Forms.Label labelToolsBreakBottomHeavyPercent; private System.Windows.Forms.CheckBox checkBoxSyntaxColorGapTooSmall; private System.Windows.Forms.Button buttonReset; + private System.Windows.Forms.ContextMenuStrip contextMenuStripShortcuts; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemShortcutsCollapse; } } \ No newline at end of file diff --git a/src/Forms/Settings.cs b/src/Forms/Settings.cs index b9c078d65..fb682af10 100644 --- a/src/Forms/Settings.cs +++ b/src/Forms/Settings.cs @@ -891,7 +891,7 @@ namespace Nikse.SubtitleEdit.Forms MakeShortcutsTreeview(language); ShowShortcutsTreeview(); - + toolStripMenuItemShortcutsCollapse.Text = Configuration.Settings.Language.General.Collapse; labelShortcutsSearch.Text = Configuration.Settings.Language.General.Search; buttonShortcutsClear.Text = Configuration.Settings.Language.DvdSubRip.Clear; textBoxShortcutSearch.Left = labelShortcutsSearch.Left + labelShortcutsSearch.Width + 5; @@ -3151,5 +3151,10 @@ namespace Nikse.SubtitleEdit.Forms Init(); } } + + private void toolStripMenuItemShortcutsCollapse_Click(object sender, EventArgs e) + { + treeViewShortcuts.CollapseAll(); + } } } diff --git a/src/Forms/Settings.resx b/src/Forms/Settings.resx index acbb9591a..5250ab685 100644 --- a/src/Forms/Settings.resx +++ b/src/Forms/Settings.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 464, 17 + 17, 17 From 61b8826a15d3c0944b94692f5ac0b43488dbb69c Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Mon, 17 Feb 2020 23:28:33 +0100 Subject: [PATCH 5/5] Improve settings UI details regarding "profiles" - thx Jamakmake :) Resize a few windows + add "select all" + "invert selection" to export profiles window --- src/Forms/SettingsProfile.Designer.cs | 24 ++++++------- src/Forms/SettingsProfileExport.Designer.cs | 40 ++++++++++++++++++--- src/Forms/SettingsProfileExport.cs | 19 ++++++++++ src/Forms/SettingsProfileExport.resx | 3 ++ 4 files changed, 70 insertions(+), 16 deletions(-) diff --git a/src/Forms/SettingsProfile.Designer.cs b/src/Forms/SettingsProfile.Designer.cs index 154048040..c7d7ba863 100644 --- a/src/Forms/SettingsProfile.Designer.cs +++ b/src/Forms/SettingsProfile.Designer.cs @@ -95,7 +95,7 @@ this.groupBoxStyles.Controls.Add(this.listViewProfiles); this.groupBoxStyles.Location = new System.Drawing.Point(12, 12); this.groupBoxStyles.Name = "groupBoxStyles"; - this.groupBoxStyles.Size = new System.Drawing.Size(927, 384); + this.groupBoxStyles.Size = new System.Drawing.Size(927, 413); this.groupBoxStyles.TabIndex = 1; this.groupBoxStyles.TabStop = false; // @@ -143,7 +143,7 @@ this.groupBoxGeneralRules.Controls.Add(this.numericUpDownSubtitleLineMaximumLength); this.groupBoxGeneralRules.Location = new System.Drawing.Point(619, 61); this.groupBoxGeneralRules.Name = "groupBoxGeneralRules"; - this.groupBoxGeneralRules.Size = new System.Drawing.Size(302, 287); + this.groupBoxGeneralRules.Size = new System.Drawing.Size(302, 316); this.groupBoxGeneralRules.TabIndex = 90; this.groupBoxGeneralRules.TabStop = false; this.groupBoxGeneralRules.Text = "Rules"; @@ -435,7 +435,7 @@ // this.buttonExport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonExport.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonExport.Location = new System.Drawing.Point(6, 353); + this.buttonExport.Location = new System.Drawing.Point(6, 382); this.buttonExport.Name = "buttonExport"; this.buttonExport.Size = new System.Drawing.Size(82, 23); this.buttonExport.TabIndex = 20; @@ -447,7 +447,7 @@ // this.buttonImport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonImport.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonImport.Location = new System.Drawing.Point(94, 353); + this.buttonImport.Location = new System.Drawing.Point(94, 382); this.buttonImport.Name = "buttonImport"; this.buttonImport.Size = new System.Drawing.Size(82, 23); this.buttonImport.TabIndex = 30; @@ -459,7 +459,7 @@ // this.buttonCopy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonCopy.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonCopy.Location = new System.Drawing.Point(182, 353); + this.buttonCopy.Location = new System.Drawing.Point(182, 382); this.buttonCopy.Name = "buttonCopy"; this.buttonCopy.Size = new System.Drawing.Size(82, 23); this.buttonCopy.TabIndex = 40; @@ -471,7 +471,7 @@ // this.buttonRemoveAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonRemoveAll.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonRemoveAll.Location = new System.Drawing.Point(446, 353); + this.buttonRemoveAll.Location = new System.Drawing.Point(446, 382); this.buttonRemoveAll.Name = "buttonRemoveAll"; this.buttonRemoveAll.Size = new System.Drawing.Size(92, 23); this.buttonRemoveAll.TabIndex = 70; @@ -483,7 +483,7 @@ // this.buttonAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonAdd.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonAdd.Location = new System.Drawing.Point(270, 353); + this.buttonAdd.Location = new System.Drawing.Point(270, 382); this.buttonAdd.Name = "buttonAdd"; this.buttonAdd.Size = new System.Drawing.Size(82, 23); this.buttonAdd.TabIndex = 50; @@ -495,7 +495,7 @@ // this.buttonRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonRemove.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonRemove.Location = new System.Drawing.Point(358, 353); + this.buttonRemove.Location = new System.Drawing.Point(358, 382); this.buttonRemove.Name = "buttonRemove"; this.buttonRemove.Size = new System.Drawing.Size(82, 23); this.buttonRemove.TabIndex = 60; @@ -520,7 +520,7 @@ this.listViewProfiles.Location = new System.Drawing.Point(6, 19); this.listViewProfiles.MultiSelect = false; this.listViewProfiles.Name = "listViewProfiles"; - this.listViewProfiles.Size = new System.Drawing.Size(604, 329); + this.listViewProfiles.Size = new System.Drawing.Size(604, 358); this.listViewProfiles.TabIndex = 10; this.listViewProfiles.UseCompatibleStateImageBehavior = false; this.listViewProfiles.View = System.Windows.Forms.View.Details; @@ -556,7 +556,7 @@ 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(864, 407); + this.buttonCancel.Location = new System.Drawing.Point(864, 436); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.TabIndex = 205; @@ -567,7 +567,7 @@ // 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(783, 407); + this.buttonOK.Location = new System.Drawing.Point(783, 436); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(75, 23); this.buttonOK.TabIndex = 200; @@ -579,7 +579,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(951, 442); + this.ClientSize = new System.Drawing.Size(951, 471); this.Controls.Add(this.groupBoxStyles); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); diff --git a/src/Forms/SettingsProfileExport.Designer.cs b/src/Forms/SettingsProfileExport.Designer.cs index 273df2cea..ce8360fbd 100644 --- a/src/Forms/SettingsProfileExport.Designer.cs +++ b/src/Forms/SettingsProfileExport.Designer.cs @@ -28,12 +28,17 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.labelProfiles = new System.Windows.Forms.Label(); this.buttonOK = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); this.listViewExportStyles = new System.Windows.Forms.ListView(); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.saveFileDialogStyle = new System.Windows.Forms.SaveFileDialog(); + this.contextMenuStripSelect = new System.Windows.Forms.ContextMenuStrip(this.components); + this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.inverseSelectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStripSelect.SuspendLayout(); this.SuspendLayout(); // // labelProfiles @@ -49,7 +54,7 @@ // 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(186, 200); + this.buttonOK.Location = new System.Drawing.Point(249, 331); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(75, 23); this.buttonOK.TabIndex = 8; @@ -62,7 +67,7 @@ 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(267, 200); + this.buttonCancel.Location = new System.Drawing.Point(330, 331); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.TabIndex = 9; @@ -78,11 +83,12 @@ this.listViewExportStyles.CheckBoxes = true; this.listViewExportStyles.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1}); + this.listViewExportStyles.ContextMenuStrip = this.contextMenuStripSelect; this.listViewExportStyles.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; this.listViewExportStyles.HideSelection = false; this.listViewExportStyles.Location = new System.Drawing.Point(12, 34); this.listViewExportStyles.Name = "listViewExportStyles"; - this.listViewExportStyles.Size = new System.Drawing.Size(330, 160); + this.listViewExportStyles.Size = new System.Drawing.Size(393, 291); this.listViewExportStyles.TabIndex = 7; this.listViewExportStyles.UseCompatibleStateImageBehavior = false; this.listViewExportStyles.View = System.Windows.Forms.View.Details; @@ -91,11 +97,33 @@ // this.saveFileDialogStyle.OverwritePrompt = false; // + // contextMenuStripSelect + // + this.contextMenuStripSelect.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.selectAllToolStripMenuItem, + this.inverseSelectionToolStripMenuItem}); + this.contextMenuStripSelect.Name = "contextMenuStripSelect"; + this.contextMenuStripSelect.Size = new System.Drawing.Size(181, 70); + // + // selectAllToolStripMenuItem + // + this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; + this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.selectAllToolStripMenuItem.Text = "Select all"; + this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click); + // + // inverseSelectionToolStripMenuItem + // + this.inverseSelectionToolStripMenuItem.Name = "inverseSelectionToolStripMenuItem"; + this.inverseSelectionToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.inverseSelectionToolStripMenuItem.Text = "Inverse selection"; + this.inverseSelectionToolStripMenuItem.Click += new System.EventHandler(this.inverseSelectionToolStripMenuItem_Click); + // // SettingsProfileExport // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(354, 233); + this.ClientSize = new System.Drawing.Size(417, 364); this.Controls.Add(this.labelProfiles); this.Controls.Add(this.buttonOK); this.Controls.Add(this.buttonCancel); @@ -110,6 +138,7 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "SettingsProfileExport"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SettingsProfileExport_KeyDown); + this.contextMenuStripSelect.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -123,5 +152,8 @@ private System.Windows.Forms.ListView listViewExportStyles; private System.Windows.Forms.ColumnHeader columnHeader1; private System.Windows.Forms.SaveFileDialog saveFileDialogStyle; + private System.Windows.Forms.ContextMenuStrip contextMenuStripSelect; + private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem inverseSelectionToolStripMenuItem; } } \ No newline at end of file diff --git a/src/Forms/SettingsProfileExport.cs b/src/Forms/SettingsProfileExport.cs index 9e22b5f52..5c9c1756f 100644 --- a/src/Forms/SettingsProfileExport.cs +++ b/src/Forms/SettingsProfileExport.cs @@ -20,6 +20,9 @@ namespace Nikse.SubtitleEdit.Forms listViewExportStyles.Items.Add(new ListViewItem(profile.Name) { Checked = true, Tag = profile }); } + selectAllToolStripMenuItem.Text = Configuration.Settings.Language.FixCommonErrors.SelectAll; + inverseSelectionToolStripMenuItem.Text = Configuration.Settings.Language.FixCommonErrors.InverseSelection; + Text = Configuration.Settings.Language.Settings.ExportProfiles; buttonOK.Text = Configuration.Settings.Language.General.Ok; buttonCancel.Text = Configuration.Settings.Language.General.Cancel; @@ -67,5 +70,21 @@ namespace Nikse.SubtitleEdit.Forms DialogResult = DialogResult.Cancel; } } + + private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) + { + foreach (ListViewItem item in listViewExportStyles.Items) + { + item.Checked = true; + } + } + + private void inverseSelectionToolStripMenuItem_Click(object sender, EventArgs e) + { + foreach (ListViewItem item in listViewExportStyles.Items) + { + item.Checked = !item.Checked; + } + } } } diff --git a/src/Forms/SettingsProfileExport.resx b/src/Forms/SettingsProfileExport.resx index 9332dcf4c..cc57a5a5b 100644 --- a/src/Forms/SettingsProfileExport.resx +++ b/src/Forms/SettingsProfileExport.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 173, 17 + 17, 17