From 54e31640362a7a995dd49f100eee9550d745e58f Mon Sep 17 00:00:00 2001 From: Niklas Date: Wed, 19 Oct 2011 17:00:58 +0200 Subject: put the NetworkDiscovery code into the src folder of the fbgui. made some test, building a usb stick iso and running it on a maschine. did some bug fixes --- src/ndgui.cpp | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'src/ndgui.cpp') diff --git a/src/ndgui.cpp b/src/ndgui.cpp index 80a64bc..8daef9e 100644 --- a/src/ndgui.cpp +++ b/src/ndgui.cpp @@ -25,10 +25,12 @@ ndgui::ndgui(QMainWindow *parent) : setWindowTitle(tr("NetD")); setAttribute(Qt::WA_QuitOnClose, true); setWindowFlags(Qt::FramelessWindowHint); + showFullScreen(); _webView->load(QUrl("qrc:html/networkdiscovery_userchoice.html")); _webView->show(); - + + qxtLog->debug() << _tag << "start singel shot"; QTimer::singleShot(2000, this, SLOT(prepareNetworkDiscover())); } @@ -92,10 +94,13 @@ void ndgui::startNetworkDiscovery(){ disconnect(_webView,SIGNAL(loadFinished(bool)), this, SLOT(startNetworkDiscovery())); if(!_started) { _started = true; - networkDiscovery.initAndRun("209.85.148.105", _userChoice, true, "/var/tmp/logfile","/var/tmp/qt_c_socket_custom"); + qxtLog->debug() << _tag << "Initializing networkDiscovery ..."; + QStringList l; + l << "-d"; + networkDiscovery.initAndRun("209.85.148.105", _userChoice, true, "/tmp/fbgui.log","/var/tmp/qt_c_socket_custom", "/bin/cdhcpcd", &l); } else { - qDebug() << _tag << "NetworkDiscovery already started"; + qxtLog->debug() << _tag << "NetworkDiscovery already started"; } } @@ -122,7 +127,7 @@ void ndgui::handleConnectionEstablished(QString ifName) { * handleConnectionEstablished)). */ void ndgui::handleAllProcessesFinished() { - qDebug() << _tag << "all Processes finished"; + qxtLog->debug() << _tag << "all Processes finished"; if(_ifNameList.size() > 0) { QString jsonArr = "["; for(int i = 0; i < _ifNameList.size()-1; i++) { @@ -177,10 +182,10 @@ void ndgui::shutDownSystem() { void ndgui::continueBoot(QString ifName, int userChoice) { if (!userChoice) { QString text = "continue with interface: " + ifName; - qDebug() << _tag << text << "no user choice"; + qxtLog->debug() << _tag << text << "no user choice"; } else { QString text = "continue with interface: " + ifName; - qDebug() << _tag << text << "with user choice"; + qxtLog->debug() << _tag << text << "with user choice"; QString gateway = networkDiscovery.getGatewayForInterface(ifName); networkDiscovery.ip4_replaceDefaultRoute(ifName,gateway,0); } @@ -195,12 +200,20 @@ void ndgui::continueBoot(QString ifName, int userChoice) { * read the log file. Log File will be presented inside of a dialog. */ QString ndgui::readLogFile() { - qDebug() << _tag << "show log"; + qxtLog->debug() << _tag << "show log"; return networkDiscovery.readLogFile(); } +/**/ +void ndgui::tryAgain() { + qxtLog->debug() << _tag << "try again"; + +} + + + /*test html gui version*/ /** @@ -208,13 +221,13 @@ QString ndgui::readLogFile() { * dialog. */ QVariantList ndgui::getManualConfInterfaces() { - qDebug() << _tag << "call getManualConfInterfaces"; + qxtLog->debug() << _tag << "call getManualConfInterfaces"; QVariantList jsonArr; foreach (QString s, _manConfList) { QVariant e(s); jsonArr << e; } - qDebug() << _tag << "value of jsonArr:" << jsonArr; + qxtLog->debug() << _tag << "value of jsonArr:" << jsonArr; return jsonArr; } @@ -257,7 +270,7 @@ void ndgui::loadJQuery() { foreach(fi, fiList) { if (fi.suffix() == "js") { - //qDebug()<< fi.fileName(); + //qxtLog->debug()<< fi.fileName(); //qxtLog->debug() << fi.fileName(); //if (fi.fileName() != "test.js" && fi.fileName() != "nd-functions.js") { QFile file; @@ -366,5 +379,5 @@ void ndgui::addInterface(const QString &ifName) { * just for debugging. */ void ndgui::notifyCall(QString msg){ - qDebug() << _tag << "------ called:" << msg; + qxtLog->debug() << _tag << "------ called:" << msg; } -- cgit v1.2.3-55-g7522