diff --git a/Greenshot/Forms/AboutForm.Designer.cs b/Greenshot/Forms/AboutForm.Designer.cs index 3baeb5251..0ac855712 100644 --- a/Greenshot/Forms/AboutForm.Designer.cs +++ b/Greenshot/Forms/AboutForm.Designer.cs @@ -48,7 +48,6 @@ namespace Greenshot { /// not be able to load this method if it was changed manually. /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutForm)); this.lblTitle = new System.Windows.Forms.Label(); this.lblLicense = new GreenshotPlugin.Controls.GreenshotLabel(); this.lblHost = new GreenshotPlugin.Controls.GreenshotLabel(); @@ -82,7 +81,6 @@ namespace Greenshot { this.lblLicense.Name = "lblLicense"; this.lblLicense.Size = new System.Drawing.Size(369, 68); this.lblLicense.TabIndex = 3; - this.lblLicense.Text = resources.GetString("lblLicense.Text"); // // lblHost // @@ -184,7 +182,6 @@ namespace Greenshot { // // pictureBox1 // - this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); this.pictureBox1.Location = new System.Drawing.Point(12, 12); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(90, 90); diff --git a/Greenshot/Forms/AboutForm.cs b/Greenshot/Forms/AboutForm.cs index bccb20189..9af83284e 100644 --- a/Greenshot/Forms/AboutForm.cs +++ b/Greenshot/Forms/AboutForm.cs @@ -39,7 +39,7 @@ namespace Greenshot { // InitializeComponent(); this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon(); - + this.pictureBox1.Image = GreenshotPlugin.Core.GreenshotResources.getGreenshotImage(); Version v = Assembly.GetExecutingAssembly().GetName().Version; // Format is like this: AssemblyVersion("Major.Minor.Build.Revision")] lblTitle.Text = "Greenshot " + v.Major + "." + v.Minor + "." + v.Build + " Build " + v.Revision + (IniConfig.IsPortable?" Portable":"") + (" (" + OSInfo.Bits +" bit)"); diff --git a/Greenshot/Forms/BugReportForm.Designer.cs b/Greenshot/Forms/BugReportForm.Designer.cs index b93eb9789..d69e48703 100644 --- a/Greenshot/Forms/BugReportForm.Designer.cs +++ b/Greenshot/Forms/BugReportForm.Designer.cs @@ -46,7 +46,6 @@ namespace Greenshot.Forms { /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BugReportForm)); this.labelBugReportInfo = new GreenshotPlugin.Controls.GreenshotLabel(); this.textBoxDescription = new System.Windows.Forms.TextBox(); this.btnClose = new GreenshotPlugin.Controls.GreenshotButton(); @@ -60,7 +59,6 @@ namespace Greenshot.Forms { this.labelBugReportInfo.Name = "labelBugReportInfo"; this.labelBugReportInfo.Size = new System.Drawing.Size(481, 141); this.labelBugReportInfo.TabIndex = 0; - this.labelBugReportInfo.Text = resources.GetString("labelBugReportInfo.Text"); // // textBoxDescription // diff --git a/Greenshot/Forms/MainForm.cs b/Greenshot/Forms/MainForm.cs index d4db1911f..13131d2d0 100644 --- a/Greenshot/Forms/MainForm.cs +++ b/Greenshot/Forms/MainForm.cs @@ -459,15 +459,19 @@ namespace Greenshot { private static bool RegisterHotkey(StringBuilder failedKeys, string functionName, string hotkeyString, HotKeyHandler handler) { Keys modifierKeyCode = HotkeyControl.HotkeyModifiersFromString(hotkeyString); Keys virtualKeyCode = HotkeyControl.HotkeyFromString(hotkeyString); - if (HotkeyControl.RegisterHotKey(modifierKeyCode, virtualKeyCode, handler) < 0) { - LOG.DebugFormat("Failed to register {0} to hotkey: {1}", functionName, hotkeyString); - if (failedKeys.Length > 0) { - failedKeys.Append(", "); + if (!Keys.None.Equals(virtualKeyCode)) { + if (HotkeyControl.RegisterHotKey(modifierKeyCode, virtualKeyCode, handler) < 0) { + LOG.DebugFormat("Failed to register {0} to hotkey: {1}", functionName, hotkeyString); + if (failedKeys.Length > 0) { + failedKeys.Append(", "); + } + failedKeys.Append(hotkeyString); + return false; + } else { + LOG.DebugFormat("Registered {0} to hotkey: {1}", functionName, hotkeyString); } - failedKeys.Append(hotkeyString); - return false; } else { - LOG.DebugFormat("Registered {0} to hotkey: {1}", functionName, hotkeyString); + LOG.InfoFormat("Skipping hotkey registration for {0}, no hotkey set!", functionName); } return true; } diff --git a/GreenshotPlugin/Controls/GreenshotForm.cs b/GreenshotPlugin/Controls/GreenshotForm.cs index a5ad426f9..a1df47fce 100644 --- a/GreenshotPlugin/Controls/GreenshotForm.cs +++ b/GreenshotPlugin/Controls/GreenshotForm.cs @@ -147,7 +147,6 @@ namespace GreenshotPlugin.Controls { if (ce.Component != null && ((IComponent)ce.Component).Site != null) { Control control = ce.Component as Control; if (control != null) { - LOG.DebugFormat("Control {0} added.", control.Name); if (!designTimeControls.ContainsKey(control.Name)) { designTimeControls.Add(control.Name, control); } else { @@ -168,12 +167,10 @@ namespace GreenshotPlugin.Controls { protected void ApplyLanguage(Control applyTo) { IGreenshotLanguageBindable languageBindable = applyTo as IGreenshotLanguageBindable; if (languageBindable == null) { - LOG.DebugFormat("Not bindable: {0}", applyTo.Name); return; } string languageKey = languageBindable.LanguageKey; - LOG.DebugFormat("Found language key '{0}' configured on control '{1}'", languageKey, applyTo.Name); // Apply language text to the control ApplyLanguage(applyTo, languageKey); // Repopulate the combox boxes @@ -197,14 +194,12 @@ namespace GreenshotPlugin.Controls { /// Apply all the language settings to the "Greenshot" Controls on this form /// protected void ApplyLanguage() { - LOG.DebugFormat("Applying language, using key {0}", LanguageKey); // Set title of the form if (!string.IsNullOrEmpty(LanguageKey)) { this.Text = Language.GetString(LanguageKey); } // Reset the text values for all GreenshotControls - foreach (FieldInfo field in this.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)) { - LOG.DebugFormat("Checking field {0}", field.Name); + foreach (FieldInfo field in this.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)) { if (!field.FieldType.IsSubclassOf(typeof(Control))) { LOG.DebugFormat("No control: {0}", field.Name); continue; diff --git a/GreenshotPlugin/Core/Language.cs b/GreenshotPlugin/Core/Language.cs index e527bffa5..38e90ab33 100644 --- a/GreenshotPlugin/Core/Language.cs +++ b/GreenshotPlugin/Core/Language.cs @@ -93,11 +93,13 @@ namespace GreenshotPlugin.Core { coreConfig = IniConfig.GetIniSection(); ScanFiles(); if (!string.IsNullOrEmpty(coreConfig.Language)) { - currentLanguage = coreConfig.Language; + CurrentLanguage = coreConfig.Language; } else { - currentLanguage = DEFAULT_LANGUAGE; + CurrentLanguage = DEFAULT_LANGUAGE; + } + if (string.IsNullOrEmpty(CurrentLanguage)) { + throw new ApplicationException("Couldn't set language, installation problem?"); } - Reload(); } /// @@ -171,8 +173,8 @@ namespace GreenshotPlugin.Core { return currentLanguage; } set { - LOG.DebugFormat("CurrentLangue = {0}, new value {1}", currentLanguage, value); string ietf = ClearIETF(value); + LOG.DebugFormat("CurrentLangue = {0}, new value {1} ({2})", currentLanguage, value, ietf); if (!string.IsNullOrEmpty(ietf)) { if (!languageFiles.ContainsKey(ietf)) { LOG.WarnFormat("Unknown language {0}, trying best match!", ietf); @@ -187,7 +189,7 @@ namespace GreenshotPlugin.Core { if (!languageFiles.ContainsKey(ietf)) { LOG.WarnFormat("No match for language {0} found!", ietf); } else { - if (currentLanguage == null && !currentLanguage.Equals(ietf)) { + if (currentLanguage == null || !currentLanguage.Equals(ietf)) { currentLanguage = ietf; Reload(); return;