summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h2
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetooth_NN.h4
-rw-r--r--noncore/settings/networksettings2/cable/cable_NN.h2
-rw-r--r--noncore/settings/networksettings2/editconnection.cpp2
-rw-r--r--noncore/settings/networksettings2/irda/irda_NN.h2
-rw-r--r--noncore/settings/networksettings2/lancard/lancard_NN.h2
-rw-r--r--noncore/settings/networksettings2/main.cpp4
-rw-r--r--noncore/settings/networksettings2/modem/modem_NN.h2
-rw-r--r--noncore/settings/networksettings2/network/network_NN.h2
-rw-r--r--noncore/settings/networksettings2/network/networkrun.cpp2
-rw-r--r--noncore/settings/networksettings2/networksettings.cpp101
-rw-r--r--noncore/settings/networksettings2/networksettings.h8
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.cpp4
-rw-r--r--noncore/settings/networksettings2/networksettings2/resources.cpp5
-rw-r--r--noncore/settings/networksettings2/networksettings2/system.cpp1
-rw-r--r--noncore/settings/networksettings2/networksettingsGUI.ui185
-rw-r--r--noncore/settings/networksettings2/nsdata.cpp1
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.h2
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NNI.h2
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.cpp19
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.h20
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.h2
-rw-r--r--noncore/settings/networksettings2/usb/usb_NN.h2
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NN.h2
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NN.h2
25 files changed, 130 insertions, 250 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h
index 4dd508d..57ff95e 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h
@@ -16,13 +16,13 @@ public :
16 16
17 QWidget * edit( QWidget * parent ); 17 QWidget * edit( QWidget * parent );
18 QString acceptable( void ); 18 QString acceptable( void );
19 void commit( void ); 19 void commit( void );
20 20
21 RuntimeInfo * runtime( void ) 21 RuntimeInfo * runtime( void )
22 { if( RT ) 22 { if( RT == 0 )
23 RT = new BluetoothRFCOMMRun( this, Data ); 23 RT = new BluetoothRFCOMMRun( this, Data );
24 return RT; 24 return RT;
25 } 25 }
26 26
27 virtual void * data( void ) 27 virtual void * data( void )
28 { return (void *)&Data; } 28 { return (void *)&Data; }
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
index ee346f0..705201c 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
@@ -12,13 +12,13 @@ class BluetoothBNEPNetNode : public ANetNode {
12public: 12public:
13 13
14 BluetoothBNEPNetNode(); 14 BluetoothBNEPNetNode();
15 virtual ~BluetoothBNEPNetNode(); 15 virtual ~BluetoothBNEPNetNode();
16 16
17 virtual const QString pixmapName() 17 virtual const QString pixmapName()
18 { return "bluetooth"; } 18 { return "Devices/bluetooth"; }
19 19
20 virtual const QString nodeName() 20 virtual const QString nodeName()
21 { return tr("Bluetooth PAN/NAP"); } 21 { return tr("Bluetooth PAN/NAP"); }
22 22
23 virtual const QString nodeDescription() ; 23 virtual const QString nodeDescription() ;
24 24
@@ -43,13 +43,13 @@ class BluetoothRFCOMMNetNode : public ANetNode {
43public: 43public:
44 44
45 BluetoothRFCOMMNetNode(); 45 BluetoothRFCOMMNetNode();
46 virtual ~BluetoothRFCOMMNetNode(); 46 virtual ~BluetoothRFCOMMNetNode();
47 47
48 virtual const QString pixmapName() 48 virtual const QString pixmapName()
49 { return "bluetooth"; } 49 { return "Devices/bluetooth"; }
50 50
51 virtual const QString nodeName() 51 virtual const QString nodeName()
52 { return tr("Bluetooth serial link"); } 52 { return tr("Bluetooth serial link"); }
53 53
54 virtual const QString nodeDescription() ; 54 virtual const QString nodeDescription() ;
55 55
diff --git a/noncore/settings/networksettings2/cable/cable_NN.h b/noncore/settings/networksettings2/cable/cable_NN.h
index 401317b..da99c1c 100644
--- a/noncore/settings/networksettings2/cable/cable_NN.h
+++ b/noncore/settings/networksettings2/cable/cable_NN.h
@@ -12,13 +12,13 @@ class CableNetNode : public ANetNode {
12public: 12public:
13 13
14 CableNetNode(); 14 CableNetNode();
15 virtual ~CableNetNode(); 15 virtual ~CableNetNode();
16 16
17 virtual const QString pixmapName() 17 virtual const QString pixmapName()
18 { return "cable"; } 18 { return "Devices/cable"; }
19 19
20 virtual const QString nodeName() 20 virtual const QString nodeName()
21 { return tr("Cable Connection"); } 21 { return tr("Cable Connection"); }
22 22
23 virtual const QString nodeDescription() ; 23 virtual const QString nodeDescription() ;
24 24
diff --git a/noncore/settings/networksettings2/editconnection.cpp b/noncore/settings/networksettings2/editconnection.cpp
index d4b2bb3..ce13573 100644
--- a/noncore/settings/networksettings2/editconnection.cpp
+++ b/noncore/settings/networksettings2/editconnection.cpp
@@ -286,13 +286,13 @@ void EditConnection::buildFullTree( void ) {
286 continue; 286 continue;
287 } 287 }
288 288
289 MyQCheckListItem * it = new MyQCheckListItem( TheTop, 289 MyQCheckListItem * it = new MyQCheckListItem( TheTop,
290 NN->nodeName(), 290 NN->nodeName(),
291 QCheckListItem::RadioButton ); 291 QCheckListItem::RadioButton );
292 it->setPixmap( 0, NSResources->getPixmap( "commprofile" ) ); 292 it->setPixmap( 0, NSResources->getPixmap( "Devices/commprofile" ) );
293 // remember that this node maps to this listitem 293 // remember that this node maps to this listitem
294 Mapping->insert( it, NN ); 294 Mapping->insert( it, NN );
295 buildSubTree( it, NN ); 295 buildSubTree( it, NN );
296 } 296 }
297} 297}
298 298
diff --git a/noncore/settings/networksettings2/irda/irda_NN.h b/noncore/settings/networksettings2/irda/irda_NN.h
index 82811a4..6574c17 100644
--- a/noncore/settings/networksettings2/irda/irda_NN.h
+++ b/noncore/settings/networksettings2/irda/irda_NN.h
@@ -12,13 +12,13 @@ class IRDANetNode : public ANetNode {
12public: 12public:
13 13
14 IRDANetNode(); 14 IRDANetNode();
15 virtual ~IRDANetNode(); 15 virtual ~IRDANetNode();
16 16
17 virtual const QString pixmapName() 17 virtual const QString pixmapName()
18 { return "irda"; } 18 { return "Devices/irda"; }
19 19
20 virtual const QString nodeName() 20 virtual const QString nodeName()
21 { return tr("Infrared link"); } 21 { return tr("Infrared link"); }
22 22
23 virtual const QString nodeDescription() ; 23 virtual const QString nodeDescription() ;
24 24
diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.h b/noncore/settings/networksettings2/lancard/lancard_NN.h
index 576a6e0..71b49d0 100644
--- a/noncore/settings/networksettings2/lancard/lancard_NN.h
+++ b/noncore/settings/networksettings2/lancard/lancard_NN.h
@@ -12,13 +12,13 @@ class LanCardNetNode : public ANetNode{
12public: 12public:
13 13
14 LanCardNetNode(); 14 LanCardNetNode();
15 virtual ~LanCardNetNode(); 15 virtual ~LanCardNetNode();
16 16
17 virtual const QString pixmapName() 17 virtual const QString pixmapName()
18 { return "card"; } 18 { return "Devices/card"; }
19 19
20 virtual const QString nodeName() 20 virtual const QString nodeName()
21 { return tr("LAN card"); } 21 { return tr("LAN card"); }
22 22
23 virtual const QString nodeDescription() ; 23 virtual const QString nodeDescription() ;
24 24
diff --git a/noncore/settings/networksettings2/main.cpp b/noncore/settings/networksettings2/main.cpp
index 1e1270e..7ec26a7 100644
--- a/noncore/settings/networksettings2/main.cpp
+++ b/noncore/settings/networksettings2/main.cpp
@@ -85,15 +85,15 @@ int main( int argc, char * argv[] ) {
85 rv = (NS.regenerate()) ? 1 : 0; 85 rv = (NS.regenerate()) ? 1 : 0;
86 } 86 }
87 break; 87 break;
88 case ACT_PROMPT : 88 case ACT_PROMPT :
89 { ActivateProfile AP(argv[1]); 89 { ActivateProfile AP(argv[1]);
90 if( AP.exec() == QDialog::Accepted ) { 90 if( AP.exec() == QDialog::Accepted ) {
91 printf( "%s-c%d-allowed", AP.selectedProfile() ); 91 printf( "%s-c%ld-allowed", argv[1], AP.selectedProfile() );
92 } else { 92 } else {
93 printf( "%s-cNN-disallowed" ); 93 printf( "%s-cNN-disallowed", argv[1] );
94 } 94 }
95 } 95 }
96 break; 96 break;
97 case ACT_GUI : 97 case ACT_GUI :
98 { QWidget * W = new NetworkSettings(0); 98 { QWidget * W = new NetworkSettings(0);
99 TheApp->setMainWidget( W ); 99 TheApp->setMainWidget( W );
diff --git a/noncore/settings/networksettings2/modem/modem_NN.h b/noncore/settings/networksettings2/modem/modem_NN.h
index 0f4c124..5eceed2 100644
--- a/noncore/settings/networksettings2/modem/modem_NN.h
+++ b/noncore/settings/networksettings2/modem/modem_NN.h
@@ -12,13 +12,13 @@ class ModemNetNode : public ANetNode{
12public: 12public:
13 13
14 ModemNetNode(); 14 ModemNetNode();
15 virtual ~ModemNetNode(); 15 virtual ~ModemNetNode();
16 16
17 virtual const QString pixmapName() 17 virtual const QString pixmapName()
18 { return "modem"; } 18 { return "Devices/modem"; }
19 19
20 virtual const QString nodeName() 20 virtual const QString nodeName()
21 { return tr("Dialup modem"); } 21 { return tr("Dialup modem"); }
22 22
23 virtual const QString nodeDescription() ; 23 virtual const QString nodeDescription() ;
24 24
diff --git a/noncore/settings/networksettings2/network/network_NN.h b/noncore/settings/networksettings2/network/network_NN.h
index 3b0cd64..220e00f 100644
--- a/noncore/settings/networksettings2/network/network_NN.h
+++ b/noncore/settings/networksettings2/network/network_NN.h
@@ -12,13 +12,13 @@ class NetworkNetNode : public ANetNode{
12public: 12public:
13 13
14 NetworkNetNode(); 14 NetworkNetNode();
15 virtual ~NetworkNetNode(); 15 virtual ~NetworkNetNode();
16 16
17 virtual const QString pixmapName() 17 virtual const QString pixmapName()
18 { return "tcpip"; } 18 { return "Devices/tcpip"; }
19 19
20 virtual const QString nodeName() 20 virtual const QString nodeName()
21 { return tr("IP Configuration"); } 21 { return tr("IP Configuration"); }
22 22
23 virtual const QString nodeDescription() ; 23 virtual const QString nodeDescription() ;
24 24
diff --git a/noncore/settings/networksettings2/network/networkrun.cpp b/noncore/settings/networksettings2/network/networkrun.cpp
index e732bfa..8deca14 100644
--- a/noncore/settings/networksettings2/network/networkrun.cpp
+++ b/noncore/settings/networksettings2/network/networkrun.cpp
@@ -23,13 +23,13 @@ bool NetworkRun::setState( NodeCollection * NC, Action_t A ) {
23 InterfaceInfo * II = Next->assignedInterface(); 23 InterfaceInfo * II = Next->assignedInterface();
24 24
25 if( A == Up ) { 25 if( A == Up ) {
26 // we can bring UP if lower level is available 26 // we can bring UP if lower level is available
27 if( NC->currentState() == Available ) { 27 if( NC->currentState() == Available ) {
28 QString S; 28 QString S;
29 S.sprintf( "ifup %s=manual", II->Name.latin1() ); 29 S.sprintf( "ifup %s", II->Name.latin1() );
30 NSResources->system().execute( S ); 30 NSResources->system().execute( S );
31 NC->setCurrentState( IsUp ); 31 NC->setCurrentState( IsUp );
32 } 32 }
33 return 1; 33 return 1;
34 } else if( A == Down ) { 34 } else if( A == Down ) {
35 if( NC->currentState() == IsUp ) { 35 if( NC->currentState() == IsUp ) {
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp
index f72fa8e..e1110e2 100644
--- a/noncore/settings/networksettings2/networksettings.cpp
+++ b/noncore/settings/networksettings2/networksettings.cpp
@@ -1,10 +1,10 @@
1#include <stdio.h> 1#include <stdio.h>
2 2
3#include <qpe/qpeapplication.h> 3#include <qpe/qpeapplication.h>
4#include <qiconset.h> 4#include <qlistbox.h>
5#include <qgroupbox.h> 5#include <qgroupbox.h>
6#include <qtimer.h> 6#include <qtimer.h>
7#include <qlistbox.h> 7#include <qlistbox.h>
8#include <qmessagebox.h> 8#include <qmessagebox.h>
9#include <qlabel.h> 9#include <qlabel.h>
10#include <qiconview.h> 10#include <qiconview.h>
@@ -32,30 +32,27 @@ NetworkSettings::NetworkSettings( QWidget *parent,
32 32
33 Connect_TB->setPixmap( NSResources->getPixmap( "connected" ) ); 33 Connect_TB->setPixmap( NSResources->getPixmap( "connected" ) );
34 34
35 On_TB->setPixmap( NSResources->getPixmap( "off" ) ); 35 On_TB->setPixmap( NSResources->getPixmap( "off" ) );
36 36
37 // populate main Listbox 37 // populate main Listbox
38 Profiles_IV->clear(); 38 Profiles_LB->clear();
39 { Name2Connection_t & M = NSResources->connections(); 39 { Name2Connection_t & M = NSResources->connections();
40 NodeCollection * NC; 40 NodeCollection * NC;
41 QIconViewItem * IVI;
42
43 // for all connections 41 // for all connections
44 for( QDictIterator<NodeCollection> it(M); 42 for( QDictIterator<NodeCollection> it(M);
45 it.current(); 43 it.current();
46 ++it ) { 44 ++it ) {
47 NC = it.current(); 45 NC = it.current();
48 IVI = new QIconViewItem( Profiles_IV, 46 Profiles_LB->insertItem( NC->devicePixmap(),
49 NC->name(), 47 NC->name() );
50 NC->devicePixmap() );
51 } 48 }
52 } 49 }
53 50
54 if( Profiles_IV->count() ) { 51 if( Profiles_LB->count() ) {
55 Profiles_IV->setSelected( Profiles_IV->firstItem(), TRUE ); 52 Profiles_LB->setSelected( 0, TRUE );
56 } 53 }
57 54
58 // if no profiles -> auto popup editing 55 // if no profiles -> auto popup editing
59 if( NSResources->connections().count() == 0 ) { 56 if( NSResources->connections().count() == 0 ) {
60 QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) ); 57 QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) );
61 } 58 }
@@ -88,24 +85,24 @@ NetworkSettings::~NetworkSettings() {
88 0, 85 0,
89 tr( "Saving setup" ), S ); 86 tr( "Saving setup" ), S );
90 } 87 }
91} 88}
92 89
93void NetworkSettings::SLOT_RefreshStates( void ) { 90void NetworkSettings::SLOT_RefreshStates( void ) {
94 QIconViewItem * IVI = Profiles_IV->currentItem(); // remeber 91 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); // remember
95 92
96 if( IVI ) { 93 if( LBI ) {
97 NodeCollection * NC; 94 NodeCollection * NC;
98 NSResources->system().probeInterfaces(); 95 NSResources->system().probeInterfaces();
99 // update current selection only 96 // update current selection only
100 NC = NSResources->findConnection( IVI->text() ); 97 NC = NSResources->findConnection( LBI->text() );
101 if( NC ) { 98 if( NC ) {
102 State_t OldS = NC->state(); 99 State_t OldS = NC->state();
103 State_t NewS = NC->state(1); 100 State_t NewS = NC->state(1);
104 if( OldS != NewS ) { 101 if( OldS != NewS ) {
105 updateProfileState( IVI ); 102 updateProfileState( LBI );
106 } 103 }
107 } 104 }
108 } 105 }
109 106
110 107
111 /* -> LATER !! 108 /* -> LATER !!
@@ -135,35 +132,35 @@ void NetworkSettings::SLOT_RefreshStates( void ) {
135 132
136void NetworkSettings::SLOT_AddNode( void ) { 133void NetworkSettings::SLOT_AddNode( void ) {
137 SLOT_EditNode( 0 ); 134 SLOT_EditNode( 0 );
138} 135}
139 136
140void NetworkSettings::SLOT_DeleteNode( void ) { 137void NetworkSettings::SLOT_DeleteNode( void ) {
141 QIconViewItem * IVI = Profiles_IV->currentItem(); 138 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
142 139
143 if ( ! IVI ) 140 if ( ! LBI )
144 return; 141 return;
145 142
146 if( QMessageBox::warning( 143 if( QMessageBox::warning(
147 0, 144 0,
148 tr( "Removing profile" ), 145 tr( "Removing profile" ),
149 tr( "Remove selected profile ?" ), 146 tr( "Remove selected profile ?" ),
150 1, 0 ) == 1 ) { 147 1, 0 ) == 1 ) {
151 NSResources->removeConnection( IVI->text() ); 148 NSResources->removeConnection( LBI->text() );
152 delete IVI; 149 delete LBI;
153 setModified( 1 ); 150 setModified( 1 );
154 NSD.forceGeneration(1); 151 NSD.forceGeneration(1);
155 } 152 }
156} 153}
157 154
158void NetworkSettings::SLOT_EditNode( QIconViewItem * IVI ) { 155void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
159 QString OldName = ""; 156 QString OldName = "";
160 EditConnection EC( this ); 157 EditConnection EC( this );
161 158
162 if( IVI ) { 159 if( LBI ) {
163 NodeCollection * NC = NSResources->findConnection( IVI->text() ); 160 NodeCollection * NC = NSResources->findConnection( LBI->text() );
164 if( ! NC ) { 161 if( ! NC ) {
165 return; 162 return;
166 } 163 }
167 OldName = NC->name(); 164 OldName = NC->name();
168 EC.setConnection( NC ); 165 EC.setConnection( NC );
169 } 166 }
@@ -173,47 +170,47 @@ void NetworkSettings::SLOT_EditNode( QIconViewItem * IVI ) {
173 UpdateTimer->stop(); 170 UpdateTimer->stop();
174 if( EC.exec() == QDialog::Accepted ) { 171 if( EC.exec() == QDialog::Accepted ) {
175 // toplevel item -> store 172 // toplevel item -> store
176 NodeCollection * NC = EC.connection(); 173 NodeCollection * NC = EC.connection();
177 if( NC->isModified() ) { 174 if( NC->isModified() ) {
178 setModified( 1 ); 175 setModified( 1 );
179 if( IVI ) { 176 if( LBI ) {
180 // new name -> remove item 177 // new name -> remove item
181 NSResources->removeConnection( OldName ); 178 NSResources->removeConnection( OldName );
182 // must add it here since change will trigger event 179 // must add it here since change will trigger event
183 NSResources->addConnection( NC ); 180 NSResources->addConnection( NC );
184 IVI->setText( NC->name() ); 181 Profiles_LB->changeItem( NC->devicePixmap(),
185 IVI->setPixmap( NC->devicePixmap() ); 182 NC->name(),
183 Profiles_LB->index( LBI )
184 );
186 } else { 185 } else {
187 // new item 186 // new item
187 int ci = Profiles_LB->count();
188 NSResources->addConnection( NC ); 188 NSResources->addConnection( NC );
189 NC->setNumber( NC->maxConnectionNumber()+1 ); 189 NC->setNumber( NC->maxConnectionNumber()+1 );
190 IVI = new QIconViewItem( Profiles_IV, 190 Profiles_LB->insertItem( NC->devicePixmap(), NC->name() );
191 NC->name(), 191 Profiles_LB->setSelected( ci, TRUE );
192 NC->devicePixmap()
193 );
194 Profiles_IV->setSelected( IVI, TRUE );
195 } 192 }
196 updateProfileState( IVI ); 193 updateProfileState( LBI );
197 } 194 }
198 } else { 195 } else {
199 // cancelled : reset connection 196 // cancelled : reset connection
200 if( IVI ) { 197 if( LBI ) {
201 NodeCollection * NC = NSResources->findConnection( IVI->text() ); 198 NodeCollection * NC = NSResources->findConnection( LBI->text() );
202 NC->reassign(); 199 NC->reassign();
203 } 200 }
204 } 201 }
205 // reenable 202 // reenable
206 UpdateTimer->start( 5000 ); 203 UpdateTimer->start( 5000 );
207} 204}
208 205
209void NetworkSettings::SLOT_ShowNode( QIconViewItem * IVI ) { 206void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) {
210 if( IVI == 0 ) 207 if( LBI == 0 )
211 return; 208 return;
212 209
213 NodeCollection * NC = NSResources->findConnection( IVI->text() ); 210 NodeCollection * NC = NSResources->findConnection( LBI->text() );
214 211
215 // is button possible 212 // is button possible
216 bool EnabledPossible, OnPossible, ConnectPossible; 213 bool EnabledPossible, OnPossible, ConnectPossible;
217 // is button On or Off 214 // is button On or Off
218 bool DisabledOn, OnOn, ConnectOn; 215 bool DisabledOn, OnOn, ConnectOn;
219 216
@@ -258,26 +255,26 @@ void NetworkSettings::SLOT_ShowNode( QIconViewItem * IVI ) {
258 if( NC->description().isEmpty() ) { 255 if( NC->description().isEmpty() ) {
259 Description_LBL->setText( tr( "No description" ) ); 256 Description_LBL->setText( tr( "No description" ) );
260 } else { 257 } else {
261 Description_LBL->setText( NC->description() ); 258 Description_LBL->setText( NC->description() );
262 } 259 }
263 260
264 CurProfile_GB->setTitle( IVI->text() ); 261 CurProfile_GB->setTitle( LBI->text() );
265 State_LBL->setText( NC->stateName() ); 262 State_LBL->setText( NC->stateName() );
266} 263}
267 264
268void NetworkSettings::SLOT_CheckState( void ) { 265void NetworkSettings::SLOT_CheckState( void ) {
269 QIconViewItem * IVI = Profiles_IV->currentItem(); 266 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
270 if ( ! IVI ) 267 if ( ! LBI )
271 return; 268 return;
272 updateProfileState( IVI ); 269 updateProfileState( LBI );
273} 270}
274 271
275void NetworkSettings::updateProfileState( QIconViewItem * IVI ) { 272void NetworkSettings::updateProfileState( QListBoxItem * LBI ) {
276 if( IVI == Profiles_IV->currentItem() ) { 273 if( LBI == Profiles_LB->item( Profiles_LB->currentItem() ) ) {
277 SLOT_ShowNode( IVI ); 274 SLOT_ShowNode( LBI );
278 } 275 }
279} 276}
280 277
281void NetworkSettings::SLOT_GenerateConfig( void ) { 278void NetworkSettings::SLOT_GenerateConfig( void ) {
282 QString S = NSD.generateSettings( TRUE ); 279 QString S = NSD.generateSettings( TRUE );
283 280
@@ -288,19 +285,19 @@ void NetworkSettings::SLOT_GenerateConfig( void ) {
288 S 285 S
289 ); 286 );
290 } 287 }
291} 288}
292 289
293void NetworkSettings::SLOT_Enable( void ) { 290void NetworkSettings::SLOT_Enable( void ) {
294 QIconViewItem * IVI = Profiles_IV->currentItem(); 291 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
295 QString Msg; 292 QString Msg;
296 if ( ! IVI ) 293 if ( ! LBI )
297 return; 294 return;
298 295
299 NodeCollection * NC = 296 NodeCollection * NC =
300 NSResources->findConnection( IVI->text() ); 297 NSResources->findConnection( LBI->text() );
301 298
302 bool rv; 299 bool rv;
303 switch( NC->state() ) { 300 switch( NC->state() ) {
304 case Disabled : 301 case Disabled :
305 Msg = tr( "Cannot enable profile" ); 302 Msg = tr( "Cannot enable profile" );
306 rv = NC->setState( Enable ); 303 rv = NC->setState( Enable );
@@ -315,23 +312,23 @@ void NetworkSettings::SLOT_Enable( void ) {
315 QMessageBox::warning( 312 QMessageBox::warning(
316 0, 313 0,
317 tr( "Activating profile" ), 314 tr( "Activating profile" ),
318 Msg ); 315 Msg );
319 return; 316 return;
320 } 317 }
321 updateProfileState( IVI ); 318 updateProfileState( LBI );
322} 319}
323 320
324void NetworkSettings::SLOT_On( void ) { 321void NetworkSettings::SLOT_On( void ) {
325 QIconViewItem * IVI = Profiles_IV->currentItem(); 322 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
326 323
327 if ( ! IVI ) 324 if ( ! LBI )
328 return; 325 return;
329 326
330 NodeCollection * NC = 327 NodeCollection * NC =
331 NSResources->findConnection( IVI->text() ); 328 NSResources->findConnection( LBI->text() );
332 329
333 bool rv; 330 bool rv;
334 switch( NC->state() ) { 331 switch( NC->state() ) {
335 case Off : 332 case Off :
336 // activate interface 333 // activate interface
337 rv = NC->setState( Activate ); 334 rv = NC->setState( Activate );
@@ -354,23 +351,23 @@ void NetworkSettings::SLOT_On( void ) {
354 QMessageBox::warning( 351 QMessageBox::warning(
355 0, 352 0,
356 tr( "Activating profile" ), 353 tr( "Activating profile" ),
357 tr( "Cannot enable profile" ) ); 354 tr( "Cannot enable profile" ) );
358 return; 355 return;
359 } 356 }
360 updateProfileState( IVI ); 357 updateProfileState( LBI );
361} 358}
362 359
363void NetworkSettings::SLOT_Connect( void ) { 360void NetworkSettings::SLOT_Connect( void ) {
364 QIconViewItem * IVI = Profiles_IV->currentItem(); 361 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
365 362
366 if ( ! IVI ) 363 if ( ! LBI )
367 return; 364 return;
368 365
369 NodeCollection * NC = 366 NodeCollection * NC =
370 NSResources->findConnection( IVI->text() ); 367 NSResources->findConnection( LBI->text() );
371 368
372 bool rv; 369 bool rv;
373 switch( NC->state() ) { 370 switch( NC->state() ) {
374 case IsUp : 371 case IsUp :
375 // down interface 372 // down interface
376 rv = NC->setState( Down ); 373 rv = NC->setState( Down );
diff --git a/noncore/settings/networksettings2/networksettings.h b/noncore/settings/networksettings2/networksettings.h
index fadf81b..d9ea5d4 100644
--- a/noncore/settings/networksettings2/networksettings.h
+++ b/noncore/settings/networksettings2/networksettings.h
@@ -2,13 +2,13 @@
2#include "networksettingsGUI.h" 2#include "networksettingsGUI.h"
3#include "resources.h" 3#include "resources.h"
4 4
5class ANetNode; 5class ANetNode;
6class ANetNodeInstance; 6class ANetNodeInstance;
7class QTimer; 7class QTimer;
8class QIconViewItem; 8class QListBoxItem;
9 9
10class NetworkSettings : public NetworkSettingsGUI { 10class NetworkSettings : public NetworkSettingsGUI {
11 11
12 Q_OBJECT 12 Q_OBJECT
13 13
14public : 14public :
@@ -27,23 +27,23 @@ public :
27 { NSD.setModified( m ); } 27 { NSD.setModified( m ); }
28 28
29public slots : 29public slots :
30 30
31 void SLOT_AddNode( void ); 31 void SLOT_AddNode( void );
32 void SLOT_DeleteNode( void ); 32 void SLOT_DeleteNode( void );
33 void SLOT_ShowNode( QIconViewItem * ); 33 void SLOT_ShowNode( QListBoxItem * );
34 void SLOT_EditNode( QIconViewItem * ); 34 void SLOT_EditNode( QListBoxItem * );
35 void SLOT_CheckState( void ); 35 void SLOT_CheckState( void );
36 void SLOT_Enable( void ); 36 void SLOT_Enable( void );
37 void SLOT_On( void ); 37 void SLOT_On( void );
38 void SLOT_Connect( void ); 38 void SLOT_Connect( void );
39 void SLOT_GenerateConfig( void ); 39 void SLOT_GenerateConfig( void );
40 void SLOT_RefreshStates( void ); 40 void SLOT_RefreshStates( void );
41 void SLOT_QCopMessage( const QCString&,const QByteArray& ); 41 void SLOT_QCopMessage( const QCString&,const QByteArray& );
42 42
43private : 43private :
44 44
45 void updateProfileState( QIconViewItem * it ); 45 void updateProfileState( QListBoxItem * it );
46 QTimer * UpdateTimer; 46 QTimer * UpdateTimer;
47 NetworkSettingsData NSD; 47 NetworkSettingsData NSD;
48 48
49}; 49};
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.cpp b/noncore/settings/networksettings2/networksettings2/netnode.cpp
index d36a1e5..f040c99 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.cpp
+++ b/noncore/settings/networksettings2/networksettings2/netnode.cpp
@@ -229,14 +229,14 @@ static char * State2PixmapTbl[] = {
229 "off", // off 229 "off", // off
230 "disconnected", // available 230 "disconnected", // available
231 "connected" // up 231 "connected" // up
232}; 232};
233 233
234QPixmap NodeCollection::devicePixmap( void ) { 234QPixmap NodeCollection::devicePixmap( void ) {
235 return NSResources->getPixmap( 235 return NSResources->getPixmap(
236 device()->netNode()->pixmapName()+"-large" ); 236 device()->netNode()->pixmapName()+"-large" );
237} 237}
238 238
239QPixmap NodeCollection::statePixmap( State_t S) { 239QPixmap NodeCollection::statePixmap( State_t S) {
240 return NSResources->getPixmap( State2PixmapTbl[S] ); 240 return NSResources->getPixmap( State2PixmapTbl[S] );
241} 241}
242 242
diff --git a/noncore/settings/networksettings2/networksettings2/resources.cpp b/noncore/settings/networksettings2/networksettings2/resources.cpp
index 15e1b64..0301361 100644
--- a/noncore/settings/networksettings2/networksettings2/resources.cpp
+++ b/noncore/settings/networksettings2/networksettings2/resources.cpp
@@ -165,13 +165,16 @@ bool TheNSResources::loadNetNode(
165 } 165 }
166 166
167 return 1; 167 return 1;
168} 168}
169 169
170QPixmap TheNSResources::getPixmap( const QString & QS ) { 170QPixmap TheNSResources::getPixmap( const QString & QS ) {
171 return Resource::loadPixmap( QString("networksettings2")+QS ); 171 QString S("networksettings2/");
172 S += QS;
173 printf( " pixmap %s\n", S.latin1() );
174 return Resource::loadPixmap( QString("networksettings2/")+QS );
172} 175}
173 176
174QString TheNSResources::tr( const char * s ) { 177QString TheNSResources::tr( const char * s ) {
175 return qApp->translate( "resource", s ); 178 return qApp->translate( "resource", s );
176} 179}
177 180
diff --git a/noncore/settings/networksettings2/networksettings2/system.cpp b/noncore/settings/networksettings2/networksettings2/system.cpp
index 99f642e..85dcd7d 100644
--- a/noncore/settings/networksettings2/networksettings2/system.cpp
+++ b/noncore/settings/networksettings2/networksettings2/system.cpp
@@ -311,8 +311,9 @@ void System::probeInterfaces( void ) {
311 if( ioctl(sockfd, SIOCGIFNETMASK, &ifrs) >= 0 ) { 311 if( ioctl(sockfd, SIOCGIFNETMASK, &ifrs) >= 0 ) {
312 IFI->Netmask = 312 IFI->Netmask =
313 inet_ntoa(((struct sockaddr_in*)&ifrs.ifr_netmask)->sin_addr); 313 inet_ntoa(((struct sockaddr_in*)&ifrs.ifr_netmask)->sin_addr);
314 } else { 314 } else {
315 IFI->Netmask = ""; 315 IFI->Netmask = "";
316 } 316 }
317 fprintf( stderr, "NIC %s UP %d\n", NicName.latin1(), IFI->IsUp );
317 } 318 }
318} 319}
diff --git a/noncore/settings/networksettings2/networksettingsGUI.ui b/noncore/settings/networksettings2/networksettingsGUI.ui
index d457c35..1d79123 100644
--- a/noncore/settings/networksettings2/networksettingsGUI.ui
+++ b/noncore/settings/networksettings2/networksettingsGUI.ui
@@ -8,13 +8,13 @@
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>403</width> 14 <width>399</width>
15 <height>502</height> 15 <height>502</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Network Settings</string> 20 <string>Network Settings</string>
@@ -29,13 +29,13 @@
29 <property stdset="1"> 29 <property stdset="1">
30 <name>margin</name> 30 <name>margin</name>
31 <number>0</number> 31 <number>0</number>
32 </property> 32 </property>
33 <property stdset="1"> 33 <property stdset="1">
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>2</number> 35 <number>0</number>
36 </property> 36 </property>
37 <widget> 37 <widget>
38 <class>QFrame</class> 38 <class>QFrame</class>
39 <property stdset="1"> 39 <property stdset="1">
40 <name>name</name> 40 <name>name</name>
41 <cstring>Frame4</cstring> 41 <cstring>Frame4</cstring>
@@ -241,167 +241,32 @@
241 <bool>true</bool> 241 <bool>true</bool>
242 </property> 242 </property>
243 </widget> 243 </widget>
244 </hbox> 244 </hbox>
245 </widget> 245 </widget>
246 <widget> 246 <widget>
247 <class>QIconView</class> 247 <class>QListBox</class>
248 <item>
249 <property>
250 <name>text</name>
251 <string>New Item</string>
252 </property>
253 <property>
254 <name>pixmap</name>
255 <pixmap>image0</pixmap>
256 </property>
257 </item>
258 <item>
259 <property>
260 <name>text</name>
261 <string>New Item</string>
262 </property>
263 <property>
264 <name>pixmap</name>
265 <pixmap>image0</pixmap>
266 </property>
267 </item>
268 <item>
269 <property>
270 <name>text</name>
271 <string>New Item</string>
272 </property>
273 <property>
274 <name>pixmap</name>
275 <pixmap>image0</pixmap>
276 </property>
277 </item>
278 <item>
279 <property>
280 <name>text</name>
281 <string>New Item</string>
282 </property>
283 <property>
284 <name>pixmap</name>
285 <pixmap>image0</pixmap>
286 </property>
287 </item>
288 <item>
289 <property>
290 <name>text</name>
291 <string>New Item</string>
292 </property>
293 <property>
294 <name>pixmap</name>
295 <pixmap>image0</pixmap>
296 </property>
297 </item>
298 <item>
299 <property>
300 <name>text</name>
301 <string>New Item</string>
302 </property>
303 <property>
304 <name>pixmap</name>
305 <pixmap>image0</pixmap>
306 </property>
307 </item>
308 <item>
309 <property>
310 <name>text</name>
311 <string>New Item</string>
312 </property>
313 <property>
314 <name>pixmap</name>
315 <pixmap>image0</pixmap>
316 </property>
317 </item>
318 <item>
319 <property>
320 <name>text</name>
321 <string>New Item</string>
322 </property>
323 <property>
324 <name>pixmap</name>
325 <pixmap>image0</pixmap>
326 </property>
327 </item>
328 <item>
329 <property>
330 <name>text</name>
331 <string>New Item</string>
332 </property>
333 <property>
334 <name>pixmap</name>
335 <pixmap>image0</pixmap>
336 </property>
337 </item>
338 <item>
339 <property>
340 <name>text</name>
341 <string>New Item</string>
342 </property>
343 <property>
344 <name>pixmap</name>
345 <pixmap>image0</pixmap>
346 </property>
347 </item>
348 <item>
349 <property>
350 <name>text</name>
351 <string>New Item</string>
352 </property>
353 <property>
354 <name>pixmap</name>
355 <pixmap>image0</pixmap>
356 </property>
357 </item>
358 <item>
359 <property>
360 <name>text</name>
361 <string>New Item</string>
362 </property>
363 <property>
364 <name>pixmap</name>
365 <pixmap>image0</pixmap>
366 </property>
367 </item>
368 <item>
369 <property>
370 <name>text</name>
371 <string>New Item</string>
372 </property>
373 <property>
374 <name>pixmap</name>
375 <pixmap>image0</pixmap>
376 </property>
377 </item>
378 <property stdset="1"> 248 <property stdset="1">
379 <name>name</name> 249 <name>name</name>
380 <cstring>Profiles_IV</cstring> 250 <cstring>Profiles_LB</cstring>
381 </property>
382 <property stdset="1">
383 <name>spacing</name>
384 <number>5</number>
385 </property>
386 <property stdset="1">
387 <name>itemsMovable</name>
388 <bool>false</bool>
389 </property>
390 <property stdset="1">
391 <name>showToolTips</name>
392 <bool>false</bool>
393 </property> 251 </property>
394 </widget> 252 </widget>
395 <widget> 253 <widget>
396 <class>QGroupBox</class> 254 <class>QGroupBox</class>
397 <property stdset="1"> 255 <property stdset="1">
398 <name>name</name> 256 <name>name</name>
399 <cstring>CurProfile_GB</cstring> 257 <cstring>CurProfile_GB</cstring>
400 </property> 258 </property>
401 <property stdset="1"> 259 <property stdset="1">
260 <name>sizePolicy</name>
261 <sizepolicy>
262 <hsizetype>5</hsizetype>
263 <vsizetype>1</vsizetype>
264 </sizepolicy>
265 </property>
266 <property stdset="1">
402 <name>title</name> 267 <name>title</name>
403 <string></string> 268 <string></string>
404 </property> 269 </property>
405 <property> 270 <property>
406 <name>layoutMargin</name> 271 <name>layoutMargin</name>
407 </property> 272 </property>
@@ -515,18 +380,12 @@
515 </property> 380 </property>
516 </widget> 381 </widget>
517 </vbox> 382 </vbox>
518 </widget> 383 </widget>
519 </vbox> 384 </vbox>
520</widget> 385</widget>
521<images>
522 <image>
523 <name>image0</name>
524 <data format="XPM.GZ" length="1347">789c7dd3c14ac4301405d07dbf22f4ed8a743ace0882f8098a4b415ca4c92475310a3a2e44fc777393a64df2dabed7452e1c6eb368778d787e7a10cdaefabac8cb9b126a909fa2d1dfe7f3cfcbebfd6f551fae857bf69dd8d75755dd0a251e3fde4f38933b53e707b10f518df18478e8b08803e271c21af1e6168b681165e7f688681055874594211a13a242347efc95da9688dad58946ca75e58d6be9e5ba0a46e92d351a952aa2d3b2495459989849f949546632b5688c32c65aeadde428ed0132da23306e4c5863f1ba017042738f6fc138a5fdbd0a135b2203ec7bca7b723022e23d19628601cb0d6f59e8612dce0c2b2641658fb5650b375a0795a2c2b8afcaaba4859ba852c4cda4364da9964daed64caa60c2475d9a590503c54d54d1d0a2096abb67541bf79955fc0debbfbbea1f81b84f0e</data>
525 </image>
526</images>
527<connections> 386<connections>
528 <connection> 387 <connection>
529 <sender>Add_TB</sender> 388 <sender>Add_TB</sender>
530 <signal>clicked()</signal> 389 <signal>clicked()</signal>
531 <receiver>NetworkSettingsGUI</receiver> 390 <receiver>NetworkSettingsGUI</receiver>
532 <slot>SLOT_AddNode()</slot> 391 <slot>SLOT_AddNode()</slot>
@@ -565,34 +424,34 @@
565 <sender>GenConfig_TB</sender> 424 <sender>GenConfig_TB</sender>
566 <signal>clicked()</signal> 425 <signal>clicked()</signal>
567 <receiver>NetworkSettingsGUI</receiver> 426 <receiver>NetworkSettingsGUI</receiver>
568 <slot>SLOT_GenerateConfig()</slot> 427 <slot>SLOT_GenerateConfig()</slot>
569 </connection> 428 </connection>
570 <connection> 429 <connection>
571 <sender>Profiles_IV</sender> 430 <sender>Profiles_LB</sender>
572 <signal>selectionChanged(QIconViewItem*)</signal> 431 <signal>clicked(QListBoxItem*)</signal>
573 <receiver>NetworkSettingsGUI</receiver> 432 <receiver>NetworkSettingsGUI</receiver>
574 <slot>SLOT_ShowNode( QIconViewItem*)</slot> 433 <slot>SLOT_ShowNode( QListBoxItem*)</slot>
575 </connection> 434 </connection>
576 <connection> 435 <connection>
577 <sender>Profiles_IV</sender> 436 <sender>Profiles_LB</sender>
578 <signal>doubleClicked(QIconViewItem*)</signal> 437 <signal>currentChanged(QListBoxItem*)</signal>
579 <receiver>NetworkSettingsGUI</receiver> 438 <receiver>NetworkSettingsGUI</receiver>
580 <slot>SLOT_EditNode( QIconViewItem*)</slot> 439 <slot>SLOT_ShowNode( QListBoxItem*)</slot>
581 </connection> 440 </connection>
582 <connection> 441 <connection>
583 <sender>Profiles_IV</sender> 442 <sender>Profiles_LB</sender>
584 <signal>currentChanged(QIconViewItem*)</signal> 443 <signal>doubleClicked(QListBoxItem*)</signal>
585 <receiver>NetworkSettingsGUI</receiver> 444 <receiver>NetworkSettingsGUI</receiver>
586 <slot>SLOT_ShowNode( QIconViewItem*)</slot> 445 <slot>SLOT_EditNode( QListBoxItem *)</slot>
587 </connection> 446 </connection>
588 <slot access="public">SLOT_AddNode()</slot> 447 <slot access="public">SLOT_AddNode()</slot>
589 <slot access="public">SLOT_CheckState()</slot> 448 <slot access="public">SLOT_CheckState()</slot>
590 <slot access="public">SLOT_Connect()</slot> 449 <slot access="public">SLOT_Connect()</slot>
591 <slot access="public">SLOT_DeleteNode()</slot> 450 <slot access="public">SLOT_DeleteNode()</slot>
592 <slot access="public">SLOT_EditNode( QIconViewItem*)</slot> 451 <slot access="public">SLOT_EditNode( QListBoxItem *)</slot>
593 <slot access="public">SLOT_Enable()</slot> 452 <slot access="public">SLOT_Enable()</slot>
594 <slot access="public">SLOT_GenerateConfig()</slot> 453 <slot access="public">SLOT_GenerateConfig()</slot>
595 <slot access="public">SLOT_On()</slot> 454 <slot access="public">SLOT_On()</slot>
596 <slot access="public">SLOT_ShowNode( QIconViewItem*)</slot> 455 <slot access="public">SLOT_ShowNode( QListBoxItem*)</slot>
597</connections> 456</connections>
598</UI> 457</UI>
diff --git a/noncore/settings/networksettings2/nsdata.cpp b/noncore/settings/networksettings2/nsdata.cpp
index 9b2ad3a..3f5e958 100644
--- a/noncore/settings/networksettings2/nsdata.cpp
+++ b/noncore/settings/networksettings2/nsdata.cpp
@@ -16,12 +16,13 @@ NetworkSettingsData::NetworkSettingsData( void ) {
16 new TheNSResources(); 16 new TheNSResources();
17 17
18 CfgFile.sprintf( "%s/NETCONFIG", getenv("HOME") ); 18 CfgFile.sprintf( "%s/NETCONFIG", getenv("HOME") );
19 19
20 // load settings 20 // load settings
21 Force = 0; 21 Force = 0;
22 IsModified = 0;
22 loadSettings(); 23 loadSettings();
23} 24}
24 25
25// saving is done by caller 26// saving is done by caller
26NetworkSettingsData::~NetworkSettingsData( void ) { 27NetworkSettingsData::~NetworkSettingsData( void ) {
27 delete NSResources; 28 delete NSResources;
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.h b/noncore/settings/networksettings2/ppp/ppp_NN.h
index a933523..3f9a338 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NN.h
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.h
@@ -12,13 +12,13 @@ class PPPNetNode : public ANetNode{
12public: 12public:
13 13
14 PPPNetNode(); 14 PPPNetNode();
15 virtual ~PPPNetNode(); 15 virtual ~PPPNetNode();
16 16
17 virtual const QString pixmapName() 17 virtual const QString pixmapName()
18 { return "ppp"; } 18 { return "Devices/ppp"; }
19 19
20 virtual const QString nodeName() 20 virtual const QString nodeName()
21 { return tr("PPP Connection"); } 21 { return tr("PPP Connection"); }
22 22
23 virtual const QString nodeDescription() ; 23 virtual const QString nodeDescription() ;
24 24
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.h b/noncore/settings/networksettings2/ppp/ppp_NNI.h
index 08dca1d..a17721a 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NNI.h
+++ b/noncore/settings/networksettings2/ppp/ppp_NNI.h
@@ -18,13 +18,13 @@ public :
18 QString acceptable( void ); 18 QString acceptable( void );
19 void commit( void ); 19 void commit( void );
20 20
21 RuntimeInfo * runtime( void ) 21 RuntimeInfo * runtime( void )
22 { if( RT == 0 ) 22 { if( RT == 0 )
23 RT = new PPPRun( this, Data ); 23 RT = new PPPRun( this, Data );
24 return RT; 24 return RT->runtimeInfo();
25 } 25 }
26 26
27 virtual void * data( void ) 27 virtual void * data( void )
28 { return (void *)&Data; } 28 { return (void *)&Data; }
29 29
30protected : 30protected :
diff --git a/noncore/settings/networksettings2/ppp/ppprun.cpp b/noncore/settings/networksettings2/ppp/ppprun.cpp
index 8933f85..4ac0c5a 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.cpp
+++ b/noncore/settings/networksettings2/ppp/ppprun.cpp
@@ -1,20 +1,33 @@
1#include <resources.h> 1#include <resources.h>
2#include "ppprun.h" 2#include "ppprun.h"
3 3
4PPPRun::PPPRun( ANetNodeInstance * NNI, PPPData & Data ) :
5 AsConnection( NNI ), AsDevice( NNI ), Pat( "eth[0-9]" ) {
6 D = &Data;
7}
8
4void PPPRun::detectState( NodeCollection * NC ) { 9void PPPRun::detectState( NodeCollection * NC ) {
5 if( isMyPPPDRunning( ) ) { 10 if( isMyPPPDRunning( ) ) {
6 if( isMyPPPUp() ) { 11 if( isMyPPPUp() ) {
7 NC->setCurrentState( IsUp ); 12 NC->setCurrentState( IsUp );
8 } else { 13 } else {
9 NC->setCurrentState( Available ); 14 NC->setCurrentState( Available );
10 } 15 }
11 } else { 16 } else {
12 NC->setCurrentState( Off ); // at least this 17 NC->setCurrentState( Off ); // at least this
13 // but could also be unavailable 18 // but could also be unavailable
14 netNode()->nextNode()->runtime()->detectState( NC ); 19 ANetNodeInstance * NNI;
20 RuntimeInfo * RI;
21 NNI = AsDevice::netNode();
22 printf( "%p\n", NNI );
23 NNI = NNI->nextNode();
24 printf( "%p\n", NNI );
25 RI = NNI->runtime();
26 printf( "%p\n", RI );
27 RI->detectState( NC );
15 } 28 }
16} 29}
17 30
18bool PPPRun::setState( NodeCollection * NC, Action_t A ) { 31bool PPPRun::setState( NodeCollection * NC, Action_t A ) {
19 switch( A ) { 32 switch( A ) {
20 case Activate : 33 case Activate :
@@ -49,24 +62,24 @@ bool PPPRun::setState( NodeCollection * NC, Action_t A ) {
49bool PPPRun::isMyPPPDRunning( void ) { 62bool PPPRun::isMyPPPDRunning( void ) {
50 return 0; 63 return 0;
51} 64}
52 65
53bool PPPRun::isMyPPPUp( void ) { 66bool PPPRun::isMyPPPUp( void ) {
54 System & S = NSResources->system(); 67 System & S = NSResources->system();
55 InterfaceInfo * best = 0, * Run; 68 InterfaceInfo * Run;
56 QRegExp R( "ppp[0-9]" ); 69 QRegExp R( "ppp[0-9]" );
57 70
58 for( QDictIterator<InterfaceInfo> It(S.interfaces()); 71 for( QDictIterator<InterfaceInfo> It(S.interfaces());
59 It.current(); 72 It.current();
60 ++It ) { 73 ++It ) {
61 Run = It.current(); 74 Run = It.current();
62 if( R.match( Run->Name ) >= 0 && 75 if( R.match( Run->Name ) >= 0 &&
63 Run->IsPointToPoint 76 Run->IsPointToPoint
64 ) { 77 ) {
65 // this is a LAN card 78 // this is a LAN card
66 if( Run->assignedNode() == netNode() ) { 79 if( Run->assignedNode() == AsDevice::netNode() ) {
67 // assigned to us 80 // assigned to us
68 return 1; 81 return 1;
69 } 82 }
70 } 83 }
71 } 84 }
72 return 0; 85 return 0;
diff --git a/noncore/settings/networksettings2/ppp/ppprun.h b/noncore/settings/networksettings2/ppp/ppprun.h
index 76a05be..abb9176 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.h
+++ b/noncore/settings/networksettings2/ppp/ppprun.h
@@ -1,29 +1,35 @@
1#ifndef PPPRUN_H 1#ifndef PPPRUN_H
2#define PPPRUN_H 2#define PPPRUN_H
3 3
4#include <qregexp.h> 4#include <qregexp.h>
5#include <asconnection.h> 5#include <asconnection.h>
6#include <asdevice.h>
6#include "pppdata.h" 7#include "pppdata.h"
7 8
8class PPPRun : public AsConnection { 9class PPPRun : public AsConnection, public AsDevice {
9 10
10public : 11public :
11 12
12 PPPRun( ANetNodeInstance * NNI, 13 PPPRun( ANetNodeInstance * NNI,
13 PPPData & Data ) : 14 PPPData & Data );
14 AsConnection( NNI ), 15 virtual QString genNic( long NicNr )
15 Pat( "eth[0-9]" ) 16 { QString S; return S.sprintf( "ppp%ld", NicNr ); }
16 { D = &Data; }
17 17
18protected : 18 virtual AsDevice * device( void )
19 { return AsDevice::asDevice(); }
20 virtual RuntimeInfo * runtimeInfo( void )
21 { return ( AsConnection *)this; }
22
23 protected :
19 24
20 void detectState( NodeCollection * NC ); 25 void detectState( NodeCollection * NC );
21 bool setState( NodeCollection * NC, Action_t A ); 26 bool setState( NodeCollection * NC, Action_t A );
22 bool canSetState( State_t S, Action_t A ) 27 bool canSetState( State_t S, Action_t A )
23 { return connection()->findNext( netNode() )->runtime()->canSetState( S,A ); } 28 { return AsDevice::connection()->findNext(
29 AsDevice::netNode() )->runtime()->canSetState( S,A ); }
24 30
25 bool handlesInterface( const QString & I ); 31 bool handlesInterface( const QString & I );
26 32
27private : 33private :
28 34
29 bool isMyPPPDRunning( void ); 35 bool isMyPPPDRunning( void );
diff --git a/noncore/settings/networksettings2/profile/profile_NN.h b/noncore/settings/networksettings2/profile/profile_NN.h
index 2b469c7..3c06947 100644
--- a/noncore/settings/networksettings2/profile/profile_NN.h
+++ b/noncore/settings/networksettings2/profile/profile_NN.h
@@ -12,13 +12,13 @@ class ProfileNetNode : public ANetNode{
12public: 12public:
13 13
14 ProfileNetNode(); 14 ProfileNetNode();
15 virtual ~ProfileNetNode(); 15 virtual ~ProfileNetNode();
16 16
17 virtual const QString pixmapName() 17 virtual const QString pixmapName()
18 { return "commprofile"; } 18 { return "Devices/commprofile"; }
19 19
20 virtual const QString nodeName() 20 virtual const QString nodeName()
21 { return tr("Regular profile"); } 21 { return tr("Regular profile"); }
22 22
23 virtual const QString nodeDescription() ; 23 virtual const QString nodeDescription() ;
24 24
diff --git a/noncore/settings/networksettings2/usb/usb_NN.h b/noncore/settings/networksettings2/usb/usb_NN.h
index 3871afc..8b97452 100644
--- a/noncore/settings/networksettings2/usb/usb_NN.h
+++ b/noncore/settings/networksettings2/usb/usb_NN.h
@@ -12,13 +12,13 @@ class USBNetNode : public ANetNode{
12public: 12public:
13 13
14 USBNetNode(); 14 USBNetNode();
15 virtual ~USBNetNode(); 15 virtual ~USBNetNode();
16 16
17 virtual const QString pixmapName() 17 virtual const QString pixmapName()
18 { return "usb"; } 18 { return "Devices/usb"; }
19 19
20 virtual const QString nodeName() 20 virtual const QString nodeName()
21 { return tr("USB Cable Connect"); } 21 { return tr("USB Cable Connect"); }
22 22
23 virtual const QString nodeDescription() ; 23 virtual const QString nodeDescription() ;
24 24
diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.h b/noncore/settings/networksettings2/vpn/vpn_NN.h
index 5718961..a113ab9 100644
--- a/noncore/settings/networksettings2/vpn/vpn_NN.h
+++ b/noncore/settings/networksettings2/vpn/vpn_NN.h
@@ -12,13 +12,13 @@ class VPNNetNode : public ANetNode{
12public: 12public:
13 13
14 VPNNetNode(); 14 VPNNetNode();
15 virtual ~VPNNetNode(); 15 virtual ~VPNNetNode();
16 16
17 virtual const QString pixmapName() 17 virtual const QString pixmapName()
18 { return "vpn"; } 18 { return "Devices/vpn"; }
19 19
20 virtual const QString nodeName() 20 virtual const QString nodeName()
21 { return tr("VPN Connection"); } 21 { return tr("VPN Connection"); }
22 22
23 virtual const QString nodeDescription() ; 23 virtual const QString nodeDescription() ;
24 24
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.h b/noncore/settings/networksettings2/wlan/wlan_NN.h
index d1d6ded..0728a79 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NN.h
+++ b/noncore/settings/networksettings2/wlan/wlan_NN.h
@@ -12,13 +12,13 @@ class WLanNetNode : public ANetNode{
12public: 12public:
13 13
14 WLanNetNode(); 14 WLanNetNode();
15 virtual ~WLanNetNode(); 15 virtual ~WLanNetNode();
16 16
17 virtual const QString pixmapName() 17 virtual const QString pixmapName()
18 { return "wlan"; } 18 { return "Devices/wlan"; }
19 19
20 virtual const QString nodeName() 20 virtual const QString nodeName()
21 { return tr("WLan Device"); } 21 { return tr("WLan Device"); }
22 22
23 virtual const QString nodeDescription() ; 23 virtual const QString nodeDescription() ;
24 24