maheshkumarvk / superputty

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

Patch - Host icon changer for 1.3 svn #203

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Originally had this patch for 1.2 but this patch is a nice clean version for 
1.3. 1.2 wasn't committed and was a little messy.

* It adds an imageList in frmSuperPutty to be the global icon list which is 
used by treeViewList as well as the dlgEditSession forms so was ideal to keep a 
central list for these shared icons.

* The sessionsData Class had to be adjusted to include the icon filename 
(preferred over an index Int) and if not found or missing, defaults to standard 
computer icon when loading.

Applying patch :

1. Checkout latest svn
2. Unzip attached file into root of checked out svn
3. Apply svn patch
4. Use sessions.xml with example set of hosts/edits
5. Edit a host and click icon button to change it's icon (to be improved later)

enjoy.

Original issue reported on code.google.com by djtrem...@gmail.com on 20 Aug 2012 at 10:10

Attachments:

GoogleCodeExporter commented 9 years ago
gave it a quick try but the patch was missing folder.bmp and I got this error:

2012-08-20 07:01:16,026 [8376] ERROR SuperPutty.Program - Error in Main
System.DivideByZeroException: Attempted to divide by zero.
   at SuperPutty.dlgEditSession.buttonImageSelect_Click(Object sender, EventArgs e) in E:\projects\dotnet\superputty\1.3\SuperPutty\dlgEditSession.cs:line 311
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

Can you just zip up your src tree?

Original comment by btatey...@gmail.com on 20 Aug 2012 at 11:04

GoogleCodeExporter commented 9 years ago
In your .\bin\Debug directory you should have 'themes' folder which should have 
been extracted from the 1.3.zip file but this is obviously a bug I should 
correct (possibly disable the edit icon if the themes/{theme} not existing etc).

I just noticed there's another bin in SuperPutty\bin which maybe have been the 
used directory for themes as I was using CurrentDirectory() which would be the 
active bin directory.

For convenience I've attached the source minus as much binary files and crap 
not needed to run.

Original comment by djtrem...@gmail.com on 20 Aug 2012 at 11:15

Attachments:

GoogleCodeExporter commented 9 years ago
Figured it out...had to have the themes folder in place.

I see what you're trying do but the current patch as some issues.

I'll take a closer look and see what I can do.

Original comment by btatey...@gmail.com on 20 Aug 2012 at 11:17

Attachments:

GoogleCodeExporter commented 9 years ago
Oh damn. I had that fixed. it's the .SelectedIndex somewhere which I've missed 
since converting this from 1.2 version. lol not sure how I didn't spot it this 
time around.
Ideally, I would like to make a separate icon when selected or opened etc but 
would need some input to ideas saving me a rewrite later.

Original comment by djtrem...@gmail.com on 20 Aug 2012 at 11:20

GoogleCodeExporter commented 9 years ago
Please add the extra "sp_folder" for selected folder in SessioTreeview.cs in 
method below. all good after that

        TreeNode AddFolderNode(TreeNode parentNode, String nodeName)
        {
            TreeNode nodeNew = null;
            if (parentNode.Nodes.ContainsKey(nodeName))
            {
                SuperPuTTY.ReportStatus("Node with the same name exists.  New node ({0}) NOT added", nodeName);
            }
            else
            {
                SuperPuTTY.ReportStatus("Adding new folder, {1}.  parent={0}", parentNode.Text, nodeName);
                nodeNew = parentNode.Nodes.Add(nodeName, nodeName, "sp_folder", "sp_folder");

Original comment by djtrem...@gmail.com on 20 Aug 2012 at 11:25

GoogleCodeExporter commented 9 years ago
Looks great!!!!

Original comment by strugare...@gmail.com on 23 Aug 2012 at 8:31

GoogleCodeExporter commented 9 years ago
The basics work but there's some fixes/improvements I'll be working on like the 
icon popup doesn't grow with the number of it's it finds within the directory 
list.

Once one of the other issue# for directory saving to the session or some other 
way, I'll change it to allow icons on folder too ie webserver group, mailserver 
group etc.

Not sure if the core developers are working on this (maybe should be a new 
issue#) but would be good if there is a treeview options section so I could add 
settings to alter the treeview appearance.

Original comment by djtrem...@gmail.com on 25 Aug 2012 at 12:00

GoogleCodeExporter commented 9 years ago
I saw all icons included in this patch and they are not "unified".

Original comment by strugare...@gmail.com on 25 Aug 2012 at 2:34

GoogleCodeExporter commented 9 years ago
Take a look at the famfamfam silk icons and put whatever you'd like to use in 
the bin/themes/default/icons folders.

Original comment by btatey...@gmail.com on 25 Aug 2012 at 9:03

GoogleCodeExporter commented 9 years ago
Whatever 'unified icons' means, this was just a bunch of icons I found/liked to 
match what I needed for my own set. the famfamfam set look nice, now I know 
where you got your folder icon from :P

Please remember this still requires some newly added work/features. the long 
term I'd like to make it able to change the hardcoded 'default' theme with a 
combo selection based on what other folders are found in the /themes directory. 
then much longer down the track if this project ends up storing multiple 
session.xml's (to separate work, client sites and other lists from each other) 
we can tie each session list of servers to their own theme/icon set.

It's just a matter of whether this icon addition gains traction.

PS: sorry, I know a bug system is not meant to be treated like a 
forum/discussion list.

Original comment by djtrem...@gmail.com on 25 Aug 2012 at 10:12

GoogleCodeExporter commented 9 years ago
Yes, this is just a first step towards creating themes.

I've merged in your patch and made a few changes.  It will be in the next build.

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

GoogleCodeExporter commented 9 years ago
Issue 121 has been merged into this issue.

Original comment by btatey...@gmail.com on 26 Aug 2012 at 1:58