Populate a combo box with known network interfaces
Read Use /proc/net/devgetifaddrs() on Linux/OpenBSD/NetBSD/FreeBSD to enumerate the list of available network interfaces, and use a GtkComboBoxText to list them in the options dialog. If /procgetifaddrs() is not available (strict permissions, running on something other than Linux), an interface name can still be manually typed in.
Warts:
- Hitting enter (or selecting an interface from the list) doesn't automatically update the plugin's UI anymore (until you close the settings dialog). Unfortunately the combo box's
changedsignal gets fired for each character typed into the entry field, and there's no way to get a pointer to the underlyingGtkEntryin order to listen foractivateor handle key presses. - On
non-Linux systems, or systems wheresystems without/proc/net/devis locked down (if that's a thing)getifaddrs(), we still display a combo box, even though it will be empty. It's of course still possible to manually type in an interface name, as before.
Edited by Brian Tarricone