summaryrefslogtreecommitdiff
path: root/noncore
authorwimpie <wimpie>2004-04-04 00:27:59 (UTC)
committer wimpie <wimpie>2004-04-04 00:27:59 (UTC)
commita416c6c9630d6d63ee63cf520953b86af8b7cddc (patch) (unidiff)
treedbd0f5173728129f5a3faffdafd4f73d8cc72407 /noncore
parent152ffce2a4e8191d28738e3b40d8a726250a8767 (diff)
downloadopie-a416c6c9630d6d63ee63cf520953b86af8b7cddc.zip
opie-a416c6c9630d6d63ee63cf520953b86af8b7cddc.tar.gz
opie-a416c6c9630d6d63ee63cf520953b86af8b7cddc.tar.bz2
*** empty log message ***
Diffstat (limited to 'noncore') (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
@@ -19,7 +19,7 @@ public :
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 }
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
@@ -15,7 +15,7 @@ public:
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"); }
@@ -46,7 +46,7 @@ public:
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"); }
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
@@ -15,7 +15,7 @@ public:
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"); }
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
@@ -289,7 +289,7 @@ void EditConnection::buildFullTree( void ) {
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 );
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
@@ -15,7 +15,7 @@ public:
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"); }
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
@@ -15,7 +15,7 @@ public:
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"); }
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
@@ -88,9 +88,9 @@ int main( int argc, char * argv[] ) {
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;
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
@@ -15,7 +15,7 @@ public:
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"); }
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
@@ -15,7 +15,7 @@ public:
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"); }
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
@@ -26,7 +26,7 @@ bool NetworkRun::setState( NodeCollection * NC, Action_t A ) {
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 }
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,7 +1,7 @@
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>
@@ -35,24 +35,21 @@ NetworkSettings::NetworkSettings( QWidget *parent,
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
@@ -91,18 +88,18 @@ NetworkSettings::~NetworkSettings() {
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 }
@@ -138,9 +135,9 @@ void NetworkSettings::SLOT_AddNode( void ) {
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(
@@ -148,19 +145,19 @@ void NetworkSettings::SLOT_DeleteNode( void ) {
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 }
@@ -176,29 +173,29 @@ void NetworkSettings::SLOT_EditNode( QIconViewItem * IVI ) {
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 }
@@ -206,11 +203,11 @@ void NetworkSettings::SLOT_EditNode( QIconViewItem * IVI ) {
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;
@@ -261,20 +258,20 @@ void NetworkSettings::SLOT_ShowNode( QIconViewItem * IVI ) {
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
@@ -291,13 +288,13 @@ void NetworkSettings::SLOT_GenerateConfig( void ) {
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() ) {
@@ -318,17 +315,17 @@ void NetworkSettings::SLOT_Enable( void ) {
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() ) {
@@ -357,17 +354,17 @@ void NetworkSettings::SLOT_On( void ) {
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() ) {
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
@@ -5,7 +5,7 @@
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
@@ -30,8 +30,8 @@ public 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 );
@@ -42,7 +42,7 @@ public slots :
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
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
@@ -232,8 +232,8 @@ static char * State2PixmapTbl[] = {
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) {
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
@@ -168,7 +168,10 @@ bool TheNSResources::loadNetNode(
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 ) {
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
@@ -314,5 +314,6 @@ void System::probeInterfaces( void ) {
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
@@ -11,7 +11,7 @@
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>
@@ -32,7 +32,7 @@
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>
@@ -244,152 +244,10 @@
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>
@@ -399,6 +257,13 @@
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>
@@ -518,12 +383,6 @@
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>
@@ -568,31 +427,31 @@
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
@@ -19,6 +19,7 @@ NetworkSettingsData::NetworkSettingsData( void ) {
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
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
@@ -15,7 +15,7 @@ public:
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"); }
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
@@ -21,7 +21,7 @@ public :
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 )
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,6 +1,11 @@
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() ) {
@@ -11,7 +16,15 @@ void PPPRun::detectState( NodeCollection * NC ) {
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
@@ -52,7 +65,7 @@ bool PPPRun::isMyPPPDRunning( void ) {
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());
@@ -63,7 +76,7 @@ bool PPPRun::isMyPPPUp( void ) {
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 }
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
@@ -3,24 +3,30 @@
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
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
@@ -15,7 +15,7 @@ public:
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"); }
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
@@ -15,7 +15,7 @@ public:
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"); }
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
@@ -15,7 +15,7 @@ public:
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"); }
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
@@ -15,7 +15,7 @@ public:
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"); }