Allows multiple selection and action for the nodes in the peer and ban tables in the Debug Window.
Closes #8864
OS X screenshots:
Current
8874

When multiple nodes are selected the dropdown menu should be "Nodes".
concept ACK
... or you can change the text to "Disconnect" and "Ban for 1 hour". I think we should use consistent terminology here. The bookmark is called "Peers" and we use "node" here. RPCs are getpeerinfo, addnode. Oops. But at least GUI should be consistent.
Our peers are nodes. Different terms for different things. Peer is the relationship, node is the thing.
Truncating the menu items does seem like the simplest approach here, though.
I've just removed Node so that it says Disconnect, Ban for .., and Unban
Have tested d651056 I've been unable to ban/kick multiple peers. Either with Ctrl-click or Shift-click. Is there some other trick? Ubuntu 16.04, Qt reports as 5.5.1. It seems like it allows multiple selection (e.g. two nodes can be selected for a fraction of a second) but always ends up selecting the last clicked node. Maybe some rogue event handler?
Click, hold, and move your mouse across multiple rows. That's what works. I haven't figured out Ctrl+click or Shift+click yet.
Needs rebase.
1021 | + 1022 | + CNetAddr resolved; 1023 | + if(!LookupHost(addr.c_str(), resolved, false)) 1024 | + continue; 1025 | + g_connman->Ban(resolved, BanReasonManuallyAdded, bantime); 1026 | + clearSelectedNode();
I think the clearSelectedNode(); and L1008 can be moved out of the for loop
Done
rebased
Tested a bit. Selecting multiple peers (with shift key or with the mouse) results in some of them getting deselected short after the selection.
I'm not sure why some of them get deselected. I noticed that too, but I can't figure out a reason for why that happens.
Can we use keyboard shortcuts for selecting as per GUI standards? I.e. hold down shift while using the a cursor up/down to select multiple, or using spacebar and cursor up/down to toggle whether a node is selected or not (once at least one node is selected)?
@rebroad It's whatever QAbstractItemView::ExtendedSelection specifies
@achow101: Are you planing to finalizing this? IMO there are still the issue with auto-deselecting rows.
@jonasschnelli Yes, I do plan on finishing this. However, I am having trouble with figuring out why there is auto-deselecting.
Allows multiple selection and action for the nodes in the peer and ban tables in the Debug Window.
rebased.
I think I figured out why it was auto-deselecting. It loses the selection after the model is refresehed.
I think I fixed the problem.
Actually fixed it this time.
Seems to work well enough now. If there are still minor issues with selection they can be fixed later. ACK 1077577
Post merge ACK.