summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas2011-10-07 15:26:48 +0200
committerNiklas2011-10-07 15:26:48 +0200
commit2e39515091cd5047dddfb436c85b8991eb2415e7 (patch)
tree1be3057ecd7935725d17144b5500731d74f98bec
parenttried to exclude the javascript functions. but eigther i make something wrong... (diff)
downloadfbgui-2e39515091cd5047dddfb436c85b8991eb2415e7.tar.gz
fbgui-2e39515091cd5047dddfb436c85b8991eb2415e7.tar.xz
fbgui-2e39515091cd5047dddfb436c85b8991eb2415e7.zip
added some commtents to the ndgui
-rw-r--r--NetworkDiscovery/ndgui.cpp60
1 files changed, 58 insertions, 2 deletions
diff --git a/NetworkDiscovery/ndgui.cpp b/NetworkDiscovery/ndgui.cpp
index 6132079..bbd6798 100644
--- a/NetworkDiscovery/ndgui.cpp
+++ b/NetworkDiscovery/ndgui.cpp
@@ -18,8 +18,6 @@ ndgui::ndgui(QMainWindow *parent) :
connect(&networkDiscovery, SIGNAL(allProcessesFinished()), this, SLOT(handleAllProcessesFinished()));
connect(&networkDiscovery, SIGNAL(continueBoot(QString, int)), this, SLOT(continueBoot(QString, int)));
-
-
_webView = new QWebView(this);
connect(_webView->page()->mainFrame(), SIGNAL(
javaScriptWindowObjectCleared()), this, SLOT(attachToDOM()));
@@ -43,6 +41,10 @@ ndgui::~ndgui() {
+/**
+ * creates an action which you can trigger with the F5 Button during the first
+ * seconds.
+ */
void ndgui::createAction() {
_allowUserChoice = new QAction(tr("&quit"), this);
_allowUserChoice->setShortcut(QKeySequence(Qt::Key_F5));
@@ -52,12 +54,23 @@ void ndgui::createAction() {
+/**
+ * is the connected to the triggered action pressing the F5 button.
+ * set the _userChoice member true
+ */
void ndgui::setUserChoiceTrue() {
_userChoice = true;
}
+/**
+ * is connected to the singleShot event. Triggering this method means
+ * that we go on with the main NetworkDiscovery screen.
+ * connects the loadFinished signal of the _webView with the
+ * startNetworkDiscovery slot and removes the
+ * action.
+ */
void ndgui::prepareNetworkDiscover() {
connect(_webView, SIGNAL(loadFinished(bool)), this,
SLOT(startNetworkDiscovery()));
@@ -69,6 +82,11 @@ void ndgui::prepareNetworkDiscover() {
+/**
+ * main starting point of the whole procedure.
+ * disconnect the loadFinished signal with the startNetworkDiscovery
+ * and starts the networkDiscovery.
+ */
void ndgui::startNetworkDiscovery(){
disconnect(_webView,SIGNAL(loadFinished(bool)), this, SLOT(startNetworkDiscovery()));
@@ -83,12 +101,26 @@ void ndgui::startNetworkDiscovery(){
+/**
+ * if we have a user choice (_userChoice = true) than networkDiscovery will
+ * emit connectionEstablished signals.
+ * Add the interface name to a _ifNameList. This list holds all interfaces
+ * the user can choose out of.
+ */
void ndgui::handleConnectionEstablished(QString ifName) {
_ifNameList.append(ifName);
}
+/**
+ * if we have a user choice (_userChoice = true) than networkDiscovery will
+ * emit a allProcessesFinished signal if all processes are done.
+ * This method determines if user will see an abort boot dialog (no interface names in
+ * the ifNameList list) or an
+ * choose interface dialog (one or more interface names in the list (add with
+ * handleConnectionEstablished)).
+ */
void ndgui::handleAllProcessesFinished() {
qDebug() << _tag << "all Processes finished";
if(_ifNameList.size() > 0) {
@@ -105,18 +137,31 @@ void ndgui::handleAllProcessesFinished() {
+/**
+ * this method will restart the system.
+ * triggered through a button click in the gui.
+ */
void ndgui::restartSystem() {
}
+/**
+ * this method will restart the system.
+ * triggered through a button click in the gui.
+ */
void ndgui::shutDownSystem() {
}
+/**
+ * represents the end of the NetworkDiscovery life time.
+ * will start the fbgui screen. All networkDiscovery signals
+ * will be ignored after this point.
+ */
void ndgui::continueBoot(QString ifName, int userChoice) {
if (!userChoice) {
QString text = "continue with interface: " + ifName;
@@ -132,6 +177,9 @@ 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";
return networkDiscovery.readLogFile();
@@ -141,6 +189,10 @@ QString ndgui::readLogFile() {
/*test html gui version*/
+/**
+ * fills the drop down box of the manual interface configuration
+ * dialog.
+ */
QVariantList ndgui::getManualConfInterfaces() {
qDebug() << _tag << "call getManualConfInterfaces";
QVariantList jsonArr;
@@ -154,6 +206,10 @@ QVariantList ndgui::getManualConfInterfaces() {
+/**
+ * takes the entered manual configuration dates and delivers it
+ * to the networkDiscovery for further actions.
+ */
int ndgui::ip4_setManualConfiguration(QVariantMap jsonArr) {
return networkDiscovery.ip4_setManualConfiguration(jsonArr);