diff options
Diffstat (limited to 'workspace')
| -rwxr-xr-x | workspace/LogReceiver/LogReceiver | bin | 55619 -> 56166 bytes | |||
| -rw-r--r-- | workspace/LogReceiver/logreceiver.cpp | 18 | ||||
| -rw-r--r-- | workspace/LogReceiver/logreceiver.h | 3 |
3 files changed, 12 insertions, 9 deletions
diff --git a/workspace/LogReceiver/LogReceiver b/workspace/LogReceiver/LogReceiver Binary files differindex 282159d..13304e8 100755 --- a/workspace/LogReceiver/LogReceiver +++ b/workspace/LogReceiver/LogReceiver diff --git a/workspace/LogReceiver/logreceiver.cpp b/workspace/LogReceiver/logreceiver.cpp index 30a29e7..f1a20b0 100644 --- a/workspace/LogReceiver/logreceiver.cpp +++ b/workspace/LogReceiver/logreceiver.cpp @@ -46,12 +46,13 @@ LogReceiver::LogReceiver(QWidget *parent) : mainLayout->addLayout(buttonLayout); //setLayout(mainLayout); - getListOfNetworkInterfaces(); + QList<QNetworkInterface> list = getListOfNetworkInterfaces(); buildGui(); addInterfacesToGroupBox(interfacesMap); pathToDhcpcdExe = "/home/niklas/fbgui/workspace/customdhcpcd/src/dhcpcd"; - QString ifName("eth0"); - runDHCPCD(ifName); + dhcpcdArguments.append("-d"); + //QString ifName(); + runDHCPCD(list); setWindowTitle(tr("NetD")); @@ -85,6 +86,8 @@ void LogReceiver::handleNewInput() { QString s_subState = logMsg.section(";", 2, 2); QString msg = logMsg.section(";", 3, 3); + int pBar = indexToIfaceNameMap.value(interface); + qDebug() << logMsg; qDebug() << msg; @@ -97,19 +100,19 @@ void LogReceiver::handleNewInput() { qDebug() << "received stat_ok"; switch (sst) { case DHCP_DISCOVER: - handleProgress(0,10); + handleProgress(pBar,10); break; case DHCP_OFFER: - handleProgress(0,20); + handleProgress(pBar,20); break; case DHCP_REQUEST: - handleProgress(0,30); + handleProgress(pBar,30); break; case DHCP_DECLINE: break; case DHCP_ACK: - handleProgress(0,40); + handleProgress(pBar,40); break; case DHCP_NAK: @@ -149,6 +152,7 @@ QList<QNetworkInterface> LogReceiver::getListOfNetworkInterfaces() { qDebug() << nI.humanReadableName(); result.append(nI); interfacesMap.insert(i, nI); + indexToIfaceNameMap.insert(nI.humanReadableName(), i); i++; } return result; diff --git a/workspace/LogReceiver/logreceiver.h b/workspace/LogReceiver/logreceiver.h index 7269823..5bd209d 100644 --- a/workspace/LogReceiver/logreceiver.h +++ b/workspace/LogReceiver/logreceiver.h @@ -36,13 +36,12 @@ private: QLocalServer *server; quint16 blockSize; QMap<int, QNetworkInterface > interfacesMap; + QMap<QString, int> indexToIfaceNameMap; QMap<QLocalSocket *, QLocalSocket *> clients; QMap<Q_PID, QProcess * > clientProcesses; QString pathToDhcpcdExe; QStringList dhcpcdArguments; - /**/ - QStringList blackList; /*gui elements*/ QMap<int , QProgressBar *> progressBars; |
