summaryrefslogtreecommitdiffstats
path: root/src/ndgui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ndgui.cpp')
-rw-r--r--src/ndgui.cpp35
1 files changed, 24 insertions, 11 deletions
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;
}