shortcuts

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@2185 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2013-11-15 10:50:41 +00:00
parent 1194d2391a
commit 4cb7dc5169
6 changed files with 60 additions and 19 deletions

View File

@ -5,6 +5,7 @@
* Added new subtitle formats
* Added option to control border-marker-hit-size in audio waveform
* Added option regarding spell check and sigle letters
* Ctrl+Backspace in text box now deletes word to the left - thx Ivandrofly
* IMPROVED:
* Updated Portuguese language file - thx moob
* Updated Dutch language file - thx Herman
@ -25,6 +26,7 @@
* Batch convert now works with more CC formats
* Import sub with matching time codes in OCR window
now works with other formats than srt - thx osgZach
* Fix for multiline italics in Spruce/DVD Studio pro - thx Damian
3.3.9 (19th October 2013)

View File

@ -103,7 +103,7 @@ namespace Nikse.SubtitleEdit.Controls
double _wholeParagraphMinMilliseconds = 0;
double _wholeParagraphMaxMilliseconds = double.MaxValue;
public Keys _insertAtVideoPosition = Keys.None;
public Keys InsertAtVideoPositionShortcut = Keys.None;
public bool MouseWheelScrollUpIsForward = true;
public const double ZoomMininum = 0.1;
public const double ZoomMaxinum = 2.5;
@ -270,7 +270,7 @@ namespace Nikse.SubtitleEdit.Controls
ShowSpectrogram = true;
ShowWaveform = true;
VerticalZoomPercent = 1.0;
_insertAtVideoPosition = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainWaveformInsertAfter);
InsertAtVideoPositionShortcut = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainWaveformInsertAtCurrentPosition);
}
public void NearestSubtitles(Subtitle subtitle, double currentVideoPositionSeconds, int subtitleIndex)
@ -1462,7 +1462,7 @@ namespace Nikse.SubtitleEdit.Controls
Invalidate();
e.SuppressKeyPress = true;
}
else if (e.KeyData == _insertAtVideoPosition)
else if (e.KeyData == InsertAtVideoPositionShortcut)
{
if (InsertAtVideoPosition != null)
{

View File

@ -9,6 +9,7 @@ namespace Nikse.SubtitleEdit.Controls
/// </summary>
public class SETextBox : TextBox
{
private string breakChars = "\".!?,)([]<>:;♪{}-/#*| ¿¡" + Environment.NewLine + "\t";
string _dragText = string.Empty;
int _dragStartFrom = 0;
long _dragStartTicks = 0;
@ -23,6 +24,42 @@ namespace Nikse.SubtitleEdit.Controls
DragDrop += new DragEventHandler(SETextBox_DragDrop);
MouseDown += new MouseEventHandler(SETextBox_MouseDown);
MouseUp += new MouseEventHandler(SETextBox_MouseUp);
KeyDown += SETextBox_KeyDown;
}
void SETextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Modifiers == Keys.Control && e.KeyCode == Keys.Back)
{
int index = SelectionStart;
if (SelectionLength == 0)
{
string s = Text;
int deleteFrom = index-1;
if (deleteFrom > 0 && deleteFrom < s.Length)
{
if (s[deleteFrom] == ' ')
deleteFrom--;
while (deleteFrom > 0 && !(breakChars).Contains(s.Substring(deleteFrom, 1)))
{
deleteFrom--;
}
if (deleteFrom == index - 1)
{
while (deleteFrom > 0 && (breakChars.Replace(" ", string.Empty)).Contains(s.Substring(deleteFrom, 1)))
{
deleteFrom--;
}
}
if (s[deleteFrom] == ' ')
deleteFrom++;
Text = s.Remove(deleteFrom, index - deleteFrom);
SelectionStart = deleteFrom;
}
}
e.SuppressKeyPress = true;
}
}
void SETextBox_MouseUp(object sender, MouseEventArgs e)
@ -207,8 +244,7 @@ namespace Nikse.SubtitleEdit.Controls
}
private void SelectCurrentWord(TextBox tb)
{
string breakChars = "\".!?,)([]<>:;♪{}-/#*| ¿¡" + Environment.NewLine + "\t";
{
int selectionLength = 0;
int i = tb.SelectionStart;
while (i > 0 && breakChars.Contains(tb.Text.Substring(i - 1, 1)) == false)

View File

@ -13833,12 +13833,15 @@ namespace Nikse.SubtitleEdit.Forms
_waveformSearchSilenceForward = Utilities.GetKeys(Configuration.Settings.Shortcuts.WaveformSearchSilenceForward);
_waveformSearchSilenceBack = Utilities.GetKeys(Configuration.Settings.Shortcuts.WaveformSearchSilenceBack);
_waveformAddTextAtHere = Utilities.GetKeys(Configuration.Settings.Shortcuts.WaveformAddTextHere);
_mainTranslateCustomSearch1 = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch1);
_mainTranslateCustomSearch2 = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch2);
_mainTranslateCustomSearch3 = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch3);
_mainTranslateCustomSearch4 = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch4);
_mainTranslateCustomSearch5 = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch5);
_mainTranslateCustomSearch6 = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch6);
_mainTranslateCustomSearch1 = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch1);
_mainTranslateCustomSearch2 = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch2);
_mainTranslateCustomSearch3 = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch3);
_mainTranslateCustomSearch4 = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch4);
_mainTranslateCustomSearch5 = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch5);
_mainTranslateCustomSearch6 = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch6);
if (audioVisualizer != null)
audioVisualizer.InsertAtVideoPositionShortcut = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainWaveformInsertAtCurrentPosition);
}
public static object GetPropertiesAndDoAction(string pluginFileName, out string name, out string text, out decimal version, out string description, out string actionType, out string shortcut, out System.Reflection.MethodInfo mi)

