diff --git a/ChangeLog b/ChangeLog index 436e6b085..c47fb5717 100644 --- a/ChangeLog +++ b/ChangeLog @@ -161,6 +161,7 @@ 100. In non Dbus Qt builds, if notificaitons is checked ensure that sys tray is also checkedd. Conversly if sys tray is unchecked, uncheck notifications. 101. Add option to use libVLC for MPD HTTP stream playback. +102. Also show first IP address of interface in HTTP server settings page. 1.3.4 ----- diff --git a/http/httpserversettings.cpp b/http/httpserversettings.cpp index 7ea4ad7e8..7e9e32a21 100644 --- a/http/httpserversettings.cpp +++ b/http/httpserversettings.cpp @@ -33,18 +33,27 @@ static int isIfaceType(const QNetworkInterface &iface, const QString &prefix) return iface.name().length()>prefix.length() && iface.name().startsWith(prefix) && iface.name()[prefix.length()].isDigit(); } +static QString details(const QNetworkInterface &iface) +{ + QString d=iface.humanReadableName(); + if (!iface.addressEntries().isEmpty()) { + d+=QLatin1String(" - ")+iface.addressEntries().first().ip().toString(); + } + return d; +} + static QString displayName(const QNetworkInterface &iface) { if (iface.name()=="lo") { - return i18n("Local loopback (%1)", iface.name()); + return i18n("Local loopback (%1)", details(iface)); } if (isIfaceType(iface, "eth")) { - return i18n("Wired (%1)", iface.name()); + return i18n("Wired (%1)", details(iface)); } if (isIfaceType(iface, "wlan")) { - return i18n("Wireless (%1)", iface.name()); + return i18n("Wireless (%1)", details(iface)); } - return iface.name(); + return details(iface); } static void initInterfaces(QComboBox *combo)