summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNiklas2011-11-09 15:27:51 +0100
committerNiklas2011-11-09 15:27:51 +0100
commit04fec063699f742fcd2ea552ef8c77fb402ce870 (patch)
tree1a7146b53084dc49fa742ed4ca7e318ebb4aad2b /src
parentadded some comments (diff)
downloadfbgui-04fec063699f742fcd2ea552ef8c77fb402ce870.tar.gz
fbgui-04fec063699f742fcd2ea552ef8c77fb402ce870.tar.xz
fbgui-04fec063699f742fcd2ea552ef8c77fb402ce870.zip
some documentation changes (adding comments) and doxygen files)
Diffstat (limited to 'src')
-rw-r--r--src/interfaceconfiguration.cpp13
-rw-r--r--src/interfaceconfiguration.h16
-rw-r--r--src/ndgui.cpp108
-rw-r--r--src/ndgui.h15
-rw-r--r--src/networkdiscovery.cpp13
-rw-r--r--src/networkdiscovery.h19
-rw-r--r--src/networkmanager.cpp12
-rw-r--r--src/networkmanager.h16
8 files changed, 168 insertions, 44 deletions
diff --git a/src/interfaceconfiguration.cpp b/src/interfaceconfiguration.cpp
index e1eb1d8..99f994a 100644
--- a/src/interfaceconfiguration.cpp
+++ b/src/interfaceconfiguration.cpp
@@ -1,9 +1,14 @@
-/*
- * interfaceconfiguration.cpp
+/**
+ * @class interfaceconfiguration
+ *
+ * @brief reads and stores a interface configuration.
*
- * Created on: Sep 2, 2011
- * Author: niklas
+ * reads and stores a interface configuration.
+ * the config file has already to exist. It is created by the cdhcpcd client process.
*/
+
+
+
#include "interfaceconfiguration.h"
interfaceconfiguration::interfaceconfiguration() {
diff --git a/src/interfaceconfiguration.h b/src/interfaceconfiguration.h
index 2656b3f..475f689 100644
--- a/src/interfaceconfiguration.h
+++ b/src/interfaceconfiguration.h
@@ -1,10 +1,18 @@
-/*
- * interfaceconfiguration.h
+/**
+ * Copyright (c) 2010,2011 - RZ Uni Freiburg
+ * Copyright (c) 2010,2011 - OpenSLX Project
*
- * Created on: Sep 2, 2011
- * Author: niklas
+ * This program/file is free software distributed under the GPL version 2.
+ * See http://openslx.org/COPYING
+ *
+ * If you have any feedback please consult http://openslx.org/feedback and
+ * send your feedback to feedback@openslx.org
+ *
+ * General information about OpenSLX can be found under http://openslx.org
*/
+
+
#ifndef INTERFACECONFIGURATION_H_
#define INTERFACECONFIGURATION_H_
diff --git a/src/ndgui.cpp b/src/ndgui.cpp
index 149f476..3034051 100644
--- a/src/ndgui.cpp
+++ b/src/ndgui.cpp
@@ -1,3 +1,14 @@
+/**
+ * @class ndgui
+ *
+ * @brief the GUI.
+ *
+ * This class is responsible for creating and displaying the user interface.
+ * It also connects the webView via QWebBridge to javascript functions inside the html files.
+ */
+
+
+
#include "ndgui.h"
QString gServerIp("");
@@ -7,7 +18,9 @@ QString gPathToDhcpExe("");
-/*constructor*/
+/**
+ * constructor
+ */
ndgui::ndgui(QMainWindow *parent) :
QMainWindow(parent) {
init();
@@ -15,7 +28,9 @@ ndgui::ndgui(QMainWindow *parent) :
-/*destructor*/
+/**
+ * destructor
+ */
ndgui::~ndgui() {
delete _debugConsole;
delete _toggleDebugConsole;
@@ -27,7 +42,9 @@ ndgui::~ndgui() {
-/**/
+/**
+ * @brief initialize all variables and prepare everything for a successful run
+ */
void ndgui::init() {
_tag = "[nd:ndgui]";
@@ -82,7 +99,7 @@ void ndgui::init() {
/**
- * This method sets the used Layout.
+ * @brief This method sets the used Layout.
*
* This method sets the used Layout. Possible layout are:
* - browser mode: only the browser is visible
@@ -110,7 +127,7 @@ void ndgui::setupLayout() {
/**
- * This method creates a debug console as a widget.
+ * @brief This method creates a debug console as a widget.
*
* It is basicly a QTextEdit widget as provided by QT's Framework.
* An action to toggle this widget is implemented (CTRL + D).
@@ -141,7 +158,7 @@ void ndgui::createDebugConsole() {
/**
- * This method toggles the debug console.
+ * @brief This method toggles the debug console.
*
* Toggle the visibility of the debug console if the action _toggleDebugConsole is triggered.
*
@@ -154,8 +171,9 @@ void ndgui::toggleDebugConsole() {
/**
- * creates an action which you can trigger with the F5 Button during the first
- * seconds.
+ * @brief Create actions
+ *
+ * creates an action which you can trigger with the F5 and F9 Button.
*/
void ndgui::createAction() {
_allowUserChoice = new QAction(tr("&userChoice"), this);
@@ -171,6 +189,8 @@ void ndgui::createAction() {
/**
+ * @brief set userChoice true
+ *
* is the connected to the triggered action pressing the F5 button.
* set the _userChoice member true
*/
@@ -181,6 +201,8 @@ void ndgui::setUserChoiceTrue() {
/**
+ * @brief starts a singleshot event.
+ *
* 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
@@ -196,6 +218,8 @@ void ndgui::startSingleShot() {
/**
+ * @brief start the network discovery
+ *
* main starting point of the whole procedure.
* disconnect the loadFinished signal with the startNetworkDiscovery
* and starts the networkDiscovery.
@@ -215,6 +239,8 @@ void ndgui::startNetworkDiscovery() {
/**
+ * @brief handle if a interface is able to connect
+ *
* 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
@@ -227,6 +253,8 @@ void ndgui::handleConnectionEstablished(QString ifName) {
/**
+ * @brief determines if we continue the boot sequence or if we show the chooseInterface or abortBoot dialog
+ *
* 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
@@ -266,6 +294,8 @@ void ndgui::handleAllProcessesFinished() {
/**
+ * @brief restart the system
+ *
* this method will restart the system.
* triggered through a button click in the gui.
*/
@@ -282,6 +312,8 @@ void ndgui::restartSystem() {
/**
+ * @brief shut down the system
+ *
* this method will restart the system.
* triggered through a button click in the gui.
*/
@@ -298,6 +330,8 @@ void ndgui::shutDownSystem() {
/**
+ * @brief continue the boot sequence
+ *
* represents the end of the NetworkDiscovery life time.
* will start the fbgui screen. All networkDiscovery signals
* will be ignored after this point.
@@ -317,7 +351,9 @@ void ndgui::continueBoot(QString ifName) {
-/**/
+/**
+ * @brief continue the boot sequence without further checking if the connection is still possible.
+ */
void ndgui::continueBootWithoutCheck(QString ifName) {
qxtLog->debug() << _tag << " continue with interface: " << ifName;
emit initFbgui();
@@ -327,7 +363,7 @@ void ndgui::continueBootWithoutCheck(QString ifName) {
/**
- * read the log file. Log File will be presented inside of a dialog.
+ * @brief read the log file. Log File will be presented inside of a dialog.
*/
QString ndgui::readLogFile() {
qxtLog->debug() << _tag << "show log";
@@ -336,7 +372,9 @@ QString ndgui::readLogFile() {
-/* starts the whole application again.*/
+/**
+ * @brief starts the whole application again.
+ */
void ndgui::tryAgain() {
qxtLog->debug()<< _tag << " try again ";
_networkDiscovery->prepareTryAgain();
@@ -359,7 +397,7 @@ void ndgui::tryAgain() {
/*test html gui version*/
/**
- * fills the drop down box of the manual interface configuration
+ * @brief fills the drop down box of the manual interface configuration
* dialog.
*/
QVariantList ndgui::getManualConfInterfaces() {
@@ -374,7 +412,12 @@ QVariantList ndgui::getManualConfInterfaces() {
}
-/*return a json formated interface configuration*/
+/**
+ * @brief return a json formated interface configuration
+ *
+ * @param ifName
+ * the name of the interface
+ */
QVariantMap ndgui::getInterfaceConf(QString ifName) {
return _networkDiscovery->getInterfaceConfig(ifName);
@@ -383,8 +426,11 @@ QVariantMap ndgui::getInterfaceConf(QString ifName) {
/**
- * takes the entered manual configuration dates and delivers it
+ * @brief takes the entered manual configuration dates and delivers it
* to the networkDiscovery for further actions.
+ *
+ * @param jsonArr
+ * a jsonArr which contains the manual entered interface configuration
*/
int ndgui::ip4_setManualConfiguration(QVariantMap jsonArr) {
return _networkDiscovery->ip4_setManualConfiguration(jsonArr);
@@ -399,7 +445,7 @@ int ndgui::ip4_setManualConfiguration(QVariantMap jsonArr) {
/************************************************/
/**
- * stellt ein ndgui/fbgui Objekt zur verwendung durch die html bereit.
+ * @brief stellt ein ndgui/fbgui Objekt zur verwendung durch die html bereit.
*/
void ndgui::attachToDOM(){
_webView->page()->mainFrame()->addToJavaScriptWindowObject(QString("fbgui"), this);
@@ -408,6 +454,9 @@ void ndgui::attachToDOM(){
+/**
+ * @brief load jQuery and js scripts into the page so that all javascript functions will work.
+ */
void ndgui::loadJQuery() {
QString js;
QString pathToJsDir(":/html");
@@ -437,12 +486,13 @@ void ndgui::loadJQuery() {
-//diese methoden müssen später in die javascriptInterface Klasse eingefügt werden.
-
-// dieser code muss später in die javascriptInterface klasse der fbgui eingefügt werden
-// tausche dazu ndgui zu javascriptinterface
-// und _webView->page()->mainFrame() zu _parent
+/**
+ * @brief show abortBoot dialog
+ *
+ * @param msg
+ * the message, displayed in the dialog.
+ */
void ndgui::abortBoot(const QString msg) {
QString code = QString("abortBootDialog('\%1')").arg(msg);
_webView->page()->mainFrame()->evaluateJavaScript(code);
@@ -451,7 +501,10 @@ void ndgui::abortBoot(const QString msg) {
/**
- * opens ths chooseInterfaceDialog
+ * @brief opens ths chooseInterfaceDialog
+ *
+ * @param msg
+ * the interfaces as json formated string. will be displayed in a select box.
*/
void ndgui::chooseInterfaceDialog(const QString msg) {
QString code = QString("chooseInterfaceDialog(\%1)").arg(msg);
@@ -461,7 +514,10 @@ void ndgui::chooseInterfaceDialog(const QString msg) {
/**
- * updates the over all status
+ * @brief updates the over all status
+ *
+ * @param status
+ * the new status message
*/
void ndgui::updateStatus(const QString &status) {
if (status == "")
@@ -473,7 +529,7 @@ void ndgui::updateStatus(const QString &status) {
/**
- * updates the progress bar for each interface.
+ * @brief updates the progress bar for each interface.
*
* @param ifname
* the name ot the interface to update
@@ -491,7 +547,7 @@ void ndgui::updateIfProgressBar(const QString &ifName, const int& percent) {
/**
- * update the status for each interface
+ * @brief update the status for each interface
*
* @param ifName
* the name ot the interface to update
@@ -509,7 +565,7 @@ void ndgui::updateIfStatus(const QString &ifName, const QString &status) {
/**
- * adds an interface to the DOM tree. Creates its progress bar and it's status label.
+ * @brief adds an interface to the DOM tree. Creates its progress bar and it's status label.
*
* @param ifName
* name of the new interface.
@@ -525,7 +581,7 @@ void ndgui::addInterface(const QString &ifName) {
/**
- * just for debugging.
+ * @brief just for debugging.
*/
void ndgui::notifyCall(QString msg){
qxtLog->debug() << _tag << "------ called:" << msg;
diff --git a/src/ndgui.h b/src/ndgui.h
index f6d1061..41a7bbf 100644
--- a/src/ndgui.h
+++ b/src/ndgui.h
@@ -1,3 +1,18 @@
+/**
+ * Copyright (c) 2010,2011 - RZ Uni Freiburg
+ * Copyright (c) 2010,2011 - OpenSLX Project
+ *
+ * This program/file is free software distributed under the GPL version 2.
+ * See http://openslx.org/COPYING
+ *
+ * If you have any feedback please consult http://openslx.org/feedback and
+ * send your feedback to feedback@openslx.org
+ *
+ * General information about OpenSLX can be found under http://openslx.org
+ */
+
+
+
#ifndef NDGUI_H
#define NDGUI_H
diff --git a/src/networkdiscovery.cpp b/src/networkdiscovery.cpp
index 4193286..27c3a0f 100644
--- a/src/networkdiscovery.cpp
+++ b/src/networkdiscovery.cpp
@@ -1,3 +1,16 @@
+/**
+ * @class NetworkDiscovery
+ *
+ * @brief the logic behind the NetworkDiscovery.
+ *
+ * This class holds all the logic of the NetworkDiscovery. It's main task is to search for usable
+ * interfaces, check if they are wired (in Running state) and start a cdhcpcd process for each interface.
+ * It also sends signals to the ndgui class for presenting notifications to the user.
+ *
+ */
+
+
+
#include <sys/types.h>
#include <signal.h>
diff --git a/src/networkdiscovery.h b/src/networkdiscovery.h
index 021e512..c422b18 100644
--- a/src/networkdiscovery.h
+++ b/src/networkdiscovery.h
@@ -1,3 +1,18 @@
+/**
+ * Copyright (c) 2010,2011 - RZ Uni Freiburg
+ * Copyright (c) 2010,2011 - OpenSLX Project
+ *
+ * This program/file is free software distributed under the GPL version 2.
+ * See http://openslx.org/COPYING
+ *
+ * If you have any feedback please consult http://openslx.org/feedback and
+ * send your feedback to feedback@openslx.org
+ *
+ * General information about OpenSLX can be found under http://openslx.org
+ */
+
+
+
#ifndef NetworkDiscovery_H
#define NetworkDiscovery_H
@@ -22,7 +37,7 @@
#include "../common/fbgui.h"
-//#define DEFAULT_PATHTODHCPCDEXE "/home/niklas/fbgui/customdhcpcd/src/build/cdhcpcd"
+
#define DEFAULT_PATHTODHCPCDEXE "/bin/cdhcpcd"
class NetworkDiscovery: public QObject {
@@ -50,7 +65,7 @@ public:
QVariantMap getInterfaceConfig(QString ifName);
QString GetErrorStr();
-private slots:
+public slots:
void handleNewConnection();
void handleNewInput();
void handleNewInputLine(QLocalSocket * client, QString data);
diff --git a/src/networkmanager.cpp b/src/networkmanager.cpp
index c40c83d..b0290ef 100644
--- a/src/networkmanager.cpp
+++ b/src/networkmanager.cpp
@@ -1,10 +1,14 @@
-/*
- * networkmanager.cpp
+/**
+ * @class NetworkManager
+ *
+ * @brief Manages the network configurations like setting new default routes.
*
- * Created on: Sep 5, 2011
- * Author: niklas
+ * Manages the network configurations like setting new default routes.
+ * It provides methods for ipv4 and some method for ipv6.
*/
+
+
#include "networkmanager.h"
NetworkManager::NetworkManager() {
diff --git a/src/networkmanager.h b/src/networkmanager.h
index f332f9e..fbb8993 100644
--- a/src/networkmanager.h
+++ b/src/networkmanager.h
@@ -1,10 +1,18 @@
-/*
- * networkmanager.h
+/**
+ * Copyright (c) 2010,2011 - RZ Uni Freiburg
+ * Copyright (c) 2010,2011 - OpenSLX Project
*
- * Created on: Sep 5, 2011
- * Author: niklas
+ * This program/file is free software distributed under the GPL version 2.
+ * See http://openslx.org/COPYING
+ *
+ * If you have any feedback please consult http://openslx.org/feedback and
+ * send your feedback to feedback@openslx.org
+ *
+ * General information about OpenSLX can be found under http://openslx.org
*/
+
+
#ifndef NETWORKMANAGER_H_
#define NETWORKMANAGER_H_