summaryrefslogblamecommitdiffstats
path: root/workspace/LogReceiver/logreceiver.h
blob: 72698232fa177b5e8887ece3cdd5bf03283d8a9f (plain) (tree)
1
2
3
4
5
6
7
8
9
10




                        




                              
















                                         

                                                                                  
                                                          





                                
                          
                                                    
                                                     



                                                 










                                                
                                                             






                                                                                
                                       


                       
#ifndef LOGRECEIVER_H
#define LOGRECEIVER_H

#include <QDialog>
#include <QtGui/QWidget>
#include <qprocess.h>
#include <qnetworkinterface.h>
#include <qprogressbar.h>
#include <qboxlayout.h>
#include <qgroupbox.h>
#include "ui_logreceiver.h"

class QLabel;
class QPushButton;
class QLocalServer;
class QLocalSocket;

class LogReceiver: public QDialog {
Q_OBJECT

public:
	LogReceiver(QWidget *parent = 0);
	~LogReceiver();

private slots:
	void handleNewConnection();
	void handleNewInput();
	void handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
	void handleProcessStarted();
	void handleProgress(int iFaceIndex, int newValue);

private:
	Ui::LogReceiverClass ui;
	QLabel *statusLabel;
	QPushButton *quitButton;
	QLocalServer *server;
	quint16 blockSize;
	QMap<int, QNetworkInterface > interfacesMap;
	QMap<QLocalSocket *, QLocalSocket *> clients;
	QMap<Q_PID, QProcess * > clientProcesses;
	QString pathToDhcpcdExe;
	QStringList dhcpcdArguments;

	/**/
    QStringList blackList;

	/*gui elements*/
	QMap<int , QProgressBar *> progressBars;
	QLabel *ndStatusLabel;
	QGroupBox *interfaceGroupBox;
	QVBoxLayout *mainLayout;
	QVBoxLayout *interfaceGroupBoxLayout;
	/**/

	void runDHCPCD(QList<QNetworkInterface> &interfaces);
	void runDHCPCD(QString interface);
	QList<QNetworkInterface> getListOfNetworkInterfaces();

	/*gui functions*/
	void buildGui();
	void createInterfaceGroupBox();
	void addInterfacesToGroupBox(QMap<int, QNetworkInterface > &interfaces);
	bool checkBlackList(QString i);
};

#endif // LOGRECEIVER_H