[electrum] network_dialog: Validate hosts and ports
Summary:
This adds a new HostValidator class to validate hostnames and IP
addresses entered into a QLineEdit. We use this class to validate the
server and proxy host.
This also adds the existing PortValidator class to the server and
proxy port widgets.
fixes electroncash#2743
This is a backport of electroncash#2744
Test Plan: Run the GUI, test the server host, server port, proxy host and proxy port fields. Invalid hostnames or ports should cause the widget to have a red border.
Reviewers: #bitcoin_abc, bytesofman
Reviewed By: #bitcoin_abc, bytesofman
Subscribers: bytesofman
Differential Revision: https://reviews.bitcoinabc.org/D15195