diff options
| author | Niklas | 2011-09-27 17:03:35 +0200 |
|---|---|---|
| committer | Niklas | 2011-09-27 17:03:35 +0200 |
| commit | fcb16100b5aa80934c90ddd4a386acb14317f460 (patch) | |
| tree | d8e4fc7920ba20965919b3d53c47695194b96c1f /LogReceiver/ndgui.cpp | |
| parent | added a new function for manual configuration of an interface including a fun... (diff) | |
| download | fbgui-fcb16100b5aa80934c90ddd4a386acb14317f460.tar.gz fbgui-fcb16100b5aa80934c90ddd4a386acb14317f460.tar.xz fbgui-fcb16100b5aa80934c90ddd4a386acb14317f460.zip | |
manual config gui added. put the interfaceconfig map into networkDiscovery and adopted the signals.
Diffstat (limited to 'LogReceiver/ndgui.cpp')
| -rw-r--r-- | LogReceiver/ndgui.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/LogReceiver/ndgui.cpp b/LogReceiver/ndgui.cpp index 624bbde..e3ddfd4 100644 --- a/LogReceiver/ndgui.cpp +++ b/LogReceiver/ndgui.cpp @@ -5,11 +5,11 @@ ndgui::ndgui(QMainWindow *parent) : connect(&networkDiscovery, SIGNAL(addInterface(const QString &)), this, SLOT(addInterface( const QString &))); connect(&networkDiscovery, SIGNAL(changeProgressBarValue(const QString & , const int& )), this, SLOT(updateIfProgressBar(const QString & , const int&))); - //connect(&networkDiscovery, SIGNAL(connectionEstablished(interfaceconfiguration*)), this, SLOT(handleConnectionEstablished(interfaceconfiguration*))); + connect(&networkDiscovery, SIGNAL(connectionEstablished(QString)), this, SLOT(handleConnectionEstablished(QString))); connect(&networkDiscovery, SIGNAL(abortBoot(QString)), this, SLOT(abortBoot(const QString))); connect(&networkDiscovery, SIGNAL(updateStatusLabel(QString,QString)), this, SLOT(updateIfStatus(const QString &, const QString &))); - //connect(&networkDiscovery, SIGNAL(allProcessesFinished()), this, SLOT(handleAllProcessesFinished())); - connect(&networkDiscovery, SIGNAL(continueBoot(QString, bool)), this, SLOT(continueBoot(QString, bool))); + connect(&networkDiscovery, SIGNAL(allProcessesFinished()), this, SLOT(handleAllProcessesFinished())); + connect(&networkDiscovery, SIGNAL(continueBoot(QString, int)), this, SLOT(continueBoot(QString, int))); _started = false; @@ -44,14 +44,19 @@ void ndgui::startNetworkDiscovery(){ } } -void ndgui::handleConnectionEstablished(interfaceconfiguration *ifConf) { - finalUsableIntefacesMap.insert(ifConf->getInterface(), ifConf); +void ndgui::handleConnectionEstablished(QString ifName) { + _ifNameList.append(ifName); } void ndgui::handleAllProcessesFinished() { qDebug() << "all Processes finished"; - if(finalUsableIntefacesMap.size() > 0) { - // chooseInterfaceDialog(); + if(_ifNameList.size() > 0) { + QString jsonArr = "["; + for(int i = 0; i < _ifNameList.size()-1; i++) { + jsonArr += "\"" + _ifNameList.value(i) + "\","; + } + jsonArr += "\"" + _ifNameList.last() + "\"]"; + chooseInterfaceDialog(jsonArr); } else { abortBoot("No usable interfaces found!"); } @@ -65,7 +70,7 @@ void ndgui::shutDownSystem() { } -void ndgui::continueBoot(QString ifName, bool userChoice) { +void ndgui::continueBoot(QString ifName, int userChoice) { if (!userChoice) { QString text = "continue with interface: " + ifName; qDebug() << text << "no user choice"; @@ -74,6 +79,8 @@ void ndgui::continueBoot(QString ifName, bool userChoice) { QString text = "continue with interface: " + ifName; qDebug() << text << "with user choice"; _webView->load(QUrl("qrc:html/continueBoot.html")); + QString gateway = networkDiscovery.getGatewayForInterface(ifName); + networkDiscovery.ip4_replaceDefaultRoute(ifName,gateway,0); } } @@ -132,7 +139,7 @@ void ndgui::abortBoot(const QString msg) { } void ndgui::chooseInterfaceDialog(const QString msg) { - QString code = QString("chooseInterfaceDialog('\%1')").arg(msg); + QString code = QString("chooseInterfaceDialog(\%1)").arg(msg); _webView->page()->mainFrame()->evaluateJavaScript(code); } |
