Azaret / superputty

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

TreeView: Wrong behavior of double click on +/- icon #142

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Single click on a session node in the tree (not a folder node!) so that it 
becomes focused!
2. Double click on the + or - sign of any folder node

What is the expected output? What do you see instead?
Not sure what should happen, either nothing or the same as on single click on a 
+ or - sign, i.e. the folder is expanded or collapsed. Instead the folder is 
expanded and collapsed in short order AND the focused PuTTY session is opened.

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

Please provide any additional information below.
Surely only a minor issue

Original issue reported on code.google.com by breker.c...@gmail.com on 15 Jun 2012 at 12:55

GoogleCodeExporter commented 9 years ago
Add-on: To reproduce the issue one has in step 2 to double click on a folder 
node which is not a parent of the currently selecte node.

Original comment by breker.c...@gmail.com on 15 Jun 2012 at 1:40

GoogleCodeExporter commented 9 years ago
Instead of a MouseClick event on treeView1 we should IMO use a NodeMouseClick 
event with code like the following: 

        private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            // e is null if this method is called from connectToolStripMenuItem_Click
            TreeNode node = (e != null) ? e.Node : treeView1.SelectedNode;

            if (IsSessionNode(node) && node == treeView1.SelectedNode)
            {
                SessionData sessionData = (SessionData)node.Tag;
                SuperPuTTY.OpenPuttySession(sessionData);
            }
        }

Also connectToolStripMenuItem_Click would have to be changed to:

        private void connectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            treeView1_NodeMouseDoubleClick(null, EventArgs.Empty as TreeNodeMouseClickEventArgs);
        }

With this change the folder on whose + or - sign one double clicks is still 
expanded and collapsed in short order but no PuTTY session is started.

Original comment by breker.c...@gmail.com on 15 Jun 2012 at 2:11

GoogleCodeExporter commented 9 years ago
Applied fix.

will be in final 1.2 build (#14).

Original comment by btatey...@gmail.com on 16 Jun 2012 at 11:38