Add "Go to source view" in list view context menu

This commit is contained in:
OmrSi 2020-12-15 00:35:01 +02:00
parent bb561388d9
commit 5c07599141
6 changed files with 35 additions and 0 deletions

View File

@ -1251,6 +1251,7 @@ Go to "Options -> Settings -> Tools" to enter your Google translate API ke
<RemoveActors>Remove actors</RemoveActors>
<EditBookmark>Edit bookmark</EditBookmark>
<RemoveBookmark>Remove bookmark</RemoveBookmark>
<GoToSourceView>Go to source view</GoToSourceView>
</ContextMenu>
</Menu>
<Controls>

View File

@ -1766,6 +1766,7 @@ namespace Nikse.SubtitleEdit.Core
RemoveActors = "Remove actors",
EditBookmark = "Edit bookmark",
RemoveBookmark = "Remove bookmark",
GoToSourceView = "Go to source view",
}
},

View File

@ -4141,6 +4141,9 @@ namespace Nikse.SubtitleEdit.Core
case "Main/Menu/ContextMenu/RemoveBookmark":
language.Main.Menu.ContextMenu.RemoveBookmark = reader.Value;
break;
case "Main/Menu/ContextMenu/GoToSourceView":
language.Main.Menu.ContextMenu.GoToSourceView = reader.Value;
break;
case "Main/Controls/SubtitleFormat":
language.Main.Controls.SubtitleFormat = reader.Value;
break;

View File

@ -1620,6 +1620,7 @@
public string RemoveActors { get; set; }
public string EditBookmark { get; set; }
public string RemoveBookmark { get; set; }
public string GoToSourceView { get; set; }
}
public FileMenu File { get; set; }

View File

@ -287,6 +287,8 @@ namespace Nikse.SubtitleEdit.Forms
this.moveTextUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.moveTextDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItemBookmark = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItemGoToSourceView = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItemEmptyGoToSourceView = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.splitLineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItemMergeLines = new System.Windows.Forms.ToolStripMenuItem();
@ -2465,6 +2467,7 @@ namespace Nikse.SubtitleEdit.Forms
this.toolStripMenuItemCopySourceText,
this.toolStripMenuItemColumn,
this.toolStripMenuItemBookmark,
this.toolStripMenuItemGoToSourceView,
this.toolStripSeparator7,
this.splitLineToolStripMenuItem,
this.toolStripMenuItemMergeLines,
@ -2671,6 +2674,13 @@ namespace Nikse.SubtitleEdit.Forms
this.toolStripMenuItemBookmark.Text = "Bookmark...";
this.toolStripMenuItemBookmark.Click += new System.EventHandler(this.toolStripMenuItemBookmark_Click);
//
// toolStripMenuItemGoToSourceView
//
this.toolStripMenuItemGoToSourceView.Name = "toolStripMenuItemGoToSourceView";
this.toolStripMenuItemGoToSourceView.Size = new System.Drawing.Size(284, 22);
this.toolStripMenuItemGoToSourceView.Text = "Go to source view";
this.toolStripMenuItemGoToSourceView.Click += new System.EventHandler(this.toolStripMenuItemGoToSourceView_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
@ -5102,6 +5112,7 @@ namespace Nikse.SubtitleEdit.Forms
//
this.contextMenuStripEmpty.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.insertLineToolStripMenuItem,
this.toolStripMenuItemEmptyGoToSourceView,
this.aSSStylesToolStripMenuItem});
this.contextMenuStripEmpty.Name = "contextMenuStripEmpty";
this.contextMenuStripEmpty.Size = new System.Drawing.Size(136, 48);
@ -5114,6 +5125,13 @@ namespace Nikse.SubtitleEdit.Forms
this.insertLineToolStripMenuItem.Text = "Insert line";
this.insertLineToolStripMenuItem.Click += new System.EventHandler(this.InsertLineToolStripMenuItemClick);
//
// toolStripMenuItemEmptyGoToSourceView
//
this.toolStripMenuItemEmptyGoToSourceView.Name = "toolStripMenuItemEmptyGoToSourceView";
this.toolStripMenuItemEmptyGoToSourceView.Size = new System.Drawing.Size(284, 22);
this.toolStripMenuItemEmptyGoToSourceView.Text = "Go to source view";
this.toolStripMenuItemEmptyGoToSourceView.Click += new System.EventHandler(this.toolStripMenuItemGoToSourceView_Click);
//
// aSSStylesToolStripMenuItem
//
this.aSSStylesToolStripMenuItem.Name = "aSSStylesToolStripMenuItem";
@ -5675,6 +5693,8 @@ namespace Nikse.SubtitleEdit.Forms
private System.Windows.Forms.ToolStripMenuItem googleTranslateToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem microsoftBingTranslateToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemBookmark;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemGoToSourceView;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemEmptyGoToSourceView;
private System.Windows.Forms.ToolStripMenuItem removeAllFormattingsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem removeBoldToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem removeItalicToolStripMenuItem;

