Diffstat (limited to 'noncore/settings/networksettings2/networksettings2/system.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings2/system.h | 63 |
1 files changed, 54 insertions, 9 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/system.h b/noncore/settings/networksettings2/networksettings2/system.h index 33af391..e67d695 100644 --- a/noncore/settings/networksettings2/networksettings2/system.h +++ b/noncore/settings/networksettings2/networksettings2/system.h @@ -3,2 +3,8 @@ +#include <qstring.h> + +#include <opie2/oprocess.h> + +using namespace Opie::Core; + // for hardware types @@ -9,2 +15,3 @@ +class NodeCollection; class ANetNodeInstance; @@ -12,2 +19,33 @@ class QFile; +class MyProcess : public QObject { + + Q_OBJECT + +public : + + MyProcess(); + ~MyProcess(); + + inline OProcess & process() + { return *P; } + +public slots : + + void SLOT_Stdout( Opie::Core::OProcess * P, char *, int ); + void SLOT_Stderr( Opie::Core::OProcess * P, char *, int ); + void SLOT_ProcessExited( Opie::Core::OProcess * P); + +signals : + + void stdoutLine( const QString & ); + void stderrLine( const QString & ); + void processExited( MyProcess * ); + +private : + + QString StdoutBuffer; + QString StderrBuffer; + OProcess * P; +}; + class InterfaceInfo { @@ -24,9 +62,9 @@ public : - ANetNodeInstance * assignedNode() - { return NetNode; } + NodeCollection * assignedConnection() + { return Collection; } - void assignNode( ANetNodeInstance * NNI ) - { NetNode = NNI; } + void assignConnection( NodeCollection * NNI ) + { Collection = NNI; } - ANetNodeInstance * NetNode; // netnode taking care of me + NodeCollection * Collection; // connection taking care of me QString Name; // name of interface @@ -66,6 +104,6 @@ public : // exec command as root - int runAsRoot( const QString & S ); + int runAsRoot( QStringList & S ); // exec command as user - void execAsUser( QString & Cmd, char * argv[] ); + int execAsUser( QStringList & Cmd ); @@ -77,5 +115,13 @@ public : + InterfaceInfo * findInterface( const QString & DevName ); + +private slots : + + void SLOT_ProcessExited( MyProcess * ); + signals : - void lineFromCommand( const QString & S ); + void stdoutLine( const QString & ); + void stderrLine( const QString & ); + void processEvent( const QString & ); @@ -86,3 +132,2 @@ private : QFile * ProcDevNet; - }; |