ndgui/NetworkDiscovery
|
00001 00016 #ifndef NDGUI_H 00017 #define NDGUI_H 00018 00019 #include <QtGui> 00020 #include <QtWebKit> 00021 #include <QVariant> 00022 00023 #include "fbgui.h" 00024 #include "loggerengine.h" 00025 #include "networkdiscovery.h" 00026 00027 00028 extern QString gServerIp; 00029 extern bool gAutoUp; 00030 extern QString gSocketServerPath; 00031 extern QString gPathToDhcpExe; 00032 00033 class ndgui: public QMainWindow { 00034 Q_OBJECT 00035 00036 public: 00037 ndgui(QMainWindow *parent = 0); 00038 ~ndgui(); 00039 Q_INVOKABLE QVariantList getManualConfInterfaces(); 00040 Q_INVOKABLE int ip4_setManualConfiguration(QVariantMap result); 00041 Q_INVOKABLE QString readLogFile(); 00042 Q_INVOKABLE QVariantMap getInterfaceConf(QString ifName); 00043 00044 public slots: 00045 void handleConnectionEstablished(QString ifName); 00046 void abortBoot(QString msg); 00047 void chooseInterfaceDialog(QString msg); 00048 void handleAllProcessesFinished(); 00049 00050 void restartSystem(); 00051 void shutDownSystem(); 00052 void continueBoot(QString ifName); 00053 void continueBootWithoutCheck(QString ifName); 00054 void tryAgain(); 00055 00056 00057 void startSingleShot(); 00058 void startNetworkDiscovery(); 00059 00060 /*test for html gui version*/ 00061 void attachToDOM(); 00062 void loadJQuery(); 00063 void addInterface(const QString &ifName); 00064 void updateIfStatus(const QString &ifName, const QString &status); 00065 void updateStatus(const QString &status); 00066 void updateIfProgressBar(const QString &ifName, const int& percent); 00067 void notifyCall(QString msg); 00068 00069 signals: 00070 void initFbgui(); 00071 00072 private slots: 00073 void setUserChoiceTrue(); 00074 00075 private: 00076 00077 QString _tag; 00078 00079 void createAction(); 00080 00081 bool _userChoice; 00082 00083 bool _started; 00084 00085 QWebView* _webView; 00086 00087 QAction* _allowUserChoice; 00088 00089 QAction* _tryAgain; 00090 00091 NetworkDiscovery* _networkDiscovery; 00092 00093 QList<QString> _ifNameList; // maps interfaceName to its gateway 00094 00095 QList<QString> _manConfList; 00096 00097 QString _manualConfInterfaces; 00098 00099 // QSplitter to split the main window in two resizable frames. 00100 QSplitter* _splitter; 00101 // QTextEdit implementing a minimalistic debug console. 00102 QTextEdit* _debugConsole; 00103 00104 // triggers toggleDebugConsole() 00105 QAction* _toggleDebugConsole; 00106 00107 void init(); 00108 void setupLayout(); 00109 void createDebugConsole(); 00110 void toggleDebugConsole(); 00111 00112 00113 }; 00114 00115 #endif // NDGUI_H