From 273937c9ee4ba00ad049ac3c9fe62ecabd2f8fdb Mon Sep 17 00:00:00 2001 From: Lawrence Rust Date: Thu, 1 Oct 2015 09:56:13 +0100 Subject: [PATCH 283/290] FE: Add network status to machine status dialog Signed-off-by: Lawrence Rust --- mythtv/programs/mythfrontend/statusbox.cpp | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/mythtv/programs/mythfrontend/statusbox.cpp b/mythtv/programs/mythfrontend/statusbox.cpp index f0078ea..23c5a24 100644 --- a/mythtv/programs/mythfrontend/statusbox.cpp +++ src/mythtv/programs/mythfrontend/statusbox.cpp @@ -5,6 +5,8 @@ using namespace std; #include #include +#include +#include #include "mythcorecontext.h" #include "filesysteminfo.h" @@ -1221,6 +1223,12 @@ void StatusBox::doMachineStatus() line = tr("This machine:"); AddLogLine(line, machineStr); + // Hostname + line = " " + tr("Hostname") + ": " + QHostInfo::localHostName(); + if ( !QHostInfo::localDomainName().isEmpty()) + line += "." + QHostInfo::localDomainName(); + AddLogLine(line, machineStr); + // uptime if (!getUptime(uptime)) uptime = 0; @@ -1264,6 +1272,31 @@ void StatusBox::doMachineStatus() } } + // Network status + line = " " + tr("Interfaces") + ":"; + QString sep = " "; + foreach( QNetworkInterface iface, QNetworkInterface::allInterfaces()) + { + QNetworkInterface::InterfaceFlags f = iface.flags(); + if (!(f & QNetworkInterface::IsUp)) + continue; + if (!(f & QNetworkInterface::IsRunning)) + continue; + if (f & QNetworkInterface::IsLoopBack) + continue; + + line += sep + iface.humanReadableName() + " ["; + sep = ", "; + QString sep2 = ""; + foreach( QNetworkAddressEntry addr, iface.addressEntries()) + { + line += sep2 + addr.ip().toString(); + sep2 = ", "; + } + line += "]"; + } + AddLogLine(line, machineStr); + if (!m_isBackendActive) { line = tr("MythTV server") + ':'; -- 1.7.9.5