From 077e12b7ccadd0fb1277f0a63c2d3f189da9dd38 Mon Sep 17 00:00:00 2001 From: RKrom Date: Wed, 20 Jun 2012 16:22:32 +0000 Subject: [PATCH] Fixing hotkey issues git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1926 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- GreenshotPlugin/Controls/GreenshotForm.cs | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/GreenshotPlugin/Controls/GreenshotForm.cs b/GreenshotPlugin/Controls/GreenshotForm.cs index 9924ff703..e0852754a 100644 --- a/GreenshotPlugin/Controls/GreenshotForm.cs +++ b/GreenshotPlugin/Controls/GreenshotForm.cs @@ -394,7 +394,15 @@ namespace GreenshotPlugin.Controls { TextBox textBox = controlObject as TextBox; if (textBox != null) { - textBox.Text = iniValue.ToString(); + HotkeyControl hotkeyControl = controlObject as HotkeyControl; + if (hotkeyControl != null) { + string hotkeyValue = (string)iniValue.Value; + if (!string.IsNullOrEmpty(hotkeyValue)) { + hotkeyControl.SetHotkey(hotkeyValue); + } + continue; + } + textBox.Text = iniValue.ToString(); continue; } @@ -405,14 +413,6 @@ namespace GreenshotPlugin.Controls { continue; } - HotkeyControl hotkeyControl = controlObject as HotkeyControl; - if (hotkeyControl != null) { - string hotkeyValue = (string)iniValue.Value; - if (!string.IsNullOrEmpty(hotkeyValue)) { - hotkeyControl.SetHotkey(hotkeyValue); - } - continue; - } } } } @@ -448,13 +448,12 @@ namespace GreenshotPlugin.Controls { } TextBox textBox = controlObject as TextBox; if (textBox != null) { - HotkeyControl hotkeyControl = textBox as HotkeyControl; - if (hotkeyControl != null) { - string hotkeyString = hotkeyControl.ToString(); - iniValue.Value = hotkeyString; - iniDirty = true; - continue; - } + HotkeyControl hotkeyControl = controlObject as HotkeyControl; + if (hotkeyControl != null) { + iniValue.Value = hotkeyControl.ToString(); + iniDirty = true; + continue; + } iniValue.UseValueOrDefault(textBox.Text); iniDirty = true; continue; @@ -465,6 +464,7 @@ namespace GreenshotPlugin.Controls { iniDirty = true; continue; } + } } }