summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas2011-07-20 16:15:03 +0200
committerNiklas2011-07-20 16:15:03 +0200
commit39a0d42dde28ea9b45be9a47a8285c58e34799ad (patch)
treef1178d4a88c11072dc76f28995158e591147369f
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
-rwxr-xr-xworkspace/LogReceiver/LogReceiverbin55619 -> 56166 bytes
-rw-r--r--workspace/LogReceiver/logreceiver.cpp18
-rw-r--r--workspace/LogReceiver/logreceiver.h3
3 files changed, 12 insertions, 9 deletions
diff --git a/workspace/LogReceiver/LogReceiver b/workspace/LogReceiver/LogReceiver
index 282159d..13304e8 100755
--- a/workspace/LogReceiver/LogReceiver
+++ b/workspace/LogReceiver/LogReceiver
Binary files differ
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;