summaryrefslogtreecommitdiffstats
path: root/abs/core/mythtv/stable-30/mythtv/addHostnameIPtoMachineStatus.patch
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/mythtv/stable-30/mythtv/addHostnameIPtoMachineStatus.patch')
-rw-r--r--abs/core/mythtv/stable-30/mythtv/addHostnameIPtoMachineStatus.patch88
1 files changed, 88 insertions, 0 deletions
diff --git a/abs/core/mythtv/stable-30/mythtv/addHostnameIPtoMachineStatus.patch b/abs/core/mythtv/stable-30/mythtv/addHostnameIPtoMachineStatus.patch
new file mode 100644
index 0000000..2fd8b88
--- /dev/null
+++ b/abs/core/mythtv/stable-30/mythtv/addHostnameIPtoMachineStatus.patch
@@ -0,0 +1,88 @@
+diff --git a/mythtv/programs/mythfrontend/statusbox.cpp b/mythtv/programs/mythfrontend/statusbox.cpp
+index e45016af50..73e7792a61 100644
+--- a/mythtv/programs/mythfrontend/statusbox.cpp
++++ b/mythtv/programs/mythfrontend/statusbox.cpp
+@@ -5,6 +5,7 @@ using namespace std;
+
+ #include <QRegExp>
+ #include <QHostAddress>
++ #include <QNetworkInterface>
+
+ #include "mythcorecontext.h"
+ #include "filesysteminfo.h"
+@@ -1271,9 +1272,10 @@ void StatusBox::doMachineStatus()
+ m_iconState->DisplayState("machine");
+ m_logList->Reset();
+ QString machineStr = tr("Machine Status shows some operating system "
+- "statistics of this machine");
++ "statistics of this machine.");
+ if (!m_isBackendActive)
+- machineStr.append(" " + tr("and the MythTV server"));
++ machineStr = tr("Machine Status shows some operating system "
++ "statistics of this machine and the MythTV server.");
+
+ if (m_helpText)
+ m_helpText->SetText(machineStr);
+@@ -1291,13 +1293,41 @@ void StatusBox::doMachineStatus()
+ line = tr("This machine:");
+ AddLogLine(line, machineStr);
+
++ // Hostname & IP
++ line = " " + tr("Hostname") + ": " + gCoreContext->GetHostName();
++ line.append(" " + tr("IP") + ": ");
++ 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;
++
++ sep = ", ";
++ QString sep2 = "";
++ foreach(QNetworkAddressEntry addr, iface.addressEntries())
++ {
++ if (addr.ip().protocol() == QAbstractSocket::IPv4Protocol || addr.ip().protocol() == QAbstractSocket::IPv6Protocol)
++ {
++ line += sep2 + addr.ip().toString();
++ sep2 = ", ";
++ }
++ }
++ line += "";
++ }
++ AddLogLine(line, machineStr);
++
+ // uptime
+ if (!getUptime(uptime))
+ uptime = 0;
+ line = uptimeStr(uptime);
+
+ // weighted average loads
+- line.append(". " + tr("Load") + ": ");
++ line.append(" " + tr("Load") + ": ");
+
+ #if defined(_WIN32) || defined(Q_OS_ANDROID)
+ line.append(tr("unknown") + " - getloadavg() " + tr("failed"));
+@@ -1339,13 +1369,18 @@ void StatusBox::doMachineStatus()
+ line = tr("MythTV server") + ':';
+ AddLogLine(line, machineStr);
+
++ // Hostname & IP
++ line = " " + tr("Hostname") + ": " + gCoreContext->GetSetting("MasterServerName");
++ line.append(" " + tr("IP") + ": " + gCoreContext->GetSetting("MasterServerIP"));
++ AddLogLine(line, machineStr);
++
+ // uptime
+ if (!RemoteGetUptime(uptime))
+ uptime = 0;
+ line = uptimeStr(uptime);
+
+ // weighted average loads
+- line.append(". " + tr("Load") + ": ");
++ line.append(" " + tr("Load") + ": ");
+ float floads[3];
+ if (RemoteGetLoad(floads))
+ {