Fixes for bug #1484, disabling the edit button after redrawing the items.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2551 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2013-04-03 07:18:26 +00:00
parent b1a7fd77eb
commit 28346d2eab
3 changed files with 18 additions and 10 deletions

View file

@ -11,20 +11,20 @@ namespace ExternalCommand {
private static ExternalCommandConfiguration config = IniConfig.GetIniSection<ExternalCommandConfiguration>();
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(IconCache));
public static Image IconForExe(string exepath) {
if (exepath != null) {
if (!iconCache.ContainsKey(exepath)) {
public static Image IconForCommand(string commandName) {
if (commandName != null) {
if (!iconCache.ContainsKey(commandName)) {
Image icon = null;
if (File.Exists(config.commandlines[exepath])) {
if (File.Exists(config.commandlines[commandName])) {
try {
icon = PluginUtils.GetExeIcon(config.commandlines[exepath], 0);
icon = PluginUtils.GetExeIcon(config.commandlines[commandName], 0);
} catch (Exception ex) {
LOG.Warn("Problem loading icon for " + config.commandlines[exepath], ex);
LOG.Warn("Problem loading icon for " + config.commandlines[commandName], ex);
}
}
iconCache.Add(exepath, icon);
iconCache.Add(commandName, icon);
}
return iconCache[exepath];
return iconCache[commandName];
} else {
return null;
}