summaryrefslogtreecommitdiffstats
path: root/src/ndgui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ndgui.cpp')
-rw-r--r--src/ndgui.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/ndgui.cpp b/src/ndgui.cpp
index 145cd78..ff372f2 100644
--- a/src/ndgui.cpp
+++ b/src/ndgui.cpp
@@ -24,7 +24,8 @@ ndgui::ndgui(QMainWindow *parent) :
connect(&networkDiscovery, SIGNAL(changeProgressBarValue(const QString & , const int& )), this, SLOT(updateIfProgressBar(const QString & , const int&)));
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(updateIfStatus(QString,QString)), this, SLOT(updateIfStatus(const QString &, const QString &)));
+ connect(&networkDiscovery, SIGNAL(updateStatus(QString)), this, SLOT(updateStatus(const QString&)));
connect(&networkDiscovery, SIGNAL(allProcessesFinished()), this, SLOT(handleAllProcessesFinished()));
connect(&networkDiscovery, SIGNAL(continueBoot(QString, int)), this, SLOT(continueBoot(QString, int)));
@@ -41,18 +42,20 @@ ndgui::ndgui(QMainWindow *parent) :
_webView->load(QUrl("qrc:html/networkdiscovery_userchoice_debug.html"));
}
else {
- _webView->load(QUrl("prc:html/networkdiscovery_userchoice.html"));
+ _webView->load(QUrl("qrc:html/networkdiscovery_userchoice.html"));
+
}
_webView->show();
qxtLog->debug() << _tag << "start singel shot";
- QTimer::singleShot(2000, this, SLOT(prepareNetworkDiscover()));
+ QTimer::singleShot(5000, this, SLOT(prepareNetworkDiscover()));
}
+/*destructor*/
ndgui::~ndgui() {
}
@@ -70,6 +73,8 @@ ndgui::~ndgui() {
void ndgui::setupLayout() {
// setup layout of the gui: debug split or browser
_webView = new QWebView(this);
+ _webView->setContextMenuPolicy(Qt::NoContextMenu); // if this does not work try Qt::CustomContextMenu
+
if (debugMode == 1) {
// split main window in browser & debug console
createDebugConsole();
@@ -77,8 +82,10 @@ void ndgui::setupLayout() {
_splitter->addWidget(_webView);
_splitter->addWidget(_debugConsole);
setCentralWidget(_splitter);
- } else
+ } else {
+ _webView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
setCentralWidget(_webView);
+ }
}
@@ -276,18 +283,25 @@ void ndgui::shutDownSystem() {
void ndgui::continueBoot(QString ifName, int userChoice) {
if (!userChoice) {
QString text = "continue with interface: " + ifName;
- qxtLog->debug() << _tag << text << "no user choice";
+ qxtLog->debug() << _tag << " " << text << "no user choice";
} else {
+ int ret = 0;
QString text = "continue with interface: " + ifName;
- qxtLog->debug() << _tag << text << "with user choice";
+ qxtLog->debug() << _tag << " " << text << " with user choice";
QString gateway = networkDiscovery.getGatewayForInterface(ifName);
- networkDiscovery.ip4_replaceDefaultRoute(ifName,gateway,0);
+ if (!gateway.isEmpty()) {
+ qxtLog->debug() << _tag << " gateway is empty. this will produce errors";
+ }
+ ret = networkDiscovery.ip4_replaceDefaultRoute(ifName,gateway,0);
+ if (0 != ret) {
+ qxtLog->debug() << _tag << " set default route failed. returned with: " << ret << " : " << strerror(-ret);
+ }
}
if (networkDiscovery.checkConnectivityViaTcp()) {
emit initFbgui();
this->close();
} else {
- abortBoot("Interface was suddenly made unusable ");
+ abortBoot("Interface was suddenly made unusable. Please check the log and try again.");
}
}