Diffstat (limited to 'noncore/settings/networksettings2/networksettings2/system.h') (more/less context) (ignore 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 @@ | |||
3 | 3 | ||
4 | #include <qstring.h> | ||
5 | |||
6 | #include <opie2/oprocess.h> | ||
7 | |||
8 | using namespace Opie::Core; | ||
9 | |||
4 | // for hardware types | 10 | // for hardware types |
@@ -9,2 +15,3 @@ | |||
9 | 15 | ||
16 | class NodeCollection; | ||
10 | class ANetNodeInstance; | 17 | class ANetNodeInstance; |
@@ -12,2 +19,33 @@ class QFile; | |||
12 | 19 | ||
20 | class MyProcess : public QObject { | ||
21 | |||
22 | Q_OBJECT | ||
23 | |||
24 | public : | ||
25 | |||
26 | MyProcess(); | ||
27 | ~MyProcess(); | ||
28 | |||
29 | inline OProcess & process() | ||
30 | { return *P; } | ||
31 | |||
32 | public slots : | ||
33 | |||
34 | void SLOT_Stdout( Opie::Core::OProcess * P, char *, int ); | ||
35 | void SLOT_Stderr( Opie::Core::OProcess * P, char *, int ); | ||
36 | void SLOT_ProcessExited( Opie::Core::OProcess * P); | ||
37 | |||
38 | signals : | ||
39 | |||
40 | void stdoutLine( const QString & ); | ||
41 | void stderrLine( const QString & ); | ||
42 | void processExited( MyProcess * ); | ||
43 | |||
44 | private : | ||
45 | |||
46 | QString StdoutBuffer; | ||
47 | QString StderrBuffer; | ||
48 | OProcess * P; | ||
49 | }; | ||
50 | |||
13 | class InterfaceInfo { | 51 | class InterfaceInfo { |
@@ -24,9 +62,9 @@ public : | |||
24 | 62 | ||
25 | ANetNodeInstance * assignedNode() | 63 | NodeCollection * assignedConnection() |
26 | { return NetNode; } | 64 | { return Collection; } |
27 | 65 | ||
28 | void assignNode( ANetNodeInstance * NNI ) | 66 | void assignConnection( NodeCollection * NNI ) |
29 | { NetNode = NNI; } | 67 | { Collection = NNI; } |
30 | 68 | ||
31 | ANetNodeInstance * NetNode; // netnode taking care of me | 69 | NodeCollection * Collection; // connection taking care of me |
32 | QString Name; // name of interface | 70 | QString Name; // name of interface |
@@ -66,6 +104,6 @@ public : | |||
66 | // exec command as root | 104 | // exec command as root |
67 | int runAsRoot( const QString & S ); | 105 | int runAsRoot( QStringList & S ); |
68 | 106 | ||
69 | // exec command as user | 107 | // exec command as user |
70 | void execAsUser( QString & Cmd, char * argv[] ); | 108 | int execAsUser( QStringList & Cmd ); |
71 | 109 | ||
@@ -77,5 +115,13 @@ public : | |||
77 | 115 | ||
116 | InterfaceInfo * findInterface( const QString & DevName ); | ||
117 | |||
118 | private slots : | ||
119 | |||
120 | void SLOT_ProcessExited( MyProcess * ); | ||
121 | |||
78 | signals : | 122 | signals : |
79 | 123 | ||
80 | void lineFromCommand( const QString & S ); | 124 | void stdoutLine( const QString & ); |
125 | void stderrLine( const QString & ); | ||
126 | void processEvent( const QString & ); | ||
81 | 127 | ||
@@ -86,3 +132,2 @@ private : | |||
86 | QFile * ProcDevNet; | 132 | QFile * ProcDevNet; |
87 | |||
88 | }; | 133 | }; |