summaryrefslogtreecommitdiffstats
path: root/src/fbgui/ndgui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fbgui/ndgui.cpp')
-rw-r--r--src/fbgui/ndgui.cpp30
1 files changed, 10 insertions, 20 deletions
diff --git a/src/fbgui/ndgui.cpp b/src/fbgui/ndgui.cpp
index ad7ff5f..c74ae82 100644
--- a/src/fbgui/ndgui.cpp
+++ b/src/fbgui/ndgui.cpp
@@ -43,9 +43,6 @@ void ndgui::init() {
setWindowTitle(tr("NetD"));
_started = false;
- _userChoice = false;
-
- addActions();
_networkDiscovery = new NetworkDiscovery();
_jsi = new JavascriptInterfaceNDGUI(_webView->page()->mainFrame(), _networkDiscovery);
@@ -62,8 +59,8 @@ void ndgui::init() {
connect(_networkDiscovery,
SIGNAL(changeProgressBarValue(const QString & , const int& )),
_jsi, SLOT(updateIfProgressBar(const QString & , const int&)));
- connect(_networkDiscovery, SIGNAL(allProcessesFinished()), this,
- SLOT(handleAllProcessesFinished()));
+ connect(_networkDiscovery, SIGNAL(allProcessesFinished(bool)), this,
+ SLOT(handleAllProcessesFinished(bool)));
connect(_jsi, SIGNAL(startFbgui(const QString&)), this,
SLOT(continueBoot(const QString&)));
connect(_networkDiscovery, SIGNAL(continueBootWithoutCheck(QString )),
@@ -79,6 +76,9 @@ void ndgui::init() {
} else {
_webView->load(QUrl("qrc:html/networkdiscovery.html"));
}
+
+ addActions();
+
showFullScreen();
}
@@ -91,7 +91,8 @@ void ndgui::init() {
void ndgui::addActions() {
_allowUserChoice = new QAction(tr("&userChoice"), this);
_allowUserChoice->setShortcut(QKeySequence(Qt::Key_F5));
- connect(_allowUserChoice, SIGNAL(triggered()), this, SLOT(setUserChoiceTrue()));
+ connect(_allowUserChoice, SIGNAL(triggered()),
+ this->_networkDiscovery, SLOT(activateUserChoice()));
this->addAction(_allowUserChoice);
_tryAgain = new QAction(tr("&tryAgain"), this);
_tryAgain->setShortcut(QKeySequence(Qt::Key_F9));
@@ -100,16 +101,6 @@ void ndgui::addActions() {
}
/**
- * @brief set userChoice true
- *
- * is the connected to the triggered action pressing the F5 button.
- * set the _userChoice member true
- */
-void ndgui::setUserChoiceTrue() {
- _userChoice = true;
-}
-
-/**
* @brief start the network discovery
*
* main starting point of the whole procedure.
@@ -119,7 +110,7 @@ void ndgui::setUserChoiceTrue() {
void ndgui::startNetworkDiscovery() {
if (!_started) {
_started = true;
- _networkDiscovery->initAndRun(_userChoice);
+ _networkDiscovery->init();
} else {
LOG4CXX_DEBUG(ndLogger, "NetworkDiscovery already started");
}
@@ -135,12 +126,12 @@ void ndgui::startNetworkDiscovery() {
* choose interface dialog (one or more interface names in the list (add with
* handleConnectionEstablished)).
*/
-void ndgui::handleAllProcessesFinished() {
+void ndgui::handleAllProcessesFinished(bool userChoice) {
LOG4CXX_DEBUG(ndLogger, "all Processes finished");
_allowUserChoice->setEnabled(false);
QList<QString> ifConnectedList = _networkDiscovery->getIfConnectedList();
if (ifConnectedList.size() > 0) {
- if (_userChoice) {
+ if (userChoice) {
_jsi->chooseInterfaceDialog(ifConnectedList);
} else {
foreach(QString i, ifConnectedList)
@@ -194,7 +185,6 @@ void ndgui::tryAgain() {
LOG4CXX_DEBUG(ndLogger, " try again ");
_networkDiscovery->prepareTryAgain();
delete _allowUserChoice;
- delete _tryAgain;
delete _networkDiscovery;
_ifNameList.clear();