View File

@ -649,7 +649,7 @@ namespace Nikse.SubtitleEdit.Forms
audioVisualizerNode.Nodes.Add(Configuration.Settings.Language.Settings.WaveformSeekSilenceBack + GetShortcutText(Configuration.Settings.Shortcuts.WaveformSearchSilenceBack));
audioVisualizerNode.Nodes.Add(Configuration.Settings.Language.Settings.WaveformAddTextHere + GetShortcutText(Configuration.Settings.Shortcuts.WaveformAddTextHere));
audioVisualizerNode.Nodes.Add(Configuration.Settings.Language.WaveForm.PlaySelection + GetShortcutText(Configuration.Settings.Shortcuts.WaveformPlaySelection));
audioVisualizerNode.Nodes.Add(Configuration.Settings.Language.Main.Menu.ContextMenu.InsertAfter + GetShortcutText(Configuration.Settings.Shortcuts.MainWaveformInsertAfter));
audioVisualizerNode.Nodes.Add(Configuration.Settings.Language.Main.VideoControls.InsertNewSubtitleAtVideoPosition + GetShortcutText(Configuration.Settings.Shortcuts.MainWaveformInsertAtCurrentPosition));
treeViewShortcuts.Nodes.Add(audioVisualizerNode);
@ -1342,8 +1342,8 @@ namespace Nikse.SubtitleEdit.Forms
Configuration.Settings.Shortcuts.WaveformSearchSilenceBack = GetShortcut(node.Text);
else if (text == (Configuration.Settings.Language.Settings.WaveformAddTextHere).Replace("&", string.Empty))
Configuration.Settings.Shortcuts.WaveformAddTextHere = GetShortcut(node.Text);
else if (Configuration.Settings.Language.Main.Menu.ContextMenu.InsertAfter != null && text == Configuration.Settings.Language.Main.Menu.ContextMenu.InsertAfter.Replace("&", string.Empty))
Configuration.Settings.Shortcuts.MainWaveformInsertAfter = GetShortcut(node.Text);
else if (Configuration.Settings.Language.Main.VideoControls.InsertNewSubtitleAtVideoPosition != null && text == Configuration.Settings.Language.Main.VideoControls.InsertNewSubtitleAtVideoPosition.Replace("&", string.Empty))
Configuration.Settings.Shortcuts.MainWaveformInsertAtCurrentPosition = GetShortcut(node.Text);
}
}

View File

@ -754,7 +754,7 @@ namespace Nikse.SubtitleEdit.Logic
public string MainAdjustSelected100MsBack { get; set; }
public string MainInsertAfter { get; set; }
public string MainTextBoxInsertAfter { get; set; }
public string MainWaveformInsertAfter { get; set; }
public string MainWaveformInsertAtCurrentPosition { get; set; }
public string MainInsertBefore { get; set; }
public string MainMergeDialogue { get; set; }
public string MainToogleFocus { get; set; }
@ -841,7 +841,7 @@ namespace Nikse.SubtitleEdit.Logic
MainAdjustSelected100MsBack = string.Empty;
MainInsertAfter = "Alt+Insert";
MainTextBoxInsertAfter = "Alt+Insert";
MainWaveformInsertAfter = "Alt+Insert";
MainWaveformInsertAtCurrentPosition = "Insert";
MainInsertBefore = "Control+Shift+Insert";
MainMergeDialogue = string.Empty;
WaveformVerticalZoom = string.Empty;
@ -2143,9 +2143,9 @@ namespace Nikse.SubtitleEdit.Logic
subNode = node.SelectSingleNode("MainTextBoxInsertAfter");
if (subNode != null)
settings.Shortcuts.MainTextBoxInsertAfter = subNode.InnerText;
subNode = node.SelectSingleNode("MainWaveformInsertAfter");
subNode = node.SelectSingleNode("MainWaveformInsertAtCurrentPosition");
if (subNode != null)
settings.Shortcuts.MainWaveformInsertAfter = subNode.InnerText;
settings.Shortcuts.MainWaveformInsertAtCurrentPosition = subNode.InnerText;
subNode = node.SelectSingleNode("MainInsertBefore");
if (subNode != null)
settings.Shortcuts.MainInsertBefore = subNode.InnerText;
@ -2681,7 +2681,7 @@ namespace Nikse.SubtitleEdit.Logic
textWriter.WriteElementString("MainAdjustSelected100MsBack", settings.Shortcuts.MainAdjustSelected100MsBack);
textWriter.WriteElementString("MainInsertAfter", settings.Shortcuts.MainInsertAfter);
textWriter.WriteElementString("MainTextBoxInsertAfter", settings.Shortcuts.MainTextBoxInsertAfter);
textWriter.WriteElementString("MainWaveformInsertAfter", settings.Shortcuts.MainWaveformInsertAfter);
textWriter.WriteElementString("MainWaveformInsertAtCurrentPosition", settings.Shortcuts.MainWaveformInsertAtCurrentPosition);
textWriter.WriteElementString("MainInsertBefore", settings.Shortcuts.MainInsertBefore);
textWriter.WriteElementString("MainMergeDialogue", settings.Shortcuts.MainMergeDialogue);
textWriter.WriteElementString("MainToogleFocus", settings.Shortcuts.MainToogleFocus);