Fixes for Bug #3579467, context menu entries are updated when changing the language / hotkeys.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2200 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-10-25 12:43:44 +00:00
commit 8b331ee3a4
8 changed files with 71 additions and 14 deletions

View file

@ -38,6 +38,7 @@ namespace GreenshotPicasaPlugin {
public static PluginAttribute Attributes;
private IGreenshotHost host;
private ComponentResourceManager resources;
private ToolStripMenuItem itemPlugInRoot;
public PicasaPlugin() {
}
@ -65,18 +66,25 @@ namespace GreenshotPicasaPlugin {
config = IniConfig.GetIniSection<PicasaConfiguration>();
resources = new ComponentResourceManager(typeof(PicasaPlugin));
ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem();
itemPlugInRoot = new ToolStripMenuItem();
itemPlugInRoot.Text = Language.GetString("picasa", LangKey.Configure);
itemPlugInRoot.Tag = host;
itemPlugInRoot.Image = (Image)resources.GetObject("Picasa");
itemPlugInRoot.Click += new System.EventHandler(ConfigMenuClick);
PluginUtils.AddToContextMenu(host, itemPlugInRoot);
Language.LanguageChanged += new LanguageChangedHandler(OnLanguageChanged);
return true;
}
public void OnLanguageChanged() {
if (itemPlugInRoot != null) {
itemPlugInRoot.Text = Language.GetString("picasa", LangKey.Configure);
}
}
public virtual void Shutdown() {
LOG.Debug("Picasa Plugin shutdown.");
Language.LanguageChanged -= new LanguageChangedHandler(OnLanguageChanged);
//host.OnImageEditorOpen -= new OnImageEditorOpenHandler(ImageEditorOpened);
}