mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 13:10:00 -07:00
Fixed issue with hotkey, still having some issues with the translations...
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1925 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
93bb5d992f
commit
7e27765314
2 changed files with 25 additions and 8 deletions
|
@ -44,10 +44,13 @@ namespace Greenshot {
|
||||||
private static CoreConfiguration coreConfiguration = IniConfig.GetIniSection<CoreConfiguration>();
|
private static CoreConfiguration coreConfiguration = IniConfig.GetIniSection<CoreConfiguration>();
|
||||||
private static EditorConfiguration editorConfiguration = IniConfig.GetIniSection<EditorConfiguration>();
|
private static EditorConfiguration editorConfiguration = IniConfig.GetIniSection<EditorConfiguration>();
|
||||||
private ToolTip toolTip = new ToolTip();
|
private ToolTip toolTip = new ToolTip();
|
||||||
private bool inHotkey = false;
|
private bool inHotkey = false;
|
||||||
|
|
||||||
public SettingsForm() : base() {
|
public SettingsForm() : base() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// Make sure the store isn't called to early, that's why we do it manually
|
||||||
|
ManualStoreFields = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnLoad(EventArgs e) {
|
protected override void OnLoad(EventArgs e) {
|
||||||
|
@ -392,7 +395,10 @@ namespace Greenshot {
|
||||||
|
|
||||||
void Settings_okayClick(object sender, System.EventArgs e) {
|
void Settings_okayClick(object sender, System.EventArgs e) {
|
||||||
if (CheckSettings()) {
|
if (CheckSettings()) {
|
||||||
|
GreenshotPlugin.Controls.HotkeyControl.UnregisterHotkeys();
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
|
StoreFields();
|
||||||
|
MainForm.RegisterHotkeys();
|
||||||
DialogResult = DialogResult.OK;
|
DialogResult = DialogResult.OK;
|
||||||
} else {
|
} else {
|
||||||
this.tabcontrol.SelectTab(this.tab_output);
|
this.tabcontrol.SelectTab(this.tab_output);
|
||||||
|
|
|
@ -16,6 +16,7 @@ namespace GreenshotPlugin.Controls {
|
||||||
private IComponentChangeService m_changeService;
|
private IComponentChangeService m_changeService;
|
||||||
private bool isDesignModeLanguageSet = false;
|
private bool isDesignModeLanguageSet = false;
|
||||||
private bool applyLanguageManually = false;
|
private bool applyLanguageManually = false;
|
||||||
|
private bool storeFieldsManually = false;
|
||||||
private IDictionary<string, Control> designTimeControls;
|
private IDictionary<string, Control> designTimeControls;
|
||||||
private IDictionary<string, ToolStripItem> designTimeToolStripItems;
|
private IDictionary<string, ToolStripItem> designTimeToolStripItems;
|
||||||
|
|
||||||
|
@ -34,6 +35,15 @@ namespace GreenshotPlugin.Controls {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected bool ManualStoreFields {
|
||||||
|
get {
|
||||||
|
return storeFieldsManually;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
storeFieldsManually = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Code to initialize the language etc during design time
|
/// Code to initialize the language etc during design time
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -101,7 +111,7 @@ namespace GreenshotPlugin.Controls {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
protected override void OnClosed(EventArgs e) {
|
protected override void OnClosed(EventArgs e) {
|
||||||
if (!this.DesignMode) {
|
if (!this.DesignMode && !storeFieldsManually) {
|
||||||
if (DialogResult == DialogResult.OK) {
|
if (DialogResult == DialogResult.OK) {
|
||||||
LOG.Info("Form was closed with OK: storing field values.");
|
LOG.Info("Form was closed with OK: storing field values.");
|
||||||
StoreFields();
|
StoreFields();
|
||||||
|
@ -438,6 +448,13 @@ namespace GreenshotPlugin.Controls {
|
||||||
}
|
}
|
||||||
TextBox textBox = controlObject as TextBox;
|
TextBox textBox = controlObject as TextBox;
|
||||||
if (textBox != null) {
|
if (textBox != null) {
|
||||||
|
HotkeyControl hotkeyControl = textBox as HotkeyControl;
|
||||||
|
if (hotkeyControl != null) {
|
||||||
|
string hotkeyString = hotkeyControl.ToString();
|
||||||
|
iniValue.Value = hotkeyString;
|
||||||
|
iniDirty = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
iniValue.UseValueOrDefault(textBox.Text);
|
iniValue.UseValueOrDefault(textBox.Text);
|
||||||
iniDirty = true;
|
iniDirty = true;
|
||||||
continue;
|
continue;
|
||||||
|
@ -448,12 +465,6 @@ namespace GreenshotPlugin.Controls {
|
||||||
iniDirty = true;
|
iniDirty = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
HotkeyControl hotkeyControl = controlObject as HotkeyControl;
|
|
||||||
if (hotkeyControl != null) {
|
|
||||||
iniValue.Value = hotkeyControl.ToString();
|
|
||||||
iniDirty = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue