Frame network device icon palette is to show IP address, but it lags or is wrong. Testing with NetworkManager 1.2.2 and 1.2.4 showed;
wireless initially 0.0.0.0, but when the signal strength changes several seconds later the IP address assigned by DHCP is shown,
ad-hoc with no peers never shows IP address, always 0.0.0.0, even though an address is assigned,
wired ethernet never shows IP address, always 0.0.0.0.
The problem is in NetworkManager, and Sugar is showing whatever NetworkManager provides as the Ip4Address property for the interface object.
However, the Ip4Address property has been deprecated. It may be that being deprecated, the Ip4Address property is no longer well maintained, or intentionally delayed, and we might not be able to get it fixed upstream.
This patch;
uses the AddressData property from Ip4Config object,
uses asynchronous requests instead of blocking,
moves duplicated code to common code,
Tests were on Ubuntu 16.04 and 16.10. Tests must be with real hardware, or virtual machines that simulate wireless and ethernet connections.
Test method;
show the network view with f1, and identify the access points and ad-hoc network icons,
show the frame with f6, and identify the network device icon,
connect to an access point or ad-hoc network, or connect network cable,
quickly right-click on the network device icon; the menu is shown with no content yet,
observe the IP address shown in the menu when the connection is complete.
Frame network device icon palette is to show IP address, but it lags or is wrong. Testing with NetworkManager 1.2.2 and 1.2.4 showed;
0.0.0.0
, but when the signal strength changes several seconds later the IP address assigned by DHCP is shown,0.0.0.0
, even though an address is assigned,0.0.0.0
.The problem is in NetworkManager, and Sugar is showing whatever NetworkManager provides as the
Ip4Address
property for the interface object.However, the
Ip4Address
property has been deprecated. It may be that being deprecated, theIp4Address
property is no longer well maintained, or intentionally delayed, and we might not be able to get it fixed upstream.This patch;
AddressData
property fromIp4Config
object,Tests were on Ubuntu 16.04 and 16.10. Tests must be with real hardware, or virtual machines that simulate wireless and ethernet connections.
Test method;
f1
, and identify the access points and ad-hoc network icons,f6
, and identify the network device icon,