summaryrefslogblamecommitdiffstats
path: root/src/fbgui/ndgui.h
blob: 2e214df21cb10a18903e728398ed3f9716dc60a0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                          






                   
                  
                 

                             





                                 
                        

          

       
          




                                                                 
 

              
             



                                                   
 


                                                

 

                               
 







                                                                      
 

                   

              
                           


        
                    
 
               
 
                   
 
                
 
                            
 
                     
 
                                      
 
                                                                            
 
                              
 
                                


                 
/**
 * 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

#include <QtGui>
#include <QtWebKit>
#include <QVariant>

#include "fbgui.h"
#include "agui.h"
#include "networkdiscovery.h"


extern QString gServerIp;
extern bool gAutoUp;
extern QString gSocketServerPath;
extern QString gPathToDhcpExe;

class ndgui: public agui
{
  Q_OBJECT

public:
  ndgui();
  ~ndgui();
  Q_INVOKABLE QVariantList getManualConfInterfaces();
  Q_INVOKABLE int ip4_setManualConfiguration(QVariantMap result);
  Q_INVOKABLE QString readLogFile();
  Q_INVOKABLE QVariantMap getInterfaceConf(QString ifName);

  void init();

public slots:
  void handleConnectionEstablished(QString ifName);
  void abortBoot(QString msg);
  void chooseInterfaceDialog(QString msg);
  void handleAllProcessesFinished();

  void continueBoot(QString ifName);
  void continueBootWithoutCheck(QString ifName);
  void tryAgain();


  void startSingleShot();
  void startNetworkDiscovery();

  /*test for html gui version*/
  void attachToDOM();
  void loadJQuery();
  void addInterface(const QString &ifName);
  void updateIfStatus(const QString &ifName, const QString &status);
  void updateStatus(const QString &status);
  void updateIfProgressBar(const QString &ifName, const int& percent);
  void notifyCall(QString msg);

signals:
  void initFbgui();

private slots:
  void setUserChoiceTrue();

private:

  void addActions();

  QString _tag;

  bool _userChoice;

  bool _started;

  QAction* _allowUserChoice;

  QAction* _tryAgain;

  NetworkDiscovery* _networkDiscovery;

  QList<QString> _ifNameList;		// maps interfaceName to its gateway

  QList<QString> _manConfList;

  QString _manualConfInterfaces;
};

#endif // NDGUI_H