ghostx2 / superputty

Automatically exported from code.google.com/p/superputty
MIT License
0 stars 0 forks source link

icon becomes first icon in list if the file is removed and app restarted. #213

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. set an icon on a host
2. allow session to save, close the app and remove the icon then start the app.
3. icon is now whatever the first icon is.  patch code made first icon always 
the computer as fallback.

What is the expected output? What do you see instead?
This merge introduced an unexpected feature I wrote something to avoid. I had 
it purposely load the default computer icon from the apps resources to be set 
as the first icon so that if an icon for whatever reason, cant be found in the 
image list, the standard computer icon will appear since it's the first in the 
list. This was to future proof the possible changes of themes and the same icon 
name doesn't exist in the new theme and it'll select the standard icon which I 
called "sp_computer" in the code.

What version of the product are you using? On what operating system?
latest svn

Please provide any additional information below.
my patch had upon loading the images to load firstly the computer icon used for 
standard host icons as the first. Might be best putting that code back.
Also noticed I missed the Home icon of putty itself which original 1.2 code I 
had it use a House icon which also was coded with a sp_ name prefix.

Original issue reported on code.google.com by djtrem...@gmail.com on 26 Aug 2012 at 8:47

GoogleCodeExporter commented 9 years ago
I've put in a check for valid icons and fail back to the computer.  I had put 
the folder in first to make the root node a folder...changed it to use image 
keys instead of 0 index.

As for the default set of icons, let's use the famfamfam set since we've taken 
care of the licensing issues with that.  

Also, fixed a bug where the file name with extension was being used as the 
image key.

Original comment by btatey...@gmail.com on 26 Aug 2012 at 2:57

GoogleCodeExporter commented 9 years ago
If removing the extension and your allowing multiple extensions, how are you 
managing images with the same name but different extension since it will load 
both since LoadImageList() doesn't have a 
imgIcons.Images.Keys.Contains("newfile") anywhere?

Oh I noticed another introduced bug. when editing a host, the current or 
(default computer) icon should appear in the button but it's blank. I had this 
load the computer icon or the found key icon in the list.

Original comment by djtrem...@gmail.com on 27 Aug 2012 at 9:26