Make Google Translate shortcut customizable - thx darnn :)

Fix #3706
This commit is contained in:
Nikolaj Olsson 2020-05-08 11:45:50 +02:00
parent 36ccb39cce
commit d8ab2e3386
5 changed files with 11 additions and 8 deletions

View File

@ -1785,6 +1785,7 @@ $HorzAlign = Center
Waveform100MsRight = "Shift+Right";
Waveform1000MsLeft = "Left";
Waveform1000MsRight = "Right";
MainTranslateGoogleTranslate = "Control+Shift+G";
MainAdjustExtendToNextSceneChange = string.Empty;
MainAdjustExtendToPreviousSceneChange = string.Empty;
MainAdjustExtendToNextSubtitle = "Control+Shift+E";
@ -1979,6 +1980,12 @@ $HorzAlign = Center
settings.Shortcuts.MainVideoGoToStartCurrent = "Shift+F11";
}
}
else if (settings.Version.StartsWith("3.5.15", StringComparison.Ordinal) ||
settings.Version.StartsWith("3.5.14", StringComparison.Ordinal) ||
settings.Version.StartsWith("3.5.13", StringComparison.Ordinal))
{
settings.Shortcuts.MainTranslateGoogleTranslate = "Control+Shift+G";
}
}
catch (Exception exception)
{

View File

@ -14806,11 +14806,6 @@ namespace Nikse.SubtitleEdit.Forms
e.SuppressKeyPress = true;
buttonGoogleIt_Click(null, null);
}
else if (_shortcuts.MainTranslateGoogleTranslate == e.KeyData)
{
e.SuppressKeyPress = true;
buttonGoogleTranslateIt_Click(null, null);
}
else if (_shortcuts.MainTranslateCustomSearch1 == e.KeyData)
{
e.SuppressKeyPress = true;
@ -20061,6 +20056,8 @@ namespace Nikse.SubtitleEdit.Forms
findDoubleWordsToolStripMenuItem.ShortcutKeys = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainSpellCheckFindDoubleWords);
addWordToNameListToolStripMenuItem.ShortcutKeys = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainSpellCheckAddWordToNames);
translateByGoogleToolStripMenuItem.ShortcutKeys = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainTranslateGoogleTranslate);
toolStripMenuItemAdjustAllTimes.ShortcutKeys = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainSynchronizationAdjustTimes);
visualSyncToolStripMenuItem.ShortcutKeys = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainSynchronizationVisualSync);
toolStripMenuItemPointSync.ShortcutKeys = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainSynchronizationPointSync);

View File

@ -1299,7 +1299,7 @@ namespace Nikse.SubtitleEdit.Forms
var translateNode = new ShortcutNode(Configuration.Settings.Language.Main.VideoControls.Translate);
AddNode(translateNode, Configuration.Settings.Language.Main.VideoControls.GoogleIt, nameof(Configuration.Settings.Shortcuts.MainTranslateGoogleIt));
AddNode(translateNode, Configuration.Settings.Language.Main.VideoControls.GoogleTranslate, nameof(Configuration.Settings.Shortcuts.MainTranslateGoogleTranslate));
AddNode(translateNode, Configuration.Settings.Language.Main.VideoControls.GoogleTranslate, nameof(Configuration.Settings.Shortcuts.MainTranslateGoogleTranslate), true);
AddNode(translateNode, language.CustomSearch1, nameof(Configuration.Settings.Shortcuts.MainTranslateCustomSearch1));
AddNode(translateNode, language.CustomSearch2, nameof(Configuration.Settings.Shortcuts.MainTranslateCustomSearch2));
AddNode(translateNode, language.CustomSearch3, nameof(Configuration.Settings.Shortcuts.MainTranslateCustomSearch3));

View File

@ -36,6 +36,7 @@ namespace Nikse.SubtitleEdit.Forms
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
UiUtil.FixLargeFonts(this, buttonOK);
labelUseCalc.Font = new System.Drawing.Font(labelCalcInfo.Font.Name, labelCalcInfo.Font.Size, System.Drawing.FontStyle.Bold);
CalcMilliseconds();
}

View File

@ -153,7 +153,6 @@ namespace Nikse.SubtitleEdit.Logic
public Keys WaveformToggleSceneChange { get; set; }
public Keys WaveformGuessStart { get; set; }
public Keys MainTranslateGoogleIt { get; set; }
public Keys MainTranslateGoogleTranslate { get; set; }
public Keys MainTranslateCustomSearch1 { get; set; }
public Keys MainTranslateCustomSearch2 { get; set; }
public Keys MainTranslateCustomSearch3 { get; set; }
@ -310,7 +309,6 @@ namespace Nikse.SubtitleEdit.Logic
WaveformToggleSceneChange = UiUtil.GetKeys(Configuration.Settings.Shortcuts.WaveformToggleSceneChange);
WaveformGuessStart = UiUtil.GetKeys(Configuration.Settings.Shortcuts.WaveformGuessStart);
MainTranslateGoogleIt = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainTranslateGoogleIt);
MainTranslateGoogleTranslate = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainTranslateGoogleTranslate);
MainTranslateCustomSearch1 = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch1);
MainTranslateCustomSearch2 = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch2);
MainTranslateCustomSearch3 = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch3);