mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
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:
parent
eeca9ec0de
commit
8b331ee3a4
8 changed files with 71 additions and 14 deletions
|
@ -41,6 +41,7 @@ namespace GreenshotImgurPlugin {
|
|||
private IGreenshotHost host;
|
||||
private ComponentResourceManager resources;
|
||||
private ToolStripMenuItem historyMenuItem = null;
|
||||
private ToolStripMenuItem itemPlugInConfig;
|
||||
|
||||
public ImgurPlugin() {
|
||||
}
|
||||
|
@ -78,7 +79,7 @@ namespace GreenshotImgurPlugin {
|
|||
};
|
||||
itemPlugInRoot.DropDownItems.Add(historyMenuItem);
|
||||
|
||||
ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem(Language.GetString("imgur", LangKey.configure));
|
||||
itemPlugInConfig = new ToolStripMenuItem(Language.GetString("imgur", LangKey.configure));
|
||||
itemPlugInConfig.Tag = host;
|
||||
itemPlugInConfig.Click += delegate {
|
||||
config.ShowConfigDialog();
|
||||
|
@ -86,6 +87,7 @@ namespace GreenshotImgurPlugin {
|
|||
itemPlugInRoot.DropDownItems.Add(itemPlugInConfig);
|
||||
|
||||
PluginUtils.AddToContextMenu(host, itemPlugInRoot);
|
||||
Language.LanguageChanged += new LanguageChangedHandler(OnLanguageChanged);
|
||||
|
||||
// retrieve history in the background
|
||||
Thread backgroundTask = new Thread (new ThreadStart(CheckHistory));
|
||||
|
@ -95,7 +97,16 @@ namespace GreenshotImgurPlugin {
|
|||
backgroundTask.Start();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void OnLanguageChanged() {
|
||||
if (itemPlugInConfig != null) {
|
||||
itemPlugInConfig.Text = Language.GetString("imgur", LangKey.configure);
|
||||
}
|
||||
if (historyMenuItem != null) {
|
||||
historyMenuItem.Text = Language.GetString("imgur", LangKey.history);
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckHistory() {
|
||||
try {
|
||||
ImgurUtils.LoadHistory();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue