mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Added icons to the external commands editor & added a check for the OK button
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1746 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
5780560fbe
commit
cdba70d227
8 changed files with 109 additions and 22 deletions
|
@ -36,7 +36,6 @@ namespace ExternalCommand {
|
|||
public class ExternalCommandDestination : AbstractDestination {
|
||||
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ExternalCommandDestination));
|
||||
private static ExternalCommandConfiguration config = IniConfig.GetIniSection<ExternalCommandConfiguration>();
|
||||
private static Dictionary<string, Image> iconCache = new Dictionary<string, Image>();
|
||||
private IGreenshotHost host;
|
||||
private string presetCommand;
|
||||
|
||||
|
@ -69,20 +68,7 @@ namespace ExternalCommand {
|
|||
|
||||
public override Image DisplayIcon {
|
||||
get {
|
||||
if (presetCommand != null) {
|
||||
if (!iconCache.ContainsKey(presetCommand)) {
|
||||
Image icon = null;
|
||||
if (File.Exists(config.commandlines[presetCommand])) {
|
||||
try {
|
||||
icon = GetExeIcon(config.commandlines[presetCommand], 0);
|
||||
} catch{};
|
||||
}
|
||||
iconCache.Add(presetCommand, icon);
|
||||
}
|
||||
return iconCache[presetCommand];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
return IconCache.IconForExe(presetCommand);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue