From a418d8ca1e04fc4f216aa74e7827f755b02e0874 Mon Sep 17 00:00:00 2001 From: Niklas Date: Thu, 27 Oct 2011 19:58:45 +0200 Subject: disabled right click context menu, changed dialog button size (see css), changed customdhcp logger. it now sends all log messages through the socket --- src/ndgui.cpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'src/ndgui.cpp') 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."); } } -- cgit v1.2.3-55-g7522