summaryrefslogtreecommitdiffstats
path: root/workspace/LogReceiver/logreceiver.cpp
diff options
context:
space:
mode:
authorNiklas2011-07-20 16:15:03 +0200
committerNiklas2011-07-20 16:15:03 +0200
commit39a0d42dde28ea9b45be9a47a8285c58e34799ad (patch)
treef1178d4a88c11072dc76f28995158e591147369f /workspace/LogReceiver/logreceiver.cpp
parentadded the blacklist function (diff)
downloadfbgui-39a0d42dde28ea9b45be9a47a8285c58e34799ad.tar.gz
fbgui-39a0d42dde28ea9b45be9a47a8285c58e34799ad.tar.xz
fbgui-39a0d42dde28ea9b45be9a47a8285c58e34799ad.zip
configuration of more than one interface is working. Both progressbars are updated. only bad thing is that it is slower than expected due to the qt gui
Diffstat (limited to 'workspace/LogReceiver/logreceiver.cpp')
-rw-r--r--workspace/LogReceiver/logreceiver.cpp18
1 files changed, 11 insertions, 7 deletions
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;