summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp78
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.h44
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NN.cpp46
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NN.h29
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp162
-rw-r--r--noncore/settings/networksettings2/gprs/GPRS.pro18
-rw-r--r--noncore/settings/networksettings2/gprs/GPRSGUI.ui910
-rw-r--r--noncore/settings/networksettings2/gprs/GPRS_NN.cpp80
-rw-r--r--noncore/settings/networksettings2/gprs/GPRS_NN.h43
-rw-r--r--noncore/settings/networksettings2/gprs/GPRS_NNI.cpp231
-rw-r--r--noncore/settings/networksettings2/gprs/GPRS_NNI.h48
-rw-r--r--noncore/settings/networksettings2/gprs/GPRSdata.h24
-rw-r--r--noncore/settings/networksettings2/gprs/GPRSedit.cpp164
-rw-r--r--noncore/settings/networksettings2/gprs/GPRSedit.h20
-rw-r--r--noncore/settings/networksettings2/gprs/GPRSrun.cpp105
-rw-r--r--noncore/settings/networksettings2/gprs/GPRSrun.h34
-rw-r--r--noncore/settings/networksettings2/gprs/config.in4
-rw-r--r--noncore/settings/networksettings2/gprs/opie-networksettings2plugin-network.control9
-rw-r--r--noncore/settings/networksettings2/opie-networksettings2.control10
-rwxr-xr-xnoncore/settings/networksettings2/opie-networksettings2.postinst9
-rw-r--r--noncore/settings/networksettings2/ppp/PPPDialingedit.cpp25
-rw-r--r--noncore/settings/networksettings2/ppp/PPPDialingedit.h16
-rw-r--r--noncore/settings/networksettings2/ppp/PPPRunGUI.ui207
-rw-r--r--noncore/settings/networksettings2/ppp/PPPRunedit.cpp31
-rw-r--r--noncore/settings/networksettings2/ppp/PPPRunedit.h16
25 files changed, 2363 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp
new file mode 100644
index 0000000..ee3e92b
--- a/dev/null
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.cpp
@@ -0,0 +1,78 @@
1#include "bluetoothBNEP_NN.h"
2#include "bluetoothBNEP_NNI.h"
3#include "bluetoothRFCOMM_NNI.h"
4
5//
6//
7// BLUETOOTH PAN/NAP node
8//
9//
10
11static const char * BluetoothBNEPNeeds[] =
12 { 0
13 };
14
15static const char * BluetoothBNEPProvides[] =
16 { "device",
17 0
18 };
19
20/**
21 * Constructor, find all of the possible interfaces
22 */
23BluetoothBNEPNetNode::BluetoothBNEPNetNode() :
24 ANetNode(tr("Bluetooth PAN/NAP")) {
25 InstanceCount = 7; // default
26}
27
28/**
29 * Delete any interfaces that we own.
30 */
31BluetoothBNEPNetNode::~BluetoothBNEPNetNode(){
32}
33
34const QString BluetoothBNEPNetNode::nodeDescription(){
35 return tr("\
36<p>Sets up a bluetooth link using the bluetooth Network profile.</p>\
37<p>Use this to connect two computing devices.</p>\
38"
39);
40}
41
42ANetNodeInstance * BluetoothBNEPNetNode::createInstance( void ) {
43 return new ABluetoothBNEP( this );
44}
45
46const char ** BluetoothBNEPNetNode::needs( void ) {
47 return BluetoothBNEPNeeds;
48}
49
50const char ** BluetoothBNEPNetNode::provides( void ) {
51 return BluetoothBNEPProvides;
52}
53
54QString BluetoothBNEPNetNode::genNic( long nr ) {
55 QString S;
56 return S.sprintf( "bnep%ld", nr );
57}
58
59
60void BluetoothBNEPNetNode::setSpecificAttribute( QString & A, QString & V ) {
61 if( A == "interfacecount" ) {
62 InstanceCount = V.toLong();
63 }
64}
65
66void BluetoothBNEPNetNode::saveSpecificAttribute( QTextStream & TS) {
67 TS << "interfacecount="
68 << InstanceCount
69 << endl;
70}
71
72extern "C" {
73// create plugin registers both BT functions
74void create_plugin( QList<ANetNode> & PNN ) {
75 PNN.append( new BluetoothBNEPNetNode() );
76 PNN.append( new BluetoothRFCOMMNetNode() );
77}
78}
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.h
new file mode 100644
index 0000000..5057e6d
--- a/dev/null
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NN.h
@@ -0,0 +1,44 @@
1#ifndef BLUETOOTHBNEP_NETNODE_H
2#define BLUETOOTHBNEP_NETNODE_H
3
4#include "netnode.h"
5#include "bluetoothRFCOMM_NN.h"
6
7class ABluetoothBNEP;
8
9class BluetoothBNEPNetNode : public ANetNode {
10
11 Q_OBJECT
12
13public:
14
15 BluetoothBNEPNetNode();
16 virtual ~BluetoothBNEPNetNode();
17
18 virtual QString genNic( long );
19 virtual long instanceCount( void )
20 { return InstanceCount; }
21 virtual const QString pixmapName()
22 { return "Devices/bluetooth"; }
23
24 virtual const QString nodeDescription() ;
25 virtual ANetNodeInstance * createInstance( void );
26 virtual const char ** provides( void );
27 virtual const char ** needs( void );
28
29private:
30
31 virtual void setSpecificAttribute( QString & Attr, QString & Value );
32 virtual void saveSpecificAttribute( QTextStream & TS );
33
34 // number of interfaces for this device
35 long InstanceCount;
36
37};
38
39extern "C"
40{
41 void create_plugin( QList<ANetNode> & PNN );
42};
43
44#endif
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NN.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NN.cpp
new file mode 100644
index 0000000..2b17ab5
--- a/dev/null
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NN.cpp
@@ -0,0 +1,46 @@
1#include "bluetoothRFCOMM_NN.h"
2#include "bluetoothRFCOMM_NNI.h"
3
4static const char * BluetoothRFCOMMNeeds[] =
5 { 0
6 };
7
8static const char * BluetoothRFCOMMProvides[] =
9 { "line",
10 "GPRS"
11 };
12
13BluetoothRFCOMMNetNode::BluetoothRFCOMMNetNode() :
14 ANetNode( tr("Bluetooth serial link") ) {
15}
16
17BluetoothRFCOMMNetNode::~BluetoothRFCOMMNetNode(){
18}
19
20const QString BluetoothRFCOMMNetNode::nodeDescription(){
21 return tr("\
22<p>Sets up a bluetooth link using the bluetooth serial profile.</p>\
23<p>Use this to connect to a GSM.</p>\
24"
25);
26}
27
28ANetNodeInstance * BluetoothRFCOMMNetNode::createInstance( void ) {
29 return new ABluetoothRFCOMM( this );
30}
31
32const char ** BluetoothRFCOMMNetNode::needs( void ) {
33 return BluetoothRFCOMMNeeds;
34}
35
36const char ** BluetoothRFCOMMNetNode::provides( void ) {
37 return BluetoothRFCOMMProvides;
38}
39
40void BluetoothRFCOMMNetNode::setSpecificAttribute( QString &, QString & ) {
41}
42
43void BluetoothRFCOMMNetNode::saveSpecificAttribute( QTextStream & ) {
44}
45
46// create plugin -> see BNEP
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NN.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NN.h
new file mode 100644
index 0000000..cc7037a
--- a/dev/null
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NN.h
@@ -0,0 +1,29 @@
1#ifndef BLUETOOTHRFCOMM_NETNODE_H
2#define BLUETOOTHRFCOMM_NETNODE_H
3
4#include "netnode.h"
5
6class BluetoothRFCOMMNetNode : public ANetNode {
7
8 Q_OBJECT
9
10public:
11
12 BluetoothRFCOMMNetNode();
13 virtual ~BluetoothRFCOMMNetNode();
14
15 virtual const QString pixmapName()
16 { return "Devices/bluetooth"; }
17
18 virtual const QString nodeDescription() ;
19 virtual ANetNodeInstance * createInstance( void );
20 virtual const char ** needs( void );
21 virtual const char ** provides( void );
22
23private:
24
25 virtual void setSpecificAttribute( QString & Attr, QString & Value );
26 virtual void saveSpecificAttribute( QTextStream & TS );
27};
28
29#endif
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp
new file mode 100644
index 0000000..1e91ed1
--- a/dev/null
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp
@@ -0,0 +1,162 @@
1#include <qapplication.h>
2#include <resources.h>
3#include <OTDevice.h>
4#include <OTGateway.h>
5#include "bluetoothRFCOMMrun.h"
6
7using namespace Opietooth2;
8
9BluetoothRFCOMMRun::~BluetoothRFCOMMRun( void ) {
10 if( OT ) {
11 OTGateway::releaseOTGateway();
12 }
13}
14
15State_t BluetoothRFCOMMRun::detectState( void ) {
16
17 if( ! OT ) {
18 OT = OTGateway::getOTGateway();
19 }
20
21 if( deviceNrOfConnection() >= 0 ) {
22 return Available;
23 }
24
25 owarn << "Bluetooth "
26 << OT->isEnabled()
27 << oendl;
28
29 return ( OT->isEnabled() ) ? Off : Unavailable;
30}
31
32QString BluetoothRFCOMMRun::setMyState( NodeCollection *,
33 Action_t A,
34 bool ) {
35
36 if( OT ) {
37 OTGateway::getOTGateway();
38 }
39
40 if( A == Activate ) {
41 // from OFF to Available
42 RFCOMMChannel * Ch = getChannel( );
43 System & Sys = NSResources->system();
44
45 if( Ch ) {
46 // connect to this peer
47 DeviceNr = OT->getFreeRFCommDevice();
48 QStringList S;
49
50 S << "rfcomm"
51 << "bind"
52 << QString().setNum( DeviceNr )
53 << Ch->BDAddress
54 << QString().setNum( Ch->Channel );
55
56 if( Sys.runAsRoot( S ) ) {
57 return QString( "Error starting %1").arg(S.join(" "));
58 }
59
60 // here rfcomm should be running -> we will detect state later
61 return QString();
62 } else {
63 Log(( "No channel selected -> cancel\n" ));
64 return QString( "No channel selected. Operation cancelled" );
65 }
66 }
67
68 if( A == Deactivate ) {
69 if( DeviceNr >= 0 ) {
70 if( OT->releaseRFCommDevice( DeviceNr ) ) {
71 return QString( "Cannot release RFCOMM connection" );
72 }
73 DeviceNr = -1;
74 }
75 }
76 return QString();
77}
78
79#include <qlistbox.h>
80#include <qframe.h>
81#include <qlabel.h>
82#include <qlayout.h>
83#include <qdialog.h>
84
85RFCOMMChannel * BluetoothRFCOMMRun::getChannel( void ) {
86
87 if( Data->Devices.count() == 1 ) {
88 // only one device -> return channel
89 return Data->Devices[0];
90 }
91
92 RFCOMMChannel * Ch = 0;
93 QDialog * Dlg = new QDialog( qApp->mainWidget(), 0, TRUE );
94 QVBoxLayout * V = new QVBoxLayout( Dlg );
95
96 QLabel * L = new QLabel(
97 qApp->translate( "BluetoothRFCOMMRun",
98 "Select device to connect to"),
99 Dlg );
100 QListBox * LB = new QListBox( Dlg );
101
102 for( unsigned int i = 0; i < Data->Devices.count(); i ++ ) {
103 LB->insertItem( QString( "%1 (%2 Chnl %3)" ).
104 arg( Data->Devices[i]->Name ).
105 arg( Data->Devices[i]->BDAddress ).
106 arg( Data->Devices[i]->Channel ) );
107 }
108
109 V->addWidget( L );
110 V->addWidget( LB );
111
112 Dlg->resize( 100, 100 );
113 Dlg->move( 20,
114 (qApp->desktop()->height()-100)/2 );
115
116 if( Dlg->exec() == QDialog::Accepted ) {
117 unsigned int i = 0;
118 for( i = 0; i < Data->Devices.count(); i ++ ) {
119 if( LB->isSelected(i) ) {
120 owarn << "Selected " << Data->Devices[i]->Name << oendl;
121 Ch = Data->Devices[i];
122 break;
123 }
124 }
125 }
126
127 delete Dlg;
128 return Ch;
129}
130
131QString BluetoothRFCOMMRun::deviceFile( void ) {
132 if( deviceNrOfConnection() >= 0 ) {
133 OTDevice * OTD = OT->getOTDevice();
134 // there is a connection
135 return OTD->getRFCommDevicePattern().arg(DeviceNr);
136 }
137 return QString();
138}
139
140int BluetoothRFCOMMRun::deviceNrOfConnection( void ) {
141
142 if( ! OT ) {
143 OT = OTGateway::getOTGateway();
144 }
145
146 DeviceNr = -1;
147 for( unsigned int i = 0; i < Data->Devices.count(); i ++ ) {
148 owarn << "Check for rfcomm on "
149 << Data->Devices[i]->BDAddress
150 << " "
151 << Data->Devices[i]->Channel
152 << oendl;
153 if( ( DeviceNr = OT->connectedToRFCommChannel(
154 OTDeviceAddress( Data->Devices[i]->BDAddress ),
155 Data->Devices[i]->Channel ) ) >= 0 ) {
156 owarn << "Up "
157 << oendl;
158 break;
159 }
160 }
161 return DeviceNr;
162}
diff --git a/noncore/settings/networksettings2/gprs/GPRS.pro b/noncore/settings/networksettings2/gprs/GPRS.pro
new file mode 100644
index 0000000..7818415
--- a/dev/null
+++ b/noncore/settings/networksettings2/gprs/GPRS.pro
@@ -0,0 +1,18 @@
1TEMPLATE = lib
2CONFIG += qt warn_on release
3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = GPRS_NN.h \
5 GPRS_NNI.h \
6 GPRSedit.h
7 SOURCES = GPRS_NN.cpp \
8 GPRS_NNI.cpp \
9 GPRSedit.cpp \
10 GPRSrun.cpp
11 INCLUDEPATH+= $(OPIEDIR)/include ../ ../networksettings2
12 DEPENDPATH+= $(OPIEDIR)/include ../ ../networksettings2
13LIBS += -lqpe
14 INTERFACES= GPRSGUI.ui
15 TARGET = GPRS
16 VERSION = 1.0.0
17
18include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/networksettings2/gprs/GPRSGUI.ui b/noncore/settings/networksettings2/gprs/GPRSGUI.ui
new file mode 100644
index 0000000..1ba5971
--- a/dev/null
+++ b/noncore/settings/networksettings2/gprs/GPRSGUI.ui
@@ -0,0 +1,910 @@
1<!DOCTYPE UI><UI>
2<class>GPRSGUI</class>
3<widget>
4 <class>QWidget</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>GPRSGUI</cstring>
8 </property>
9 <property stdset="1">
10 <name>geometry</name>
11 <rect>
12 <x>0</x>
13 <y>0</y>
14 <width>326</width>
15 <height>418</height>
16 </rect>
17 </property>
18 <property stdset="1">
19 <name>caption</name>
20 <string>GPRS Configuration</string>
21 </property>
22 <property>
23 <name>layoutMargin</name>
24 </property>
25 <property>
26 <name>layoutSpacing</name>
27 </property>
28 <vbox>
29 <property stdset="1">
30 <name>margin</name>
31 <number>0</number>
32 </property>
33 <property stdset="1">
34 <name>spacing</name>
35 <number>0</number>
36 </property>
37 <widget>
38 <class>QTabWidget</class>
39 <property stdset="1">
40 <name>name</name>
41 <cstring>TabWidget2</cstring>
42 </property>
43 <property>
44 <name>layoutMargin</name>
45 </property>
46 <property>
47 <name>layoutSpacing</name>
48 </property>
49 <widget>
50 <class>QWidget</class>
51 <property stdset="1">
52 <name>name</name>
53 <cstring>tab</cstring>
54 </property>
55 <attribute>
56 <name>title</name>
57 <string>Login</string>
58 </attribute>
59 <vbox>
60 <property stdset="1">
61 <name>margin</name>
62 <number>3</number>
63 </property>
64 <property stdset="1">
65 <name>spacing</name>
66 <number>3</number>
67 </property>
68 <widget>
69 <class>QLayoutWidget</class>
70 <property stdset="1">
71 <name>name</name>
72 <cstring>Layout10</cstring>
73 </property>
74 <grid>
75 <property stdset="1">
76 <name>margin</name>
77 <number>0</number>
78 </property>
79 <property stdset="1">
80 <name>spacing</name>
81 <number>6</number>
82 </property>
83 <widget row="1" column="1" >
84 <class>QLineEdit</class>
85 <property stdset="1">
86 <name>name</name>
87 <cstring>User_LE</cstring>
88 </property>
89 </widget>
90 <widget row="1" column="0" >
91 <class>QLabel</class>
92 <property stdset="1">
93 <name>name</name>
94 <cstring>TextLabel1_3_2</cstring>
95 </property>
96 <property stdset="1">
97 <name>text</name>
98 <string>User</string>
99 </property>
100 </widget>
101 <widget row="2" column="1" >
102 <class>QLineEdit</class>
103 <property stdset="1">
104 <name>name</name>
105 <cstring>Password_LE</cstring>
106 </property>
107 </widget>
108 <widget row="0" column="0" >
109 <class>QLabel</class>
110 <property stdset="1">
111 <name>name</name>
112 <cstring>TextLabel1_3</cstring>
113 </property>
114 <property stdset="1">
115 <name>text</name>
116 <string>APN</string>
117 </property>
118 </widget>
119 <widget row="2" column="0" >
120 <class>QLabel</class>
121 <property stdset="1">
122 <name>name</name>
123 <cstring>TextLabel1_3_3</cstring>
124 </property>
125 <property stdset="1">
126 <name>text</name>
127 <string>Password</string>
128 </property>
129 <property stdset="1">
130 <name>alignment</name>
131 <set>AlignVCenter|AlignLeft</set>
132 </property>
133 <property>
134 <name>wordwrap</name>
135 </property>
136 </widget>
137 <widget row="0" column="1" >
138 <class>QLineEdit</class>
139 <property stdset="1">
140 <name>name</name>
141 <cstring>APN_LE</cstring>
142 </property>
143 </widget>
144 </grid>
145 </widget>
146 <spacer>
147 <property>
148 <name>name</name>
149 <cstring>Spacer9</cstring>
150 </property>
151 <property stdset="1">
152 <name>orientation</name>
153 <enum>Vertical</enum>
154 </property>
155 <property stdset="1">
156 <name>sizeType</name>
157 <enum>Expanding</enum>
158 </property>
159 <property>
160 <name>sizeHint</name>
161 <size>
162 <width>20</width>
163 <height>20</height>
164 </size>
165 </property>
166 </spacer>
167 </vbox>
168 </widget>
169 <widget>
170 <class>QWidget</class>
171 <property stdset="1">
172 <name>name</name>
173 <cstring>tab</cstring>
174 </property>
175 <attribute>
176 <name>title</name>
177 <string>DNS</string>
178 </attribute>
179 <vbox>
180 <property stdset="1">
181 <name>margin</name>
182 <number>3</number>
183 </property>
184 <property stdset="1">
185 <name>spacing</name>
186 <number>3</number>
187 </property>
188 <widget>
189 <class>QCheckBox</class>
190 <property stdset="1">
191 <name>name</name>
192 <cstring>AssignedByServer_CB</cstring>
193 </property>
194 <property stdset="1">
195 <name>text</name>
196 <string>As assigned by server</string>
197 </property>
198 <property stdset="1">
199 <name>checked</name>
200 <bool>true</bool>
201 </property>
202 </widget>
203 <widget>
204 <class>QLayoutWidget</class>
205 <property stdset="1">
206 <name>name</name>
207 <cstring>Layout10</cstring>
208 </property>
209 <property>
210 <name>layoutSpacing</name>
211 </property>
212 <hbox>
213 <property stdset="1">
214 <name>margin</name>
215 <number>0</number>
216 </property>
217 <property stdset="1">
218 <name>spacing</name>
219 <number>0</number>
220 </property>
221 <spacer>
222 <property>
223 <name>name</name>
224 <cstring>Spacer14</cstring>
225 </property>
226 <property stdset="1">
227 <name>orientation</name>
228 <enum>Horizontal</enum>
229 </property>
230 <property stdset="1">
231 <name>sizeType</name>
232 <enum>Fixed</enum>
233 </property>
234 <property>
235 <name>sizeHint</name>
236 <size>
237 <width>20</width>
238 <height>20</height>
239 </size>
240 </property>
241 </spacer>
242 <widget>
243 <class>QFrame</class>
244 <property stdset="1">
245 <name>name</name>
246 <cstring>Frame5</cstring>
247 </property>
248 <property stdset="1">
249 <name>enabled</name>
250 <bool>false</bool>
251 </property>
252 <property stdset="1">
253 <name>frameShape</name>
254 <enum>NoFrame</enum>
255 </property>
256 <property stdset="1">
257 <name>frameShadow</name>
258 <enum>Raised</enum>
259 </property>
260 <property>
261 <name>layoutMargin</name>
262 </property>
263 <property>
264 <name>layoutSpacing</name>
265 </property>
266 <grid>
267 <property stdset="1">
268 <name>margin</name>
269 <number>0</number>
270 </property>
271 <property stdset="1">
272 <name>spacing</name>
273 <number>2</number>
274 </property>
275 <widget row="1" column="1" >
276 <class>QLineEdit</class>
277 <property stdset="1">
278 <name>name</name>
279 <cstring>DNS2_LE</cstring>
280 </property>
281 <property stdset="1">
282 <name>sizePolicy</name>
283 <sizepolicy>
284 <hsizetype>1</hsizetype>
285 <vsizetype>0</vsizetype>
286 </sizepolicy>
287 </property>
288 </widget>
289 <widget row="1" column="0" >
290 <class>QLabel</class>
291 <property stdset="1">
292 <name>name</name>
293 <cstring>TextLabel1_2</cstring>
294 </property>
295 <property stdset="1">
296 <name>text</name>
297 <string>DNS2</string>
298 </property>
299 </widget>
300 <widget row="0" column="0" >
301 <class>QLabel</class>
302 <property stdset="1">
303 <name>name</name>
304 <cstring>TextLabel1</cstring>
305 </property>
306 <property stdset="1">
307 <name>text</name>
308 <string>DNS1</string>
309 </property>
310 </widget>
311 <widget row="0" column="1" >
312 <class>QLineEdit</class>
313 <property stdset="1">
314 <name>name</name>
315 <cstring>DNS1_LE</cstring>
316 </property>
317 <property stdset="1">
318 <name>sizePolicy</name>
319 <sizepolicy>
320 <hsizetype>1</hsizetype>
321 <vsizetype>0</vsizetype>
322 </sizepolicy>
323 </property>
324 </widget>
325 </grid>
326 </widget>
327 <spacer>
328 <property>
329 <name>name</name>
330 <cstring>Spacer13</cstring>
331 </property>
332 <property stdset="1">
333 <name>orientation</name>
334 <enum>Horizontal</enum>
335 </property>
336 <property stdset="1">
337 <name>sizeType</name>
338 <enum>Expanding</enum>
339 </property>
340 <property>
341 <name>sizeHint</name>
342 <size>
343 <width>20</width>
344 <height>20</height>
345 </size>
346 </property>
347 </spacer>
348 </hbox>
349 </widget>
350 <spacer>
351 <property>
352 <name>name</name>
353 <cstring>Spacer15</cstring>
354 </property>
355 <property stdset="1">
356 <name>orientation</name>
357 <enum>Vertical</enum>
358 </property>
359 <property stdset="1">
360 <name>sizeType</name>
361 <enum>Expanding</enum>
362 </property>
363 <property>
364 <name>sizeHint</name>
365 <size>
366 <width>20</width>
367 <height>20</height>
368 </size>
369 </property>
370 </spacer>
371 </vbox>
372 </widget>
373 <widget>
374 <class>QWidget</class>
375 <property stdset="1">
376 <name>name</name>
377 <cstring>tab</cstring>
378 </property>
379 <attribute>
380 <name>title</name>
381 <string>Routing</string>
382 </attribute>
383 <vbox>
384 <property stdset="1">
385 <name>margin</name>
386 <number>3</number>
387 </property>
388 <property stdset="1">
389 <name>spacing</name>
390 <number>0</number>
391 </property>
392 <widget>
393 <class>QButtonGroup</class>
394 <property stdset="1">
395 <name>name</name>
396 <cstring>ButtonGroup1</cstring>
397 </property>
398 <property stdset="1">
399 <name>frameShape</name>
400 <enum>NoFrame</enum>
401 </property>
402 <property stdset="1">
403 <name>title</name>
404 <string></string>
405 </property>
406 <property>
407 <name>layoutMargin</name>
408 </property>
409 <property>
410 <name>layoutSpacing</name>
411 </property>
412 <vbox>
413 <property stdset="1">
414 <name>margin</name>
415 <number>0</number>
416 </property>
417 <property stdset="1">
418 <name>spacing</name>
419 <number>-3</number>
420 </property>
421 <widget>
422 <class>QRadioButton</class>
423 <property stdset="1">
424 <name>name</name>
425 <cstring>DefaultGateway_RB</cstring>
426 </property>
427 <property stdset="1">
428 <name>text</name>
429 <string>Set as default gateway</string>
430 </property>
431 <property stdset="1">
432 <name>checked</name>
433 <bool>true</bool>
434 </property>
435 </widget>
436 <widget>
437 <class>QLayoutWidget</class>
438 <property stdset="1">
439 <name>name</name>
440 <cstring>Layout13</cstring>
441 </property>
442 <property>
443 <name>layoutSpacing</name>
444 </property>
445 <hbox>
446 <property stdset="1">
447 <name>margin</name>
448 <number>0</number>
449 </property>
450 <property stdset="1">
451 <name>spacing</name>
452 <number>0</number>
453 </property>
454 <spacer>
455 <property>
456 <name>name</name>
457 <cstring>Spacer8</cstring>
458 </property>
459 <property stdset="1">
460 <name>orientation</name>
461 <enum>Horizontal</enum>
462 </property>
463 <property stdset="1">
464 <name>sizeType</name>
465 <enum>Fixed</enum>
466 </property>
467 <property>
468 <name>sizeHint</name>
469 <size>
470 <width>20</width>
471 <height>20</height>
472 </size>
473 </property>
474 </spacer>
475 <widget>
476 <class>QCheckBox</class>
477 <property stdset="1">
478 <name>name</name>
479 <cstring>SetIfSet_CB</cstring>
480 </property>
481 <property stdset="1">
482 <name>enabled</name>
483 <bool>true</bool>
484 </property>
485 <property stdset="1">
486 <name>text</name>
487 <string>Set even if Set</string>
488 </property>
489 </widget>
490 <spacer>
491 <property>
492 <name>name</name>
493 <cstring>Spacer17</cstring>
494 </property>
495 <property stdset="1">
496 <name>orientation</name>
497 <enum>Horizontal</enum>
498 </property>
499 <property stdset="1">
500 <name>sizeType</name>
501 <enum>Expanding</enum>
502 </property>
503 <property>
504 <name>sizeHint</name>
505 <size>
506 <width>20</width>
507 <height>20</height>
508 </size>
509 </property>
510 </spacer>
511 </hbox>
512 </widget>
513 <widget>
514 <class>QRadioButton</class>
515 <property stdset="1">
516 <name>name</name>
517 <cstring>FixedGateway_RB</cstring>
518 </property>
519 <property stdset="1">
520 <name>text</name>
521 <string>Fixed Routing</string>
522 </property>
523 </widget>
524 <widget>
525 <class>QLayoutWidget</class>
526 <property stdset="1">
527 <name>name</name>
528 <cstring>Layout11</cstring>
529 </property>
530 <hbox>
531 <property stdset="1">
532 <name>margin</name>
533 <number>0</number>
534 </property>
535 <property stdset="1">
536 <name>spacing</name>
537 <number>6</number>
538 </property>
539 <spacer>
540 <property>
541 <name>name</name>
542 <cstring>Spacer8_2</cstring>
543 </property>
544 <property stdset="1">
545 <name>orientation</name>
546 <enum>Horizontal</enum>
547 </property>
548 <property stdset="1">
549 <name>sizeType</name>
550 <enum>Fixed</enum>
551 </property>
552 <property>
553 <name>sizeHint</name>
554 <size>
555 <width>20</width>
556 <height>20</height>
557 </size>
558 </property>
559 </spacer>
560 <widget>
561 <class>QFrame</class>
562 <property stdset="1">
563 <name>name</name>
564 <cstring>Frame3</cstring>
565 </property>
566 <property stdset="1">
567 <name>enabled</name>
568 <bool>false</bool>
569 </property>
570 <property stdset="1">
571 <name>sizePolicy</name>
572 <sizepolicy>
573 <hsizetype>7</hsizetype>
574 <vsizetype>5</vsizetype>
575 </sizepolicy>
576 </property>
577 <property stdset="1">
578 <name>frameShape</name>
579 <enum>NoFrame</enum>
580 </property>
581 <property stdset="1">
582 <name>frameShadow</name>
583 <enum>Raised</enum>
584 </property>
585 <property>
586 <name>layoutMargin</name>
587 </property>
588 <property>
589 <name>layoutSpacing</name>
590 </property>
591 <vbox>
592 <property stdset="1">
593 <name>margin</name>
594 <number>3</number>
595 </property>
596 <property stdset="1">
597 <name>spacing</name>
598 <number>3</number>
599 </property>
600 <widget>
601 <class>QLayoutWidget</class>
602 <property stdset="1">
603 <name>name</name>
604 <cstring>Layout10</cstring>
605 </property>
606 <property>
607 <name>layoutSpacing</name>
608 </property>
609 <grid>
610 <property stdset="1">
611 <name>margin</name>
612 <number>0</number>
613 </property>
614 <property stdset="1">
615 <name>spacing</name>
616 <number>3</number>
617 </property>
618 <widget row="0" column="1" rowspan="1" colspan="3" >
619 <class>QLineEdit</class>
620 <property stdset="1">
621 <name>name</name>
622 <cstring>Net_LE</cstring>
623 </property>
624 </widget>
625 <widget row="1" column="1" >
626 <class>QSpinBox</class>
627 <property stdset="1">
628 <name>name</name>
629 <cstring>Mask_SB</cstring>
630 </property>
631 <property stdset="1">
632 <name>sizePolicy</name>
633 <sizepolicy>
634 <hsizetype>7</hsizetype>
635 <vsizetype>0</vsizetype>
636 </sizepolicy>
637 </property>
638 <property stdset="1">
639 <name>maximumSize</name>
640 <size>
641 <width>32767</width>
642 <height>32767</height>
643 </size>
644 </property>
645 <property stdset="1">
646 <name>maxValue</name>
647 <number>32</number>
648 </property>
649 <property stdset="1">
650 <name>minValue</name>
651 <number>1</number>
652 </property>
653 <property stdset="1">
654 <name>value</name>
655 <number>24</number>
656 </property>
657 </widget>
658 <widget row="1" column="0" >
659 <class>QLabel</class>
660 <property stdset="1">
661 <name>name</name>
662 <cstring>TextLabel1_6</cstring>
663 </property>
664 <property stdset="1">
665 <name>text</name>
666 <string>Mask</string>
667 </property>
668 </widget>
669 <widget row="1" column="3" >
670 <class>QToolButton</class>
671 <property stdset="1">
672 <name>name</name>
673 <cstring>Delete_TB</cstring>
674 </property>
675 <property stdset="1">
676 <name>text</name>
677 <string>...</string>
678 </property>
679 </widget>
680 <widget row="0" column="0" >
681 <class>QLabel</class>
682 <property stdset="1">
683 <name>name</name>
684 <cstring>TextLabel1_5_2</cstring>
685 </property>
686 <property stdset="1">
687 <name>text</name>
688 <string>Net</string>
689 </property>
690 </widget>
691 <widget row="1" column="2" >
692 <class>QToolButton</class>
693 <property stdset="1">
694 <name>name</name>
695 <cstring>Add_TB</cstring>
696 </property>
697 <property stdset="1">
698 <name>text</name>
699 <string>...</string>
700 </property>
701 </widget>
702 </grid>
703 </widget>
704 <widget>
705 <class>QListView</class>
706 <column>
707 <property>
708 <name>text</name>
709 <string>Network</string>
710 </property>
711 <property>
712 <name>clickable</name>
713 <bool>true</bool>
714 </property>
715 <property>
716 <name>resizeable</name>
717 <bool>true</bool>
718 </property>
719 </column>
720 <column>
721 <property>
722 <name>text</name>
723 <string>Mask</string>
724 </property>
725 <property>
726 <name>clickable</name>
727 <bool>true</bool>
728 </property>
729 <property>
730 <name>resizeable</name>
731 <bool>true</bool>
732 </property>
733 </column>
734 <property stdset="1">
735 <name>name</name>
736 <cstring>Routing_LV</cstring>
737 </property>
738 <property stdset="1">
739 <name>selectionMode</name>
740 <enum>Extended</enum>
741 </property>
742 <property stdset="1">
743 <name>allColumnsShowFocus</name>
744 <bool>true</bool>
745 </property>
746 </widget>
747 </vbox>
748 </widget>
749 </hbox>
750 </widget>
751 </vbox>
752 </widget>
753 </vbox>
754 </widget>
755 <widget>
756 <class>QWidget</class>
757 <property stdset="1">
758 <name>name</name>
759 <cstring>tab</cstring>
760 </property>
761 <attribute>
762 <name>title</name>
763 <string>Misc</string>
764 </attribute>
765 <vbox>
766 <property stdset="1">
767 <name>margin</name>
768 <number>3</number>
769 </property>
770 <property stdset="1">
771 <name>spacing</name>
772 <number>3</number>
773 </property>
774 <widget>
775 <class>QLayoutWidget</class>
776 <property stdset="1">
777 <name>name</name>
778 <cstring>Layout4</cstring>
779 </property>
780 <hbox>
781 <property stdset="1">
782 <name>margin</name>
783 <number>0</number>
784 </property>
785 <property stdset="1">
786 <name>spacing</name>
787 <number>6</number>
788 </property>
789 <widget>
790 <class>QLabel</class>
791 <property stdset="1">
792 <name>name</name>
793 <cstring>TextLabel1_4</cstring>
794 </property>
795 <property stdset="1">
796 <name>sizePolicy</name>
797 <sizepolicy>
798 <hsizetype>0</hsizetype>
799 <vsizetype>1</vsizetype>
800 </sizepolicy>
801 </property>
802 <property stdset="1">
803 <name>text</name>
804 <string>Debug</string>
805 </property>
806 </widget>
807 <widget>
808 <class>QSpinBox</class>
809 <property stdset="1">
810 <name>name</name>
811 <cstring>Debug_SB</cstring>
812 </property>
813 <property stdset="1">
814 <name>maxValue</name>
815 <number>3</number>
816 </property>
817 </widget>
818 <spacer>
819 <property>
820 <name>name</name>
821 <cstring>Spacer2</cstring>
822 </property>
823 <property stdset="1">
824 <name>orientation</name>
825 <enum>Horizontal</enum>
826 </property>
827 <property stdset="1">
828 <name>sizeType</name>
829 <enum>Expanding</enum>
830 </property>
831 <property>
832 <name>sizeHint</name>
833 <size>
834 <width>20</width>
835 <height>20</height>
836 </size>
837 </property>
838 </spacer>
839 </hbox>
840 </widget>
841 <spacer>
842 <property>
843 <name>name</name>
844 <cstring>Spacer3</cstring>
845 </property>
846 <property stdset="1">
847 <name>orientation</name>
848 <enum>Vertical</enum>
849 </property>
850 <property stdset="1">
851 <name>sizeType</name>
852 <enum>Expanding</enum>
853 </property>
854 <property>
855 <name>sizeHint</name>
856 <size>
857 <width>20</width>
858 <height>20</height>
859 </size>
860 </property>
861 </spacer>
862 </vbox>
863 </widget>
864 </widget>
865 </vbox>
866</widget>
867<connections>
868 <connection>
869 <sender>AssignedByServer_CB</sender>
870 <signal>toggled(bool)</signal>
871 <receiver>Frame5</receiver>
872 <slot>setDisabled(bool)</slot>
873 </connection>
874 <connection>
875 <sender>FixedGateway_RB</sender>
876 <signal>toggled(bool)</signal>
877 <receiver>Frame3</receiver>
878 <slot>setEnabled(bool)</slot>
879 </connection>
880 <connection>
881 <sender>DefaultGateway_RB</sender>
882 <signal>toggled(bool)</signal>
883 <receiver>SetIfSet_CB</receiver>
884 <slot>setEnabled(bool)</slot>
885 </connection>
886 <connection>
887 <sender>Add_TB</sender>
888 <signal>clicked()</signal>
889 <receiver>GPRSGUI</receiver>
890 <slot>SLOT_AddRoute()</slot>
891 </connection>
892 <connection>
893 <sender>Delete_TB</sender>
894 <signal>clicked()</signal>
895 <receiver>GPRSGUI</receiver>
896 <slot>SLOT_DeleteRoute()</slot>
897 </connection>
898 <slot access="public">SLOT_AddRoute()</slot>
899 <slot access="public">SLOT_AddServer()</slot>
900 <slot access="public">SLOT_RemoveServer()</slot>
901 <slot access="public">SLOT_DeleteRoute()</slot>
902</connections>
903<tabstops>
904 <tabstop>APN_LE</tabstop>
905 <tabstop>User_LE</tabstop>
906 <tabstop>Password_LE</tabstop>
907 <tabstop>DNS1_LE</tabstop>
908 <tabstop>DNS2_LE</tabstop>
909</tabstops>
910</UI>
diff --git a/noncore/settings/networksettings2/gprs/GPRS_NN.cpp b/noncore/settings/networksettings2/gprs/GPRS_NN.cpp
new file mode 100644
index 0000000..5393324
--- a/dev/null
+++ b/noncore/settings/networksettings2/gprs/GPRS_NN.cpp
@@ -0,0 +1,80 @@
1#include <resources.h>
2#include <qpe/qpeapplication.h>
3#include <netnode.h>
4#include "GPRS_NN.h"
5#include "GPRS_NNI.h"
6
7static const char * GPRSNeeds[] =
8 { "GPRS",
9 0
10 };
11
12static const char * GPRSProvides[] =
13 { "connection",
14 0
15 };
16
17/**
18 * Constructor, find all of the possible interfaces
19 */
20GPRSNetNode::GPRSNetNode() : ANetNode(tr("GPRS capable device")) {
21 NSResources->addSystemFile(
22 "pap-secrets", "/etc/ppp/pap-secrets", 0 );
23}
24
25/**
26 * Delete any interfaces that we own.
27 */
28GPRSNetNode::~GPRSNetNode(){
29}
30
31const QString GPRSNetNode::nodeDescription(){
32 return tr("\
33<p>provides access to a GPRS capable device.</p>\
34"
35);
36}
37
38ANetNodeInstance * GPRSNetNode::createInstance( void ) {
39 return new AGPRSDevice( this );
40}
41
42bool GPRSNetNode::hasDataForFile( SystemFile & S ) {
43 return S.name() == "pap-secrets";
44}
45
46short GPRSNetNode::generateFile( SystemFile & ,
47 ANetNodeInstance * ,
48 long ) {
49
50 return 0;
51}
52
53const char ** GPRSNetNode::needs( void ) {
54 return GPRSNeeds;
55}
56
57const char ** GPRSNetNode::provides( void ) {
58 return GPRSProvides;
59}
60
61void GPRSNetNode::setSpecificAttribute( QString & , QString & ) {
62}
63
64void GPRSNetNode::saveSpecificAttribute( QTextStream & ) {
65}
66
67QStringList GPRSNetNode::properFiles( void ) {
68 QStringList SL;
69
70 SL << "peers";
71 SL << "chatscripts";
72 SL << "extra";
73 return SL;
74}
75
76extern "C" {
77void create_plugin( QList<ANetNode> & PNN ) {
78 PNN.append( new GPRSNetNode() );
79}
80}
diff --git a/noncore/settings/networksettings2/gprs/GPRS_NN.h b/noncore/settings/networksettings2/gprs/GPRS_NN.h
new file mode 100644
index 0000000..6a036e1
--- a/dev/null
+++ b/noncore/settings/networksettings2/gprs/GPRS_NN.h
@@ -0,0 +1,43 @@
1#ifndef GPRS_NETNODE_H
2#define GPRS_NETNODE_H
3
4#include "netnode.h"
5
6class ANetwork;
7
8class GPRSNetNode : public ANetNode{
9
10 Q_OBJECT
11
12public:
13
14 GPRSNetNode();
15 virtual ~GPRSNetNode();
16
17 virtual bool hasDataForFile( SystemFile & S );
18
19 virtual short generateFile( SystemFile & Sf,
20 ANetNodeInstance * NNI,
21 long DevNr );
22 virtual const QString pixmapName()
23 { return "Devices/gprs"; }
24
25 virtual QStringList properFiles( void );
26
27 virtual const QString nodeDescription() ;
28 virtual ANetNodeInstance * createInstance( void );
29 virtual const char ** needs( void );
30 virtual const char ** provides( void );
31
32private:
33
34 virtual void setSpecificAttribute( QString & Attr, QString & Value );
35 virtual void saveSpecificAttribute( QTextStream & TS );
36};
37
38extern "C"
39{
40 void create_plugin( QList<ANetNode> & PNN );
41};
42
43#endif
diff --git a/noncore/settings/networksettings2/gprs/GPRS_NNI.cpp b/noncore/settings/networksettings2/gprs/GPRS_NNI.cpp
new file mode 100644
index 0000000..2f61cba
--- a/dev/null
+++ b/noncore/settings/networksettings2/gprs/GPRS_NNI.cpp
@@ -0,0 +1,231 @@
1#include <system.h>
2#include <netnode.h>
3#include "GPRSedit.h"
4#include "GPRS_NNI.h"
5#include "GPRS_NN.h"
6
7AGPRSDevice::AGPRSDevice( GPRSNetNode * PNN ) : ANetNodeInstance( PNN ) {
8 Data.APN = "";
9 Data.User = "";
10 Data.Password = "";
11 Data.DefaultGateway = 1;
12 Data.SetIfSet = 0;
13 Data.Debug = 0;
14 Data.Routing.setAutoDelete( TRUE );
15 GUI = 0;
16 RT = 0;
17}
18
19void AGPRSDevice::setSpecificAttribute( QString & A, QString & V ) {
20 if( A == "apn" ) {
21 Data.APN = V;
22 } else if( A == "user" ) {
23 Data.User = V;
24 } else if( A == "password" ) {
25 Data.Password = V;
26 } else if( A == "dns2" ) {
27 Data.DNS2 = V;
28 } else if( A == "dns1" ) {
29 Data.DNS1 = V;
30 } else if( A == "defaultgateway" ) {
31 Data.DefaultGateway = (V=="yes");
32 } else if( A == "setifset" ) {
33 Data.SetIfSet = (V == "yes");
34 } else if( A == "routes" ) {
35 Data.Routing.resize( V.toULong() );
36 } else if( A.startsWith( "route" ) ) {
37 QStringList SL = QStringList::split( "/", V );
38 GPRSRoutingEntry * E = new GPRSRoutingEntry;
39
40 E->Address = SL[0];
41 E->Mask = SL[1].toULong();
42
43 Data.Routing.insert( A.mid(5).toULong(), E );
44 } else if( A == "debug" ) {
45 Data.Debug = V.toShort();
46 }
47}
48
49void AGPRSDevice::saveSpecificAttribute( QTextStream & TS ) {
50 TS << "apn=" << Data.APN << endl;
51 TS << "user=" << Data.User << endl;
52 TS << "password=" << Data.Password << endl;
53 TS << "dns1=" << Data.DNS1 << endl;
54 TS << "dns2=" << Data.DNS2 << endl;
55 TS << "defaultgateway=" << ( (Data.DefaultGateway) ? "yes" : "no" ) << endl;
56 TS << "setifset=" << ((Data.SetIfSet) ? "yes" : "no") << endl;
57 TS << "debug=" << Data.Debug << endl;
58
59 TS << "routes=" << Data.Routing.count() << oendl;
60 for( unsigned int i = 0; i < Data.Routing.count(); i ++ ) {
61 TS << "route" << i << "="
62 << Data.Routing[i]->Address
63 << "/"
64 << Data.Routing[i]->Mask
65 << oendl;
66 }
67}
68
69QWidget * AGPRSDevice::edit( QWidget * parent ) {
70 GUI = new GPRSEdit( parent );
71 GUI->showData( Data );
72 return GUI;
73}
74
75QString AGPRSDevice::acceptable( void ) {
76 return ( GUI ) ? GUI->acceptable( ) : QString();
77}
78
79void AGPRSDevice::commit( void ) {
80 if( GUI && GUI->commit( Data ) )
81 setModified( 1 );
82}
83
84bool AGPRSDevice::hasDataForFile( SystemFile & S ) {
85 return S.name() == "pap-secrets" ||
86 S.name() == "peers" ||
87 S.name() == "extra" ||
88 S.name() == "chatscripts" ;
89}
90
91short AGPRSDevice::generateFile( SystemFile & SF,
92 long
93 ) {
94
95 if( SF.name() == "pap-secrets" ) {
96 SF << Data.User
97 << " * "
98 << Data.Password
99 << " *"
100 << endl;
101 return 0;
102 } else if( SF.name() == "chatscripts" ) {
103 SF << "SAY \"Starting\\n\"" << oendl;
104 SF << "ECHO OFF" << oendl;
105 SF << "ABORT BUSY" << oendl;
106 SF << "ABORT ERROR" << oendl;
107 SF << "ABORT VOICE" << oendl;
108 SF << "ABORT \"NO CARRIER\"" << oendl;
109 SF << "ABORT \"NO DIALTONE\"" << oendl;
110 SF << "\"\" AT" << oendl;
111 SF << "OK AT+CGATT=1" << oendl;
112 SF << "OK AT+CGDCONT=1,\"IP\",\""
113 << Data.APN
114 << "\""
115 << oendl;
116 SF << "OK ATD*99***1#\\n" << oendl;
117 SF << "TIMEOUT 10" << oendl;
118 SF << "CONNECT \"\"" << oendl;
119 SF << "SAY \"READY\\n\"" << oendl;
120 return 0;
121 } else if( SF.name() == "peers" ) {
122 SF << "noauth" << oendl;
123 SF << "user " << Data.User << oendl;
124 SF << "connect \"/usr/sbin/chat -s -v -f /etc/chatscripts/"
125 << removeSpaces( connection()->name() )
126 << "\""
127 << oendl;
128 SF << "ipcp-accept-local" << oendl;
129 SF << "ipcp-accept-remote" << oendl;
130 if( Data.DefaultGateway ) {
131 SF << "defaultroute" << oendl;
132 if( Data.SetIfSet ) {
133 SF << "replacedefaultroute" << oendl;
134 }
135 }
136 if( Data.Debug ) {
137 SF << "logfile /tmp/"
138 << removeSpaces( connection()->name() )
139 << oendl;
140 for( int i = 0; i < Data.Debug; i ++ ) {
141 SF << "debug" << oendl;
142 }
143 }
144 SF << "nocrtscts" << oendl;
145 SF << "local" << oendl;
146 SF << "lcp-echo-interval 0" << oendl;
147 SF << "lcp-echo-failure 0" << oendl;
148 SF << "usepeerdns" << oendl;
149 SF << "linkname " << removeSpaces( connection()->name() ) << oendl;
150 SF << "nopersist" << oendl;
151 SF << "ipparam " << removeSpaces( connection()->name() ) <<oendl;
152 SF << "maxfail 1" << oendl;
153 return 0;
154 } else if( SF.name() == "extra" ) {
155 unsigned long Bits;
156 // generate 'fixed' settings
157 for( unsigned int i = 0 ;
158 i < Data.Routing.count();
159 i ++ ) {
160 if( Data.Routing[i]->Mask == 32 ) {
161 Bits = 0xffffffff;
162 } else {
163 Bits = ~ ((1 << ((32-Data.Routing[i]->Mask))) - 1);
164 }
165 SF << "route add -net "
166 << Data.Routing[i]->Address
167 << " netmask "
168 << ((Bits&0xff000000)>>24)
169 << "."
170 << ((Bits&0x00ff0000)>>16)
171 << "."
172 << ((Bits&0x0000ff00)>>8)
173 << "."
174 << ((Bits&0x000000ff))
175 << " gw $PPP_REMOTE"
176 << oendl;
177 SF << "route del -net "
178 << Data.Routing[i]->Address
179 << " netmask "
180 << ((Bits&0xff000000)>>24)
181 << "."
182 << ((Bits&0x00ff0000)>>16)
183 << "."
184 << ((Bits&0x0000ff00)>>8)
185 << "."
186 << ((Bits&0x000000ff))
187 << " gw $PPP_REMOTE"
188 << oendl;
189 }
190
191 if( ! Data.DNS1.isEmpty() ) {
192 SF << "nameserver "
193 << Data.DNS1
194 << " # profile "
195 << removeSpaces( connection()->name() )
196 <<oendl;
197 }
198
199 if( ! Data.DNS2.isEmpty() ) {
200 SF << "nameserver "
201 << Data.DNS2
202 << " # profile "
203 << removeSpaces( connection()->name() )
204 <<oendl;
205 }
206 }
207 return 1;
208}
209
210bool AGPRSDevice::openFile( SystemFile & SF ) {
211 if( SF.name() == "peers" ) {
212 SF.setPath(
213 QString( "/etc/ppp/peers/" ) +
214 removeSpaces( connection()->name() )
215 );
216 return 1;
217 } else if ( SF.name() == "chatscripts" ) {
218 SF.setPath(
219 QString( "/etc/chatscripts/" ) +
220 removeSpaces( connection()->name() )
221 );
222 return 1;
223 } else if ( SF.name() == "extra" ) {
224 SF.setPath(
225 QString( "/etc/ppp/" ) +
226 removeSpaces( connection()->name() ) + ".fixed"
227 );
228 return 1;
229 }
230 return 0;
231}
diff --git a/noncore/settings/networksettings2/gprs/GPRS_NNI.h b/noncore/settings/networksettings2/gprs/GPRS_NNI.h
new file mode 100644
index 0000000..1060a6e
--- a/dev/null
+++ b/noncore/settings/networksettings2/gprs/GPRS_NNI.h
@@ -0,0 +1,48 @@
1#ifndef GPRS_H
2#define GPRS_H
3
4#include <netnode.h>
5#include "GPRSdata.h"
6#include "GPRSrun.h"
7
8class GPRSNetNode;
9class GPRSEdit;
10class SystemFile;
11
12class AGPRSDevice : public ANetNodeInstance{
13
14public :
15
16 AGPRSDevice( GPRSNetNode * PNN );
17
18 RuntimeInfo * runtime( void )
19 { return
20 ( RT ) ? RT : ( RT = new GPRSRun( this, Data ) );
21 }
22
23 QWidget * edit( QWidget * parent );
24 QString acceptable( void );
25 void commit( void );
26
27 virtual bool openFile( SystemFile & SF );
28
29 virtual void * data( void )
30 { return (void *)&Data; }
31
32 virtual bool hasDataForFile( SystemFile & S );
33 virtual short generateFile( SystemFile & SF,
34 long DevNr );
35
36protected :
37
38 virtual void setSpecificAttribute( QString & Attr, QString & Value );
39 virtual void saveSpecificAttribute( QTextStream & TS );
40
41private :
42
43 GPRSEdit * GUI;
44 GPRSData Data;
45 GPRSRun * RT;
46};
47
48#endif
diff --git a/noncore/settings/networksettings2/gprs/GPRSdata.h b/noncore/settings/networksettings2/gprs/GPRSdata.h
new file mode 100644
index 0000000..d68c3f2
--- a/dev/null
+++ b/noncore/settings/networksettings2/gprs/GPRSdata.h
@@ -0,0 +1,24 @@
1#ifndef GPRS_DATA_H
2#define GPRS_DATA_H
3
4#include <qvector.h>
5class GPRSRoutingEntry {
6public :
7 QString Address;
8 short Mask;
9};
10
11class GPRSData {
12public :
13 QString APN;
14 QString User;
15 QString Password;
16 QString DNS1;
17 QString DNS2;
18 bool SetIfSet;
19 bool DefaultGateway;
20 short Debug;
21 QVector<GPRSRoutingEntry> Routing;
22} ;
23
24#endif
diff --git a/noncore/settings/networksettings2/gprs/GPRSedit.cpp b/noncore/settings/networksettings2/gprs/GPRSedit.cpp
new file mode 100644
index 0000000..d72b9a2
--- a/dev/null
+++ b/noncore/settings/networksettings2/gprs/GPRSedit.cpp
@@ -0,0 +1,164 @@
1#include <qtoolbutton.h>
2#include <qlistview.h>
3#include <qheader.h>
4#include <qspinbox.h>
5#include <qradiobutton.h>
6#include <qcheckbox.h>
7#include <qtabwidget.h>
8#include <qlineedit.h>
9#include <qlistbox.h>
10#include <GUIUtils.h>
11#include <resources.h>
12#include "GPRSedit.h"
13
14GPRSEdit::GPRSEdit( QWidget * Parent ) : GPRSGUI( Parent ){
15 Routing_LV->header()->hide();
16 Add_TB->setPixmap( NSResources->getPixmap( "add" ) );
17 Delete_TB->setPixmap( NSResources->getPixmap( "delete" ) );
18 Routing_LV->setColumnAlignment( 1, Qt::AlignRight );
19}
20
21QString GPRSEdit::acceptable( void ) {
22 if( APN_LE->text().isEmpty() ) {
23 return tr("APN is required");
24 }
25
26 return QString();
27}
28
29bool GPRSEdit::commit( GPRSData & Data ) {
30 bool SM = 0;
31 bool RM;
32
33 TXTM( Data.APN, APN_LE, SM );
34 TXTM( Data.User, User_LE, SM );
35 TXTM( Data.Password, Password_LE, SM );
36
37 if( AssignedByServer_CB->isChecked() ) {
38 if( ! Data.DNS1.isEmpty() ) {
39 SM = 1;
40 Data.DNS1 = "";
41 }
42 if( ! Data.DNS2.isEmpty() ) {
43 SM = 1;
44 Data.DNS2 = "";
45 }
46 } else {
47 TXTM( Data.DNS1, DNS1_LE, SM );
48 TXTM( Data.DNS2, DNS2_LE, SM );
49 }
50
51 CBM( Data.DefaultGateway, DefaultGateway_RB, SM );
52 CBM( Data.SetIfSet, SetIfSet_CB, SM );
53
54 // find new routes
55 unsigned int i;
56
57 RM = 0; // routing modified
58 QListViewItem * it = Routing_LV->firstChild();
59 while( ! RM && it ) {
60 for( i = 0; i < Data.Routing.count(); i ++ ) {
61 if( it->text(0) == Data.Routing[i]->Address ) {
62 // still exists
63 break;
64 }
65 }
66 if( i == Data.Routing.count() ) {
67 // modified
68 RM = 1;
69 }
70 it = it->nextSibling();
71 }
72
73 // find obsoleted
74 for( i = 0; ! RM && i < Data.Routing.count(); i ++ ) {
75 it = Routing_LV->firstChild();
76 while( it ) {
77 if( it->text(0) == Data.Routing[i]->Address ) {
78 // still exists
79 break;
80 }
81 it = it->nextSibling();
82 }
83
84 if( it == 0 ) {
85 RM = 1;
86 }
87 }
88
89 if( RM ) {
90 unsigned int i = 0;
91 GPRSRoutingEntry * E;
92 // update routing table
93 Data.Routing.resize(0);
94 Data.Routing.resize( Routing_LV->childCount() );
95
96 it = Routing_LV->firstChild();
97 while( it ) {
98 E = new GPRSRoutingEntry;
99 E->Address = it->text(0);
100 E->Mask = it->text(1).toShort();
101 Data.Routing.insert( i, E );
102 i ++;
103 it = it->nextSibling();
104 }
105 }
106
107 SBM( Data.Debug, Debug_SB, SM );
108 return SM;
109}
110
111void GPRSEdit::showData( GPRSData & Data ) {
112 STXT( Data.APN, APN_LE );
113 STXT( Data.User, User_LE );
114 STXT( Data.Password, Password_LE );
115
116 SCB( ( Data.DNS1.isEmpty() && Data.DNS2.isEmpty() ),
117 AssignedByServer_CB );
118 STXT( Data.DNS1, DNS1_LE );
119 STXT( Data.DNS2, DNS2_LE );
120
121 SCB( Data.DefaultGateway, DefaultGateway_RB );
122 SCB( (! Data.DefaultGateway), FixedGateway_RB );
123 SCB( Data.SetIfSet, SetIfSet_CB );
124
125 for( unsigned int i = 0; i < Data.Routing.count(); i ++ ) {
126 QListViewItem * it;
127 it = new QListViewItem( Routing_LV );
128
129 it->setText( 0, Data.Routing[i]->Address );
130 it->setText( 1, QString().setNum( Data.Routing[i]->Mask ) );
131 }
132
133 SSB( Data.Debug, Debug_SB );
134}
135
136void GPRSEdit::SLOT_AddRoute( void ) {
137 QListViewItem * it, *last;
138 QListViewItem * after = Routing_LV->firstChild();
139 last = 0;
140 while( after ) {
141 if( after->isSelected() ) {
142 break;
143 }
144 last = after;
145 after = after->nextSibling();
146 }
147
148 it = new QListViewItem( Routing_LV, (after) ? after : last );
149
150 it->setText( 0, Net_LE->text() );
151 it->setText( 1, QString().setNum( Mask_SB->value() ) );
152}
153
154void GPRSEdit::SLOT_DeleteRoute( void ) {
155 QListViewItem * nit;
156 QListViewItem * it = Routing_LV->firstChild();
157 while( it ) {
158 nit = it->nextSibling();
159 if( it->isSelected() ) {
160 delete it;
161 }
162 it = nit;
163 }
164}
diff --git a/noncore/settings/networksettings2/gprs/GPRSedit.h b/noncore/settings/networksettings2/gprs/GPRSedit.h
new file mode 100644
index 0000000..35e8ee6
--- a/dev/null
+++ b/noncore/settings/networksettings2/gprs/GPRSedit.h
@@ -0,0 +1,20 @@
1#include "GPRSdata.h"
2#include "GPRSGUI.h"
3
4class GPRSEdit : public GPRSGUI {
5
6public :
7
8 GPRSEdit( QWidget * parent );
9 QString acceptable( void );
10 bool commit( GPRSData & Data );
11 void showData( GPRSData & Data );
12
13public slots :
14
15 void SLOT_AddRoute();
16 void SLOT_DeleteRoute();
17
18private :
19
20};
diff --git a/noncore/settings/networksettings2/gprs/GPRSrun.cpp b/noncore/settings/networksettings2/gprs/GPRSrun.cpp
new file mode 100644
index 0000000..e842b99
--- a/dev/null
+++ b/noncore/settings/networksettings2/gprs/GPRSrun.cpp
@@ -0,0 +1,105 @@
1#include <sys/types.h>
2#include <signal.h>
3#include <errno.h>
4#include <qdir.h>
5#include <system.h>
6#include <resources.h>
7#include <netnode.h>
8#include "GPRSrun.h"
9
10State_t GPRSRun::detectState( void ) {
11
12 // is pppd still running ?
13 // is rfcomm still active
14 NodeCollection * NC = nodeCollection();
15 InterfaceInfo * I = NC->assignedInterface();
16
17 QDir D("/var/run");
18
19 if( I ) {
20 // has some pppx attached
21 return ( I->IsUp ) ? IsUp : Available;
22 }
23
24 // check ppp itself and figure out interface
25
26 owarn << "Check for ppp " << NC->name() << oendl;
27 if( D.exists( QString("ppp-")+removeSpaces(NC->name())+".pid") ) {
28 // get pid and check if pppd is still running
29 QFile F( D.path()+"/ppp-"+removeSpaces(NC->name())+".pid");
30
31 owarn << "PPP PID " << F.name() << oendl;
32 if( F.open( IO_ReadOnly ) ) {
33 QTextStream TS(&F);
34 QString X = TS.readLine();
35 PPPPid = X.toULong();
36 int rv;
37
38 rv = ::kill( PPPPid, 0 );
39 if( rv == 0 ||
40 ( rv < 0 && errno == EPERM )
41 ) {
42 // pppd is still up
43 X = TS.readLine();
44 I = NSResources->system().findInterface(X);
45
46 owarn << "ppp running : IFace " << X << " = " << (long)I << oendl;
47
48 if( I ) {
49 NC->assignInterface( I );
50 return (I->IsUp) ? IsUp : Available;
51 }
52
53 return Available;
54
55 } else {
56 // pppd is down
57 PPPPid = 0;
58 }
59 } // else pppd is down
60 }
61 NC->assignInterface( 0 );
62 return Unknown;
63}
64
65QString GPRSRun::setMyState( NodeCollection * NC, Action_t A , bool ) {
66
67 if( A == Up ) {
68 // start ppp on deviceFile
69 QStringList SL;
70 SL << "pon"
71 << removeSpaces( NC->name() )
72 << NC->device()->deviceFile();
73
74 if( ! NSResources->system().execAsUser( SL ) ) {
75 return QString("Cannot start pppd for %1").arg(NC->name());
76 }
77 } else if ( A == Down ) {
78 if( PPPPid == 0 ) {
79 detectState();
80 }
81 if( PPPPid ) {
82 QStringList SL;
83
84 SL << "poff"
85 << removeSpaces( NC->name() );
86
87 if( ! NSResources->system().execAsUser( SL ) ) {
88 return QString("Cannot terminate pppd for %1").arg(NC->name());
89 }
90 NC->assignInterface( 0 );
91 owarn << "ppp stopped " << oendl;
92 PPPPid = 0;
93 }
94 }
95
96 return QString();
97}
98
99bool GPRSRun::handlesInterface( const QString & S ) {
100 return Pat.match( S ) >= 0;
101}
102
103bool GPRSRun::handlesInterface( InterfaceInfo * I ) {
104 return handlesInterface( I->Name );
105}
diff --git a/noncore/settings/networksettings2/gprs/GPRSrun.h b/noncore/settings/networksettings2/gprs/GPRSrun.h
new file mode 100644
index 0000000..817f8a9
--- a/dev/null
+++ b/noncore/settings/networksettings2/gprs/GPRSrun.h
@@ -0,0 +1,34 @@
1#include <netnode.h>
2#include <qregexp.h>
3#include "GPRSdata.h"
4
5class GPRSRun : public RuntimeInfo {
6
7public :
8
9 GPRSRun( ANetNodeInstance * NNI,
10 GPRSData & D ) : RuntimeInfo( NNI ),
11 Pat( "ppp[0-9]" ) {
12 PPPPid = 0;
13 }
14
15 bool handlesInterface( const QString & I );
16 bool handlesInterface( InterfaceInfo * );
17
18 virtual RuntimeInfo * device( void )
19 { return this; }
20 virtual RuntimeInfo * connection( void )
21 { return this; }
22
23 State_t detectState( void );
24
25protected :
26
27 QString setMyState( NodeCollection * , Action_t, bool );
28
29private :
30
31 QRegExp Pat;
32 size_t PPPPid;
33
34};
diff --git a/noncore/settings/networksettings2/gprs/config.in b/noncore/settings/networksettings2/gprs/config.in
new file mode 100644
index 0000000..ec29264
--- a/dev/null
+++ b/noncore/settings/networksettings2/gprs/config.in
@@ -0,0 +1,4 @@
1 config NS2GPRS
2 boolean "opie-networksettings2plugin-gprs (set up GPRS)"
3 default "n" if NS2
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && NS2CORE
diff --git a/noncore/settings/networksettings2/gprs/opie-networksettings2plugin-network.control b/noncore/settings/networksettings2/gprs/opie-networksettings2plugin-network.control
new file mode 100644
index 0000000..902ebff
--- a/dev/null
+++ b/noncore/settings/networksettings2/gprs/opie-networksettings2plugin-network.control
@@ -0,0 +1,9 @@
1Package: opie-networksettings2plugin-GPRS
2Files: plugins/networksettings2/libGPRS.so*
3Priority: optional
4Section: opie/settings
5Maintainer: Wim Delvaux <wimpie@handhelds.org>
6Architecture: arm
7Depends: opie-networksettings2, libopiecore2, libopienet2
8Description: Setup GPRS network
9Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/settings/networksettings2/opie-networksettings2.control b/noncore/settings/networksettings2/opie-networksettings2.control
new file mode 100644
index 0000000..e4bd29c
--- a/dev/null
+++ b/noncore/settings/networksettings2/opie-networksettings2.control
@@ -0,0 +1,10 @@
1Package: opie-networksettings2
2Files: bin/networksettings2 apps/Settings/networksettings2.desktop pics/networksettings2/*.png lib/libnetworksettings2.so* pics/networksettings2/Devices/*.png
3Priority: optional
4Section: opie/settings
5Maintainer: wim delvaux <wimpie@handhelds.org>
6Architecture: arm
7Depends: task-opie-minimal, libopietooth2
8Description: Network settings.
9Replaces: opie-networksetup
10Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/settings/networksettings2/opie-networksettings2.postinst b/noncore/settings/networksettings2/opie-networksettings2.postinst
new file mode 100755
index 0000000..ce43274
--- a/dev/null
+++ b/noncore/settings/networksettings2/opie-networksettings2.postinst
@@ -0,0 +1,9 @@
1#!/bin/sh
2
3QTPB=/opt/QtPalmtop/bin
4
5[ ! -L ${QTPB}/networksettings2-request ] && ln -sf ${QTPB}/networksettings2 ${QTPB}/networksettings2-request
6
7qcop QPE/TaskBar "reloadApps()"
8
9exit 0
diff --git a/noncore/settings/networksettings2/ppp/PPPDialingedit.cpp b/noncore/settings/networksettings2/ppp/PPPDialingedit.cpp
new file mode 100644
index 0000000..9264ceb
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPDialingedit.cpp
@@ -0,0 +1,25 @@
1#include <stdio.h>
2#include <qcombobox.h>
3#include <qmessagebox.h>
4#include <qradiobutton.h>
5#include <qlineedit.h>
6#include <GUIUtils.h>
7#include "PPPDialingedit.h"
8
9PPPDialingEdit::PPPDialingEdit( QWidget * Parent ) :
10 PPPDialingGUI( Parent ){
11
12 // populate widget stack
13}
14
15QString PPPDialingEdit::acceptable( void ) {
16 return QString();
17}
18
19bool PPPDialingEdit::commit( PPPData & D ) {
20 bool SM;
21 return SM;
22}
23
24void PPPDialingEdit::showData( PPPData & D ) {
25}
diff --git a/noncore/settings/networksettings2/ppp/PPPDialingedit.h b/noncore/settings/networksettings2/ppp/PPPDialingedit.h
new file mode 100644
index 0000000..016bb3b
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPDialingedit.h
@@ -0,0 +1,16 @@
1#include "pppdata.h"
2#include "PPPDialingGUI.h"
3
4class PPPDialingEdit : public PPPDialingGUI {
5
6public :
7
8 PPPDialingEdit( QWidget * parent );
9
10 QString acceptable( void );
11 bool commit( PPPData & Data );
12 void showData( PPPData & Data );
13
14private :
15
16};
diff --git a/noncore/settings/networksettings2/ppp/PPPRunGUI.ui b/noncore/settings/networksettings2/ppp/PPPRunGUI.ui
new file mode 100644
index 0000000..4532065
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPRunGUI.ui
@@ -0,0 +1,207 @@
1<!DOCTYPE UI><UI>
2<class>PPPRunGUI</class>
3<widget>
4 <class>QWidget</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>PPPRunGUI</cstring>
8 </property>
9 <property stdset="1">
10 <name>geometry</name>
11 <rect>
12 <x>0</x>
13 <y>0</y>
14 <width>210</width>
15 <height>272</height>
16 </rect>
17 </property>
18 <property stdset="1">
19 <name>caption</name>
20 <string>PPPRun</string>
21 </property>
22 <property>
23 <name>layoutMargin</name>
24 </property>
25 <property>
26 <name>layoutSpacing</name>
27 </property>
28 <vbox>
29 <property stdset="1">
30 <name>margin</name>
31 <number>3</number>
32 </property>
33 <property stdset="1">
34 <name>spacing</name>
35 <number>3</number>
36 </property>
37 <widget>
38 <class>QGroupBox</class>
39 <property stdset="1">
40 <name>name</name>
41 <cstring>GroupBox1</cstring>
42 </property>
43 <property stdset="1">
44 <name>title</name>
45 <string>Upon connect</string>
46 </property>
47 <property>
48 <name>layoutMargin</name>
49 </property>
50 <property>
51 <name>layoutSpacing</name>
52 </property>
53 <grid>
54 <property stdset="1">
55 <name>margin</name>
56 <number>3</number>
57 </property>
58 <property stdset="1">
59 <name>spacing</name>
60 <number>3</number>
61 </property>
62 <widget row="0" column="1" >
63 <class>QLineEdit</class>
64 <property stdset="1">
65 <name>name</name>
66 <cstring>PreConnect_LE</cstring>
67 </property>
68 </widget>
69 <widget row="0" column="0" >
70 <class>QLabel</class>
71 <property stdset="1">
72 <name>name</name>
73 <cstring>TextLabel2</cstring>
74 </property>
75 <property stdset="1">
76 <name>text</name>
77 <string>Before</string>
78 </property>
79 </widget>
80 <widget row="1" column="1" >
81 <class>QLineEdit</class>
82 <property stdset="1">
83 <name>name</name>
84 <cstring>PostConnect_LE</cstring>
85 </property>
86 </widget>
87 <widget row="1" column="0" >
88 <class>QLabel</class>
89 <property stdset="1">
90 <name>name</name>
91 <cstring>TextLabel2_2</cstring>
92 </property>
93 <property stdset="1">
94 <name>text</name>
95 <string>After</string>
96 </property>
97 </widget>
98 </grid>
99 </widget>
100 <widget>
101 <class>QGroupBox</class>
102 <property stdset="1">
103 <name>name</name>
104 <cstring>GroupBox1_2</cstring>
105 </property>
106 <property stdset="1">
107 <name>title</name>
108 <string>Upon disconnect</string>
109 </property>
110 <property>
111 <name>layoutMargin</name>
112 </property>
113 <property>
114 <name>layoutSpacing</name>
115 </property>
116 <grid>
117 <property stdset="1">
118 <name>margin</name>
119 <number>3</number>
120 </property>
121 <property stdset="1">
122 <name>spacing</name>
123 <number>3</number>
124 </property>
125 <widget row="0" column="1" >
126 <class>QLineEdit</class>
127 <property stdset="1">
128 <name>name</name>
129 <cstring>PreDisconnect_LE</cstring>
130 </property>
131 </widget>
132 <widget row="0" column="0" >
133 <class>QLabel</class>
134 <property stdset="1">
135 <name>name</name>
136 <cstring>TextLabel2_3</cstring>
137 </property>
138 <property stdset="1">
139 <name>text</name>
140 <string>Before</string>
141 </property>
142 </widget>
143 <widget row="1" column="1" >
144 <class>QLineEdit</class>
145 <property stdset="1">
146 <name>name</name>
147 <cstring>PostDisconnect_LE</cstring>
148 </property>
149 </widget>
150 <widget row="1" column="0" >
151 <class>QLabel</class>
152 <property stdset="1">
153 <name>name</name>
154 <cstring>TextLabel2_2_2</cstring>
155 </property>
156 <property stdset="1">
157 <name>text</name>
158 <string>After</string>
159 </property>
160 </widget>
161 </grid>
162 </widget>
163 <widget>
164 <class>QLabel</class>
165 <property stdset="1">
166 <name>name</name>
167 <cstring>TextLabel1</cstring>
168 </property>
169 <property stdset="1">
170 <name>text</name>
171 <string>&lt;UL&gt;
172&lt;LI&gt;Commands run under your &lt;b&gt;real&lt;/b&gt; user id (&lt;b&gt;not&lt;/b&gt; as root)&lt;/LI&gt;
173&lt;LI&gt;Supply the whole path&lt;/LI&gt;
174&lt;/UL&gt;</string>
175 </property>
176 <property stdset="1">
177 <name>alignment</name>
178 <set>WordBreak|AlignVCenter|AlignLeft</set>
179 </property>
180 <property>
181 <name>wordwrap</name>
182 </property>
183 </widget>
184 <spacer>
185 <property>
186 <name>name</name>
187 <cstring>Spacer1</cstring>
188 </property>
189 <property stdset="1">
190 <name>orientation</name>
191 <enum>Vertical</enum>
192 </property>
193 <property stdset="1">
194 <name>sizeType</name>
195 <enum>Expanding</enum>
196 </property>
197 <property>
198 <name>sizeHint</name>
199 <size>
200 <width>20</width>
201 <height>20</height>
202 </size>
203 </property>
204 </spacer>
205 </vbox>
206</widget>
207</UI>
diff --git a/noncore/settings/networksettings2/ppp/PPPRunedit.cpp b/noncore/settings/networksettings2/ppp/PPPRunedit.cpp
new file mode 100644
index 0000000..23fcd3c
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPRunedit.cpp
@@ -0,0 +1,31 @@
1#include <stdio.h>
2#include <qcombobox.h>
3#include <qmessagebox.h>
4#include <qradiobutton.h>
5#include <qlineedit.h>
6#include <GUIUtils.h>
7#include "PPPRunedit.h"
8
9PPPRunEdit::PPPRunEdit( QWidget * Parent ) : PPPRunGUI( Parent ){
10}
11
12QString PPPRunEdit::acceptable( void ) {
13 return QString();
14}
15
16bool PPPRunEdit::commit( PPPData & D ) {
17 bool SM = 0;
18
19 TXTM( D.Run.PreConnect, PreConnect_LE, SM );
20 TXTM( D.Run.PostConnect, PostConnect_LE, SM );
21 TXTM( D.Run.PreDisconnect, PreDisconnect_LE, SM );
22 TXTM( D.Run.PostDisconnect, PostDisconnect_LE, SM );
23 return SM;
24}
25
26void PPPRunEdit::showData( PPPData & D ) {
27 STXT( D.Run.PreConnect, PreConnect_LE);
28 STXT( D.Run.PostConnect, PostConnect_LE);
29 STXT( D.Run.PreDisconnect, PreDisconnect_LE );
30 STXT( D.Run.PostDisconnect, PostDisconnect_LE);
31}
diff --git a/noncore/settings/networksettings2/ppp/PPPRunedit.h b/noncore/settings/networksettings2/ppp/PPPRunedit.h
new file mode 100644
index 0000000..4205512
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPRunedit.h
@@ -0,0 +1,16 @@
1#include "pppdata.h"
2#include "PPPRunGUI.h"
3
4class PPPRunEdit : public PPPRunGUI {
5
6public :
7
8 PPPRunEdit( QWidget * parent );
9
10 QString acceptable( void );
11 bool commit( PPPData & Data );
12 void showData( PPPData & Data );
13
14private :
15
16};