[GUI] connecting ports

In order to connect two ports p1 and p2, one has to start from p1, press the mouse and drag it to p2.
If p1 is connected to some port p3 with a wired p1-p3, it would be nice to allow to connect p2 by dragging the mouse over the wire p1-p3.

Also one cannot from an input to an output; we have to start from the output and drag he mouse to the input.
Would be useful to allow both directions

(from redmine: issue id 3003, created on 2017-07-25, closed on 2020-02-04)