View File

@ -1576,6 +1576,7 @@ namespace Nikse.SubtitleEdit.Forms
toolStripMenuItemDelete.Text = _language.Menu.ContextMenu.Delete;
insertLineToolStripMenuItem.Text = _language.Menu.ContextMenu.InsertFirstLine;
toolStripMenuItemEmptyGoToSourceView.Text = _language.Menu.ContextMenu.GoToSourceView;
toolStripMenuItemInsertBefore.Text = _language.Menu.ContextMenu.InsertBefore;
toolStripMenuItemInsertAfter.Text = _language.Menu.ContextMenu.InsertAfter;
toolStripMenuItemInsertSubtitle.Text = _language.Menu.ContextMenu.InsertSubtitleAfter;
@ -1593,6 +1594,7 @@ namespace Nikse.SubtitleEdit.Forms
moveTextDownToolStripMenuItem.Text = _language.Menu.ContextMenu.ColumnTextDown;
copyOriginalTextToCurrentToolStripMenuItem.Text = _language.Menu.ContextMenu.ColumnCopyOriginalTextToCurrent;
toolStripMenuItemBookmark.Text = Configuration.Settings.Language.Settings.ToggleBookmarksWithComment;
toolStripMenuItemGoToSourceView.Text = _language.Menu.ContextMenu.GoToSourceView;
splitLineToolStripMenuItem.Text = _language.Menu.ContextMenu.Split;
toolStripMenuItemMergeLines.Text = _language.Menu.ContextMenu.MergeSelectedLines;
@ -21162,6 +21164,8 @@ namespace Nikse.SubtitleEdit.Forms
closeVideoToolStripMenuItem.ShortcutKeys = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainVideoClose);
showhideVideoToolStripMenuItem.ShortcutKeys = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainVideoShowHideVideo);
toolStripMenuItemBookmark.ShortcutKeys = UiUtil.GetKeys(Configuration.Settings.Shortcuts.GeneralToggleBookmarksWithText);
toolStripMenuItemGoToSourceView.ShortcutKeys = UiUtil.GetKeys(Configuration.Settings.Shortcuts.GeneralToggleView);
toolStripMenuItemEmptyGoToSourceView.ShortcutKeys = UiUtil.GetKeys(Configuration.Settings.Shortcuts.GeneralToggleView);
spellCheckToolStripMenuItem.ShortcutKeys = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainSpellCheck);
findDoubleWordsToolStripMenuItem.ShortcutKeys = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainSpellCheckFindDoubleWords);
@ -28489,6 +28493,11 @@ namespace Nikse.SubtitleEdit.Forms
ToggleBookmarks(true);
}
private void toolStripMenuItemGoToSourceView_Click(object sender, EventArgs e)
{
tabControlSubtitle.SelectedIndex = TabControlSourceView;
}
private void RunActionOnAllParagraphs(Func<Paragraph, string> action, string historyMessage)
{
if (_subtitle.Paragraphs.Count <= 0 || SubtitleListview1.SelectedItems.Count <= 0)