summaryrefslogtreecommitdiff
authorwimpie <wimpie>2004-04-10 13:06:13 (UTC)
committer wimpie <wimpie>2004-04-10 13:06:13 (UTC)
commitdb9f0e2a7fd93157d95f421534fcc3015abe53e0 (patch) (unidiff)
tree001918ca18d0d74f3e49597f766c070bea71e25c
parent6bcdc8cd41199dce849b800b4296011faf6281df (diff)
downloadopie-db9f0e2a7fd93157d95f421534fcc3015abe53e0.zip
opie-db9f0e2a7fd93157d95f421534fcc3015abe53e0.tar.gz
opie-db9f0e2a7fd93157d95f421534fcc3015abe53e0.tar.bz2
*** empty log message ***
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h2
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h2
-rw-r--r--noncore/settings/networksettings2/cable/cablerun.cpp2
-rw-r--r--noncore/settings/networksettings2/cable/cablerun.h2
-rw-r--r--noncore/settings/networksettings2/irda/irdarun.h2
-rw-r--r--noncore/settings/networksettings2/lancard/lancardrun.cpp2
-rw-r--r--noncore/settings/networksettings2/lancard/lancardrun.h2
-rw-r--r--noncore/settings/networksettings2/modem/modemrun.h2
-rw-r--r--noncore/settings/networksettings2/network/networkrun.cpp6
-rw-r--r--noncore/settings/networksettings2/network/networkrun.h2
-rw-r--r--noncore/settings/networksettings2/networksettings.cpp28
-rw-r--r--noncore/settings/networksettings2/networksettings.h3
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.cpp17
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.h6
-rw-r--r--noncore/settings/networksettings2/networksettings2/networksettings2.pro2
-rw-r--r--noncore/settings/networksettings2/networksettings2/resources.cpp3
-rw-r--r--noncore/settings/networksettings2/networksettingsGUI.ui207
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.cpp2
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.h2
-rw-r--r--noncore/settings/networksettings2/profile/profileedit.cpp13
-rw-r--r--noncore/settings/networksettings2/profile/profileedit.h2
-rw-r--r--noncore/settings/networksettings2/profile/profilerun.cpp2
-rw-r--r--noncore/settings/networksettings2/profile/profilerun.h2
-rw-r--r--noncore/settings/networksettings2/usb/usbrun.cpp2
-rw-r--r--noncore/settings/networksettings2/usb/usbrun.h2
-rw-r--r--noncore/settings/networksettings2/vpn/vpnrun.h2
-rw-r--r--noncore/settings/networksettings2/wlan/wlanGUI.ui480
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NNI.cpp114
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NNI.h2
-rw-r--r--noncore/settings/networksettings2/wlan/wlandata.h17
-rw-r--r--noncore/settings/networksettings2/wlan/wlanedit.cpp101
-rw-r--r--noncore/settings/networksettings2/wlan/wlanedit.h22
-rw-r--r--noncore/settings/networksettings2/wlan/wlanrun.cpp180
-rw-r--r--noncore/settings/networksettings2/wlan/wlanrun.h15
34 files changed, 957 insertions, 293 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
index 4a773cd..c168429 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
@@ -17,13 +17,13 @@ public :
17 17
18protected : 18protected :
19 19
20 void detectState( NodeCollection * ) 20 void detectState( NodeCollection * )
21 { } 21 { }
22 22
23 bool setState( NodeCollection * , Action_t ) 23 bool setState( NodeCollection * , Action_t, bool )
24 { return 0; } 24 { return 0; }
25 25
26 bool canSetState( State_t , Action_t ) 26 bool canSetState( State_t , Action_t )
27 { return 0; } 27 { return 0; }
28 28
29 bool handlesInterface( const QString & ) 29 bool handlesInterface( const QString & )
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h
index 6a7902a..aff1f59 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h
@@ -14,12 +14,12 @@ public :
14 14
15protected : 15protected :
16 16
17 void detectState( NodeCollection * ) 17 void detectState( NodeCollection * )
18 { } 18 { }
19 19
20 bool setState( NodeCollection * , Action_t ) 20 bool setState( NodeCollection * , Action_t, bool )
21 { return 0; } 21 { return 0; }
22 22
23 bool canSetState( State_t , Action_t ) 23 bool canSetState( State_t , Action_t )
24 { return 0; } 24 { return 0; }
25}; 25};
diff --git a/noncore/settings/networksettings2/cable/cablerun.cpp b/noncore/settings/networksettings2/cable/cablerun.cpp
index edb4b01..5e99237 100644
--- a/noncore/settings/networksettings2/cable/cablerun.cpp
+++ b/noncore/settings/networksettings2/cable/cablerun.cpp
@@ -10,13 +10,13 @@ void CableRun::detectState( NodeCollection * NC ) {
10 NC->setCurrentState( Unavailable ); 10 NC->setCurrentState( Unavailable );
11 } 11 }
12 close( fd ); 12 close( fd );
13 NC->setCurrentState( Available ); 13 NC->setCurrentState( Available );
14} 14}
15 15
16bool CableRun::setState( NodeCollection * NC, Action_t A ) { 16bool CableRun::setState( NodeCollection * NC, Action_t A, bool ) {
17 if( A == Activate ) { 17 if( A == Activate ) {
18 detectState(NC); 18 detectState(NC);
19 return (NC->currentState() == Available); 19 return (NC->currentState() == Available);
20 } 20 }
21 return 1; 21 return 1;
22} 22}
diff --git a/noncore/settings/networksettings2/cable/cablerun.h b/noncore/settings/networksettings2/cable/cablerun.h
index 7b341c4..c5b59d5 100644
--- a/noncore/settings/networksettings2/cable/cablerun.h
+++ b/noncore/settings/networksettings2/cable/cablerun.h
@@ -12,13 +12,13 @@ public :
12 virtual AsLine * asLine( void ) 12 virtual AsLine * asLine( void )
13 { return (AsLine *)this; } 13 { return (AsLine *)this; }
14 14
15protected : 15protected :
16 16
17 void detectState( NodeCollection * NC ); 17 void detectState( NodeCollection * NC );
18 bool setState( NodeCollection * NC, Action_t A ); 18 bool setState( NodeCollection * NC, Action_t A, bool Force );
19 bool canSetState( State_t Curr, Action_t A ); 19 bool canSetState( State_t Curr, Action_t A );
20 20
21private : 21private :
22 22
23 CableData_t * D; 23 CableData_t * D;
24}; 24};
diff --git a/noncore/settings/networksettings2/irda/irdarun.h b/noncore/settings/networksettings2/irda/irdarun.h
index d9fe5e8..4c903cc 100644
--- a/noncore/settings/networksettings2/irda/irdarun.h
+++ b/noncore/settings/networksettings2/irda/irdarun.h
@@ -14,12 +14,12 @@ public :
14 14
15protected : 15protected :
16 16
17 void detectState( NodeCollection * ) 17 void detectState( NodeCollection * )
18 { } 18 { }
19 19
20 bool setState( NodeCollection * , Action_t ) 20 bool setState( NodeCollection * , Action_t, bool )
21 { return 0; } 21 { return 0; }
22 22
23 bool canSetState( State_t , Action_t ) 23 bool canSetState( State_t , Action_t )
24 { return 0; } 24 { return 0; }
25}; 25};
diff --git a/noncore/settings/networksettings2/lancard/lancardrun.cpp b/noncore/settings/networksettings2/lancard/lancardrun.cpp
index 2e4fc43..1544ddc 100644
--- a/noncore/settings/networksettings2/lancard/lancardrun.cpp
+++ b/noncore/settings/networksettings2/lancard/lancardrun.cpp
@@ -70,13 +70,13 @@ void LanCardRun::detectState( NodeCollection * NC ) {
70 // no free found 70 // no free found
71 71
72 NC->setCurrentState( Unavailable ); 72 NC->setCurrentState( Unavailable );
73 73
74} 74}
75 75
76bool LanCardRun::setState( NodeCollection * NC, Action_t A ) { 76bool LanCardRun::setState( NodeCollection * NC, Action_t A, bool ) {
77 77
78 // we only handle activate and deactivate 78 // we only handle activate and deactivate
79 switch( A ) { 79 switch( A ) {
80 case Activate : 80 case Activate :
81 { 81 {
82 if( NC->currentState() != Off ) { 82 if( NC->currentState() != Off ) {
diff --git a/noncore/settings/networksettings2/lancard/lancardrun.h b/noncore/settings/networksettings2/lancard/lancardrun.h
index e8a535a..b28dda7 100644
--- a/noncore/settings/networksettings2/lancard/lancardrun.h
+++ b/noncore/settings/networksettings2/lancard/lancardrun.h
@@ -20,13 +20,13 @@ public :
20 virtual AsDevice * asDevice( void ) 20 virtual AsDevice * asDevice( void )
21 { return (AsDevice *)this; } 21 { return (AsDevice *)this; }
22 22
23protected : 23protected :
24 24
25 void detectState( NodeCollection * NC ); 25 void detectState( NodeCollection * NC );
26 bool setState( NodeCollection * NC, Action_t A ); 26 bool setState( NodeCollection * NC, Action_t A, bool Force );
27 bool canSetState( State_t Curr, Action_t A ); 27 bool canSetState( State_t Curr, Action_t A );
28 28
29 bool handlesInterface( const QString & I ); 29 bool handlesInterface( const QString & I );
30 bool handlesInterface( const InterfaceInfo & II ); 30 bool handlesInterface( const InterfaceInfo & II );
31 31
32private : 32private :
diff --git a/noncore/settings/networksettings2/modem/modemrun.h b/noncore/settings/networksettings2/modem/modemrun.h
index 6d1662b..336462e 100644
--- a/noncore/settings/networksettings2/modem/modemrun.h
+++ b/noncore/settings/networksettings2/modem/modemrun.h
@@ -14,12 +14,12 @@ public :
14 14
15protected : 15protected :
16 16
17 void detectState( NodeCollection * ) 17 void detectState( NodeCollection * )
18 { } 18 { }
19 19
20 bool setState( NodeCollection *, Action_t ) 20 bool setState( NodeCollection *, Action_t, bool )
21 { return 0; } 21 { return 0; }
22 22
23 bool canSetState( State_t, Action_t ) 23 bool canSetState( State_t, Action_t )
24 { return 0; } 24 { return 0; }
25}; 25};
diff --git a/noncore/settings/networksettings2/network/networkrun.cpp b/noncore/settings/networksettings2/network/networkrun.cpp
index c19235a..41e1c53 100644
--- a/noncore/settings/networksettings2/network/networkrun.cpp
+++ b/noncore/settings/networksettings2/network/networkrun.cpp
@@ -14,30 +14,30 @@ void NetworkRun::detectState( NodeCollection * NC ) {
14 } 14 }
15 15
16 // has no interface -> delegate 16 // has no interface -> delegate
17 RI->detectState( NC ); 17 RI->detectState( NC );
18} 18}
19 19
20bool NetworkRun::setState( NodeCollection * NC, Action_t A ) { 20bool NetworkRun::setState( NodeCollection * NC, Action_t A, bool Force ) {
21 // we handle UP and DOWN 21 // we handle UP and DOWN
22 RuntimeInfo * RI = netNode()->nextNode()->runtime(); 22 RuntimeInfo * RI = netNode()->nextNode()->runtime();
23 AsDevice * Next = RI->asDevice(); 23 AsDevice * Next = RI->asDevice();
24 InterfaceInfo * II = Next->assignedInterface(); 24 InterfaceInfo * II = Next->assignedInterface();
25 25
26 if( A == Up ) { 26 if( A == Up ) {
27 // we can bring UP if lower level is available 27 // we can bring UP if lower level is available
28 if( NC->currentState() == Available ) { 28 if( NC->currentState() == Available || Force ) {
29 QString S; 29 QString S;
30 S.sprintf( "ifup %s=%s-c%d-allowed", 30 S.sprintf( "ifup %s=%s-c%d-allowed",
31 II->Name.latin1(), II->Name.latin1(), 31 II->Name.latin1(), II->Name.latin1(),
32 connection()->number() ); 32 connection()->number() );
33 NSResources->system().runAsRoot( S ); 33 NSResources->system().runAsRoot( S );
34 } 34 }
35 return 1; 35 return 1;
36 } else if( A == Down ) { 36 } else if( A == Down ) {
37 if( NC->currentState() == IsUp ) { 37 if( NC->currentState() == IsUp || Force ) {
38 QString S; 38 QString S;
39 S.sprintf( "ifdown %s=%s-c%d-allowed", 39 S.sprintf( "ifdown %s=%s-c%d-allowed",
40 II->Name.latin1(), II->Name.latin1(), 40 II->Name.latin1(), II->Name.latin1(),
41 connection()->number() ); 41 connection()->number() );
42 NSResources->system().runAsRoot( S ); 42 NSResources->system().runAsRoot( S );
43 } 43 }
diff --git a/noncore/settings/networksettings2/network/networkrun.h b/noncore/settings/networksettings2/network/networkrun.h
index fa16365..522a912 100644
--- a/noncore/settings/networksettings2/network/networkrun.h
+++ b/noncore/settings/networksettings2/network/networkrun.h
@@ -12,12 +12,12 @@ public :
12 virtual AsConnection * asConnection( void ) 12 virtual AsConnection * asConnection( void )
13 { return (AsConnection *)this; } 13 { return (AsConnection *)this; }
14 14
15protected : 15protected :
16 16
17 void detectState( NodeCollection * ); 17 void detectState( NodeCollection * );
18 bool setState( NodeCollection * ,Action_t A ); 18 bool setState( NodeCollection * ,Action_t A, bool );
19 bool canSetState( State_t , Action_t A ); 19 bool canSetState( State_t , Action_t A );
20 20
21 bool handlesInterface( const QString & I ); 21 bool handlesInterface( const QString & I );
22 22
23}; 23};
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp
index 3ddcbde..b36c7a0 100644
--- a/noncore/settings/networksettings2/networksettings.cpp
+++ b/noncore/settings/networksettings2/networksettings.cpp
@@ -20,23 +20,27 @@
20NetworkSettings::NetworkSettings( QWidget *parent, 20NetworkSettings::NetworkSettings( QWidget *parent,
21 const char *name, 21 const char *name,
22 WFlags fl ) : NetworkSettingsGUI(parent,name,fl), 22 WFlags fl ) : NetworkSettingsGUI(parent,name,fl),
23 NSD() { 23 NSD() {
24 24
25 UpdateTimer = new QTimer( this ); 25 UpdateTimer = new QTimer( this );
26
26 // set pixmaps 27 // set pixmaps
27 Add_TB->setPixmap( NSResources->getPixmap( "add" ) ); 28 Add_TB->setPixmap( NSResources->getPixmap( "add" ) );
28 Delete_TB->setPixmap( NSResources->getPixmap( "remove" ) ); 29 Delete_TB->setPixmap( NSResources->getPixmap( "remove" ) );
29 CheckState_TB->setPixmap( NSResources->getPixmap( "check" ) ); 30 CheckState_TB->setPixmap( NSResources->getPixmap( "check" ) );
30 Enable_TB->setPixmap( NSResources->getPixmap( "disabled" ) ); 31 Enable_TB->setPixmap( NSResources->getPixmap( "disabled" ) );
31 GenConfig_TB->setPixmap( NSResources->getPixmap( "configure" ) ); 32 GenConfig_TB->setPixmap( NSResources->getPixmap( "configure" ) );
32 33
33 Connect_TB->setPixmap( NSResources->getPixmap( "connected" ) ); 34 Connect_TB->setPixmap( NSResources->getPixmap( "connected" ) );
35 Disconnect_TB->setPixmap( NSResources->getPixmap( "disconnected" ) );
34 36
35 On_TB->setPixmap( NSResources->getPixmap( "off" ) ); 37 On_TB->setPixmap( NSResources->getPixmap( "off" ) );
36 38
39 SLOT_ToProfile();
40
37 // populate main Listbox 41 // populate main Listbox
38 Profiles_LB->clear(); 42 Profiles_LB->clear();
39 { Name2Connection_t & M = NSResources->connections(); 43 { Name2Connection_t & M = NSResources->connections();
40 NodeCollection * NC; 44 NodeCollection * NC;
41 // for all connections 45 // for all connections
42 for( QDictIterator<NodeCollection> it(M); 46 for( QDictIterator<NodeCollection> it(M);
@@ -273,13 +277,13 @@ void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) {
273 if( NC->description().isEmpty() ) { 277 if( NC->description().isEmpty() ) {
274 Description_LBL->setText( tr( "No description" ) ); 278 Description_LBL->setText( tr( "No description" ) );
275 } else { 279 } else {
276 Description_LBL->setText( NC->description() ); 280 Description_LBL->setText( NC->description() );
277 } 281 }
278 282
279 CurProfile_GB->setTitle( LBI->text() ); 283 Profile_GB->setTitle( LBI->text() );
280 State_LBL->setText( NC->stateName() ); 284 State_LBL->setText( NC->stateName() );
281} 285}
282 286
283void NetworkSettings::SLOT_CheckState( void ) { 287void NetworkSettings::SLOT_CheckState( void ) {
284 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); 288 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
285 if ( ! LBI ) 289 if ( ! LBI )
@@ -406,12 +410,34 @@ void NetworkSettings::SLOT_Connect( void ) {
406 tr( "Cannot enable profile" ) ); 410 tr( "Cannot enable profile" ) );
407 } 411 }
408 412
409 // we do not update the GUI but wait for the REAL upping of the device 413 // we do not update the GUI but wait for the REAL upping of the device
410} 414}
411 415
416void NetworkSettings::SLOT_Disconnect( void ) {
417 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
418
419 if ( ! LBI )
420 return;
421
422 NodeCollection * NC =
423 NSResources->findConnection( LBI->text() );
424
425 NC->setState( Down, 1 );
426}
427
428void NetworkSettings::SLOT_ToMessages( void ) {
429 Profile_GB->hide();
430 Messages_GB->show();
431}
432
433void NetworkSettings::SLOT_ToProfile( void ) {
434 Profile_GB->show();
435 Messages_GB->hide();
436}
437
412void NetworkSettings::SLOT_QCopMessage(const QCString &msg, const QByteArray &data) { 438void NetworkSettings::SLOT_QCopMessage(const QCString &msg, const QByteArray &data) {
413 QDataStream stream( data, IO_ReadOnly ); 439 QDataStream stream( data, IO_ReadOnly );
414 440
415 if( msg == "raise" ) { 441 if( msg == "raise" ) {
416 raise(); 442 raise();
417 return; 443 return;
diff --git a/noncore/settings/networksettings2/networksettings.h b/noncore/settings/networksettings2/networksettings.h
index d9ea5d4..97852af 100644
--- a/noncore/settings/networksettings2/networksettings.h
+++ b/noncore/settings/networksettings2/networksettings.h
@@ -33,15 +33,18 @@ public slots :
33 void SLOT_ShowNode( QListBoxItem * ); 33 void SLOT_ShowNode( QListBoxItem * );
34 void SLOT_EditNode( QListBoxItem * ); 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_Disconnect( void );
39 void SLOT_GenerateConfig( void ); 40 void SLOT_GenerateConfig( void );
40 void SLOT_RefreshStates( void ); 41 void SLOT_RefreshStates( void );
41 void SLOT_QCopMessage( const QCString&,const QByteArray& ); 42 void SLOT_QCopMessage( const QCString&,const QByteArray& );
43 void SLOT_ToProfile( void );
44 void SLOT_ToMessages( void );
42 45
43private : 46private :
44 47
45 void updateProfileState( QListBoxItem * it ); 48 void updateProfileState( QListBoxItem * it );
46 QTimer * UpdateTimer; 49 QTimer * UpdateTimer;
47 NetworkSettingsData NSD; 50 NetworkSettingsData NSD;
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.cpp b/noncore/settings/networksettings2/networksettings2/netnode.cpp
index dc66aff..1182543 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.cpp
+++ b/noncore/settings/networksettings2/networksettings2/netnode.cpp
@@ -1,8 +1,10 @@
1#include <qpe/qpeapplication.h>
2#include <time.h> 1#include <time.h>
2#include <qpe/qpeapplication.h>
3#include <qpainter.h>
4#include <qbitmap.h>
3#include <qtextstream.h> 5#include <qtextstream.h>
4#include <qpixmap.h> 6#include <qpixmap.h>
5 7
6#include "resources.h" 8#include "resources.h"
7#include "netnode.h" 9#include "netnode.h"
8 10
@@ -244,14 +246,23 @@ static char * State2PixmapTbl[] = {
244 "off", // off 246 "off", // off
245 "disconnected", // available 247 "disconnected", // available
246 "connected" // up 248 "connected" // up
247}; 249};
248 250
249QPixmap NodeCollection::devicePixmap( void ) { 251QPixmap NodeCollection::devicePixmap( void ) {
250 return NSResources->getPixmap( 252 QPixmap pm = NSResources->getPixmap(
251 device()->netNode()->pixmapName()+"-large" ); 253 getToplevel()->nextNode()->pixmapName()+"-large");
254
255 QPixmap Mini = NSResources->getPixmap( device()->netNode()->pixmapName() );
256
257 QPainter painter( &pm );
258 painter.drawPixmap( pm.width()-Mini.width(),
259 pm.height()-Mini.height(),
260 Mini );
261 pm.setMask( pm.createHeuristicMask( TRUE ) );
262 return pm;
252} 263}
253 264
254QPixmap NodeCollection::statePixmap( State_t S) { 265QPixmap NodeCollection::statePixmap( State_t S) {
255 return NSResources->getPixmap( State2PixmapTbl[S] ); 266 return NSResources->getPixmap( State2PixmapTbl[S] );
256} 267}
257 268
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.h b/noncore/settings/networksettings2/networksettings2/netnode.h
index 27d54f8..5e36062 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.h
+++ b/noncore/settings/networksettings2/networksettings2/netnode.h
@@ -255,13 +255,13 @@ public :
255 ANetNodeInstance * netNode() 255 ANetNodeInstance * netNode()
256 { return NNI; } 256 { return NNI; }
257 NodeCollection * connection() 257 NodeCollection * connection()
258 { return NNI->connection(); } 258 { return NNI->connection(); }
259 259
260 virtual void detectState( NodeCollection * NC ) = 0; 260 virtual void detectState( NodeCollection * NC ) = 0;
261 virtual bool setState( NodeCollection * NC, Action_t A ) = 0; 261 virtual bool setState( NodeCollection * NC, Action_t A, bool Force = 0 ) = 0;
262 virtual bool canSetState( State_t Curr, Action_t A ) = 0; 262 virtual bool canSetState( State_t Curr, Action_t A ) = 0;
263 263
264signals : 264signals :
265 265
266 // sent by device if state changes 266 // sent by device if state changes
267 void stateChanged( State_t S, ANetNodeInstance * NNI ); 267 void stateChanged( State_t S, ANetNodeInstance * NNI );
@@ -319,14 +319,14 @@ public :
319 QPixmap statePixmap( bool Update = 0 ) 319 QPixmap statePixmap( bool Update = 0 )
320 { return statePixmap( state(Update) ); } 320 { return statePixmap( state(Update) ); }
321 QString stateName( State_t ); 321 QString stateName( State_t );
322 QString stateName( bool Update = 0 ) 322 QString stateName( bool Update = 0 )
323 { return stateName( state(Update) ); } 323 { return stateName( state(Update) ); }
324 324
325 bool setState( Action_t A ) 325 bool setState( Action_t A, bool Force =0 )
326 { return getToplevel()->runtime()->setState( this, A ); } 326 { return getToplevel()->runtime()->setState( this, A, Force ); }
327 bool canSetState( Action_t A ) 327 bool canSetState( Action_t A )
328 { return getToplevel()->runtime()->canSetState( CurrentState, A ); } 328 { return getToplevel()->runtime()->canSetState( CurrentState, A ); }
329 329
330 void save( QTextStream & TS ); 330 void save( QTextStream & TS );
331 331
332 void append( ANetNodeInstance * NNI ); 332 void append( ANetNodeInstance * NNI );
diff --git a/noncore/settings/networksettings2/networksettings2/networksettings2.pro b/noncore/settings/networksettings2/networksettings2/networksettings2.pro
index 11b5f84..f97c93b 100644
--- a/noncore/settings/networksettings2/networksettings2/networksettings2.pro
+++ b/noncore/settings/networksettings2/networksettings2/networksettings2.pro
@@ -7,17 +7,19 @@ HEADERS = netnode.h \
7 system.h \ 7 system.h \
8 asline.h \ 8 asline.h \
9 GUIUtils.h \ 9 GUIUtils.h \
10 asconnection.h \ 10 asconnection.h \
11 asfullsetup.h \ 11 asfullsetup.h \
12 systemfile.h \ 12 systemfile.h \
13 wextensions.h \
13 asdevice.h 14 asdevice.h
14 SOURCES = netnode.cpp \ 15 SOURCES = netnode.cpp \
15 GUIUtils.cpp \ 16 GUIUtils.cpp \
16 system.cpp \ 17 system.cpp \
17 systemfile.cpp \ 18 systemfile.cpp \
19 wextensions.cpp \
18 resources.cpp 20 resources.cpp
19 INCLUDEPATH+= $(OPIEDIR)/include ../networksettings2 21 INCLUDEPATH+= $(OPIEDIR)/include ../networksettings2
20 DEPENDPATH+= $(OPIEDIR)/include 22 DEPENDPATH+= $(OPIEDIR)/include
21LIBS += -lqpe -lopiecore2 23LIBS += -lqpe -lopiecore2
22 INTERFACES= 24 INTERFACES=
23 TARGET = networksettings2 25 TARGET = networksettings2
diff --git a/noncore/settings/networksettings2/networksettings2/resources.cpp b/noncore/settings/networksettings2/networksettings2/resources.cpp
index 4b7a62f..c95ac7f 100644
--- a/noncore/settings/networksettings2/networksettings2/resources.cpp
+++ b/noncore/settings/networksettings2/networksettings2/resources.cpp
@@ -174,13 +174,14 @@ bool TheNSResources::loadNetNode(
174 return 1; 174 return 1;
175} 175}
176 176
177QPixmap TheNSResources::getPixmap( const QString & QS ) { 177QPixmap TheNSResources::getPixmap( const QString & QS ) {
178 QString S("networksettings2/"); 178 QString S("networksettings2/");
179 S += QS; 179 S += QS;
180 return Resource::loadPixmap( QString("networksettings2/")+QS ); 180 fprintf( stderr, "%s\n", S.latin1() );
181 return Resource::loadPixmap( S );
181} 182}
182 183
183QString TheNSResources::tr( const char * s ) { 184QString TheNSResources::tr( const char * s ) {
184 return qApp->translate( "resource", s ); 185 return qApp->translate( "resource", s );
185} 186}
186 187
diff --git a/noncore/settings/networksettings2/networksettingsGUI.ui b/noncore/settings/networksettings2/networksettingsGUI.ui
index 1d79123..7ef2f64 100644
--- a/noncore/settings/networksettings2/networksettingsGUI.ui
+++ b/noncore/settings/networksettings2/networksettingsGUI.ui
@@ -8,14 +8,14 @@
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>399</width> 14 <width>160</width>
15 <height>502</height> 15 <height>260</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>
21 </property> 21 </property>
@@ -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>0</number> 35 <number>2</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>
@@ -164,13 +164,13 @@
164 </property> 164 </property>
165 </spacer> 165 </spacer>
166 <widget> 166 <widget>
167 <class>QToolButton</class> 167 <class>QToolButton</class>
168 <property stdset="1"> 168 <property stdset="1">
169 <name>name</name> 169 <name>name</name>
170 <cstring>On_TB</cstring> 170 <cstring>Enable_TB</cstring>
171 </property> 171 </property>
172 <property stdset="1"> 172 <property stdset="1">
173 <name>sizePolicy</name> 173 <name>sizePolicy</name>
174 <sizepolicy> 174 <sizepolicy>
175 <hsizetype>0</hsizetype> 175 <hsizetype>0</hsizetype>
176 <vsizetype>0</vsizetype> 176 <vsizetype>0</vsizetype>
@@ -190,13 +190,13 @@
190 </property> 190 </property>
191 </widget> 191 </widget>
192 <widget> 192 <widget>
193 <class>QToolButton</class> 193 <class>QToolButton</class>
194 <property stdset="1"> 194 <property stdset="1">
195 <name>name</name> 195 <name>name</name>
196 <cstring>Enable_TB</cstring> 196 <cstring>On_TB</cstring>
197 </property> 197 </property>
198 <property stdset="1"> 198 <property stdset="1">
199 <name>sizePolicy</name> 199 <name>sizePolicy</name>
200 <sizepolicy> 200 <sizepolicy>
201 <hsizetype>0</hsizetype> 201 <hsizetype>0</hsizetype>
202 <vsizetype>0</vsizetype> 202 <vsizetype>0</vsizetype>
@@ -238,12 +238,38 @@
238 </property> 238 </property>
239 <property stdset="1"> 239 <property stdset="1">
240 <name>toggleButton</name> 240 <name>toggleButton</name>
241 <bool>true</bool> 241 <bool>true</bool>
242 </property> 242 </property>
243 </widget> 243 </widget>
244 <widget>
245 <class>QToolButton</class>
246 <property stdset="1">
247 <name>name</name>
248 <cstring>Disconnect_TB</cstring>
249 </property>
250 <property stdset="1">
251 <name>sizePolicy</name>
252 <sizepolicy>
253 <hsizetype>0</hsizetype>
254 <vsizetype>0</vsizetype>
255 </sizepolicy>
256 </property>
257 <property stdset="1">
258 <name>text</name>
259 <string>...</string>
260 </property>
261 <property stdset="1">
262 <name>toggleButton</name>
263 <bool>true</bool>
264 </property>
265 <property stdset="1">
266 <name>toggleButton</name>
267 <bool>true</bool>
268 </property>
269 </widget>
244 </hbox> 270 </hbox>
245 </widget> 271 </widget>
246 <widget> 272 <widget>
247 <class>QListBox</class> 273 <class>QListBox</class>
248 <property stdset="1"> 274 <property stdset="1">
249 <name>name</name> 275 <name>name</name>
@@ -251,24 +277,17 @@
251 </property> 277 </property>
252 </widget> 278 </widget>
253 <widget> 279 <widget>
254 <class>QGroupBox</class> 280 <class>QGroupBox</class>
255 <property stdset="1"> 281 <property stdset="1">
256 <name>name</name> 282 <name>name</name>
257 <cstring>CurProfile_GB</cstring> 283 <cstring>Profile_GB</cstring>
258 </property>
259 <property stdset="1">
260 <name>sizePolicy</name>
261 <sizepolicy>
262 <hsizetype>5</hsizetype>
263 <vsizetype>1</vsizetype>
264 </sizepolicy>
265 </property> 284 </property>
266 <property stdset="1"> 285 <property stdset="1">
267 <name>title</name> 286 <name>title</name>
268 <string></string> 287 <string>Profile</string>
269 </property> 288 </property>
270 <property> 289 <property>
271 <name>layoutMargin</name> 290 <name>layoutMargin</name>
272 </property> 291 </property>
273 <property> 292 <property>
274 <name>layoutSpacing</name> 293 <name>layoutSpacing</name>
@@ -277,13 +296,13 @@
277 <property stdset="1"> 296 <property stdset="1">
278 <name>margin</name> 297 <name>margin</name>
279 <number>4</number> 298 <number>4</number>
280 </property> 299 </property>
281 <property stdset="1"> 300 <property stdset="1">
282 <name>spacing</name> 301 <name>spacing</name>
283 <number>1</number> 302 <number>2</number>
284 </property> 303 </property>
285 <widget> 304 <widget>
286 <class>QLayoutWidget</class> 305 <class>QLayoutWidget</class>
287 <property stdset="1"> 306 <property stdset="1">
288 <name>name</name> 307 <name>name</name>
289 <cstring>Layout3</cstring> 308 <cstring>Layout3</cstring>
@@ -298,13 +317,13 @@
298 <number>6</number> 317 <number>6</number>
299 </property> 318 </property>
300 <widget> 319 <widget>
301 <class>QLabel</class> 320 <class>QLabel</class>
302 <property stdset="1"> 321 <property stdset="1">
303 <name>name</name> 322 <name>name</name>
304 <cstring>TextLabel2</cstring> 323 <cstring>TextLabel2_2</cstring>
305 </property> 324 </property>
306 <property stdset="1"> 325 <property stdset="1">
307 <name>text</name> 326 <name>text</name>
308 <string>State</string> 327 <string>State</string>
309 </property> 328 </property>
310 </widget> 329 </widget>
@@ -323,13 +342,13 @@
323 <number>0</number> 342 <number>0</number>
324 </property> 343 </property>
325 </widget> 344 </widget>
326 <spacer> 345 <spacer>
327 <property> 346 <property>
328 <name>name</name> 347 <name>name</name>
329 <cstring>Spacer6</cstring> 348 <cstring>Spacer6_2</cstring>
330 </property> 349 </property>
331 <property stdset="1"> 350 <property stdset="1">
332 <name>orientation</name> 351 <name>orientation</name>
333 <enum>Horizontal</enum> 352 <enum>Horizontal</enum>
334 </property> 353 </property>
335 <property stdset="1"> 354 <property stdset="1">
@@ -376,12 +395,151 @@
376 <set>AlignTop|AlignLeft</set> 395 <set>AlignTop|AlignLeft</set>
377 </property> 396 </property>
378 <property> 397 <property>
379 <name>vAlign</name> 398 <name>vAlign</name>
380 </property> 399 </property>
381 </widget> 400 </widget>
401 <widget>
402 <class>QLayoutWidget</class>
403 <property stdset="1">
404 <name>name</name>
405 <cstring>Layout4</cstring>
406 </property>
407 <hbox>
408 <property stdset="1">
409 <name>margin</name>
410 <number>0</number>
411 </property>
412 <property stdset="1">
413 <name>spacing</name>
414 <number>6</number>
415 </property>
416 <spacer>
417 <property>
418 <name>name</name>
419 <cstring>Spacer4</cstring>
420 </property>
421 <property stdset="1">
422 <name>orientation</name>
423 <enum>Horizontal</enum>
424 </property>
425 <property stdset="1">
426 <name>sizeType</name>
427 <enum>Expanding</enum>
428 </property>
429 <property>
430 <name>sizeHint</name>
431 <size>
432 <width>20</width>
433 <height>20</height>
434 </size>
435 </property>
436 </spacer>
437 <widget>
438 <class>QPushButton</class>
439 <property stdset="1">
440 <name>name</name>
441 <cstring>ToMessages_BUT</cstring>
442 </property>
443 <property stdset="1">
444 <name>sizePolicy</name>
445 <sizepolicy>
446 <hsizetype>1</hsizetype>
447 <vsizetype>0</vsizetype>
448 </sizepolicy>
449 </property>
450 <property stdset="1">
451 <name>text</name>
452 <string>Messages ...</string>
453 </property>
454 </widget>
455 </hbox>
456 </widget>
457 </vbox>
458 </widget>
459 <widget>
460 <class>QGroupBox</class>
461 <property stdset="1">
462 <name>name</name>
463 <cstring>Messages_GB</cstring>
464 </property>
465 <property stdset="1">
466 <name>title</name>
467 <string>Messages</string>
468 </property>
469 <property>
470 <name>layoutMargin</name>
471 </property>
472 <property>
473 <name>layoutSpacing</name>
474 </property>
475 <vbox>
476 <property stdset="1">
477 <name>margin</name>
478 <number>4</number>
479 </property>
480 <property stdset="1">
481 <name>spacing</name>
482 <number>2</number>
483 </property>
484 <widget>
485 <class>QListBox</class>
486 <property stdset="1">
487 <name>name</name>
488 <cstring>Mesages_LB</cstring>
489 </property>
490 </widget>
491 <widget>
492 <class>QLayoutWidget</class>
493 <property stdset="1">
494 <name>name</name>
495 <cstring>Layout2</cstring>
496 </property>
497 <hbox>
498 <property stdset="1">
499 <name>margin</name>
500 <number>0</number>
501 </property>
502 <property stdset="1">
503 <name>spacing</name>
504 <number>6</number>
505 </property>
506 <spacer>
507 <property>
508 <name>name</name>
509 <cstring>Spacer3</cstring>
510 </property>
511 <property stdset="1">
512 <name>orientation</name>
513 <enum>Horizontal</enum>
514 </property>
515 <property stdset="1">
516 <name>sizeType</name>
517 <enum>Expanding</enum>
518 </property>
519 <property>
520 <name>sizeHint</name>
521 <size>
522 <width>20</width>
523 <height>20</height>
524 </size>
525 </property>
526 </spacer>
527 <widget>
528 <class>QPushButton</class>
529 <property stdset="1">
530 <name>name</name>
531 <cstring>ToProfile_BUT</cstring>
532 </property>
533 <property stdset="1">
534 <name>text</name>
535 <string>Profile ...</string>
536 </property>
537 </widget>
538 </hbox>
539 </widget>
382 </vbox> 540 </vbox>
383 </widget> 541 </widget>
384 </vbox> 542 </vbox>
385</widget> 543</widget>
386<connections> 544<connections>
387 <connection> 545 <connection>
@@ -441,17 +599,32 @@
441 <connection> 599 <connection>
442 <sender>Profiles_LB</sender> 600 <sender>Profiles_LB</sender>
443 <signal>doubleClicked(QListBoxItem*)</signal> 601 <signal>doubleClicked(QListBoxItem*)</signal>
444 <receiver>NetworkSettingsGUI</receiver> 602 <receiver>NetworkSettingsGUI</receiver>
445 <slot>SLOT_EditNode( QListBoxItem *)</slot> 603 <slot>SLOT_EditNode( QListBoxItem *)</slot>
446 </connection> 604 </connection>
605 <connection>
606 <sender>ToProfile_BUT</sender>
607 <signal>clicked()</signal>
608 <receiver>NetworkSettingsGUI</receiver>
609 <slot>SLOT_ToProfile()</slot>
610 </connection>
611 <connection>
612 <sender>ToMessages_BUT</sender>
613 <signal>clicked()</signal>
614 <receiver>NetworkSettingsGUI</receiver>
615 <slot>SLOT_ToMessages()</slot>
616 </connection>
447 <slot access="public">SLOT_AddNode()</slot> 617 <slot access="public">SLOT_AddNode()</slot>
448 <slot access="public">SLOT_CheckState()</slot> 618 <slot access="public">SLOT_CheckState()</slot>
449 <slot access="public">SLOT_Connect()</slot> 619 <slot access="public">SLOT_Connect()</slot>
450 <slot access="public">SLOT_DeleteNode()</slot> 620 <slot access="public">SLOT_DeleteNode()</slot>
451 <slot access="public">SLOT_EditNode( QListBoxItem *)</slot> 621 <slot access="public">SLOT_EditNode( QListBoxItem *)</slot>
452 <slot access="public">SLOT_Enable()</slot> 622 <slot access="public">SLOT_Enable()</slot>
453 <slot access="public">SLOT_GenerateConfig()</slot> 623 <slot access="public">SLOT_GenerateConfig()</slot>
454 <slot access="public">SLOT_On()</slot> 624 <slot access="public">SLOT_On()</slot>
455 <slot access="public">SLOT_ShowNode( QListBoxItem*)</slot> 625 <slot access="public">SLOT_ShowNode( QListBoxItem*)</slot>
626 <slot access="public">SLOT_ToMessages()</slot>
627 <slot access="public">SLOT_ToProfile()</slot>
628 <slot access="public">SLOT_Disconnect()</slot>
456</connections> 629</connections>
457</UI> 630</UI>
diff --git a/noncore/settings/networksettings2/ppp/ppprun.cpp b/noncore/settings/networksettings2/ppp/ppprun.cpp
index 8c75df3..a8abc50 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.cpp
+++ b/noncore/settings/networksettings2/ppp/ppprun.cpp
@@ -17,13 +17,13 @@ void PPPRun::detectState( NodeCollection * NC ) {
17 NC->setCurrentState( Off ); // at least this 17 NC->setCurrentState( Off ); // at least this
18 // but could also be unavailable 18 // but could also be unavailable
19 AsDevice::netNode()->nextNode()->runtime()->detectState( NC ); 19 AsDevice::netNode()->nextNode()->runtime()->detectState( NC );
20 } 20 }
21} 21}
22 22
23bool PPPRun::setState( NodeCollection * NC, Action_t A ) { 23bool PPPRun::setState( NodeCollection * NC, Action_t A, bool ) {
24 switch( A ) { 24 switch( A ) {
25 case Activate : 25 case Activate :
26 NC->setCurrentState( Available ); 26 NC->setCurrentState( Available );
27 // no 27 // no
28 break; 28 break;
29 case Deactivate : 29 case Deactivate :
diff --git a/noncore/settings/networksettings2/ppp/ppprun.h b/noncore/settings/networksettings2/ppp/ppprun.h
index af51fbe..90a3f25 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.h
+++ b/noncore/settings/networksettings2/ppp/ppprun.h
@@ -24,13 +24,13 @@ public :
24 virtual RuntimeInfo * runtimeInfo( void ) 24 virtual RuntimeInfo * runtimeInfo( void )
25 { return ( AsConnection *)this; } 25 { return ( AsConnection *)this; }
26 26
27 protected : 27 protected :
28 28
29 void detectState( NodeCollection * NC ); 29 void detectState( NodeCollection * NC );
30 bool setState( NodeCollection * NC, Action_t A ); 30 bool setState( NodeCollection * NC, Action_t A, bool );
31 bool canSetState( State_t S, Action_t A ) 31 bool canSetState( State_t S, Action_t A )
32 { return AsDevice::connection()->findNext( 32 { return AsDevice::connection()->findNext(
33 AsDevice::netNode() )->runtime()->canSetState( S,A ); } 33 AsDevice::netNode() )->runtime()->canSetState( S,A ); }
34 34
35 bool handlesInterface( const QString & I ); 35 bool handlesInterface( const QString & I );
36 36
diff --git a/noncore/settings/networksettings2/profile/profileedit.cpp b/noncore/settings/networksettings2/profile/profileedit.cpp
index 3f72c52..c9fb650 100644
--- a/noncore/settings/networksettings2/profile/profileedit.cpp
+++ b/noncore/settings/networksettings2/profile/profileedit.cpp
@@ -8,22 +8,24 @@
8#include <asdevice.h> 8#include <asdevice.h>
9#include <resources.h> 9#include <resources.h>
10 10
11#include "profileedit.h" 11#include "profileedit.h"
12 12
13ProfileEdit::ProfileEdit( QWidget * Parent, ANetNodeInstance * TNNI ) : 13ProfileEdit::ProfileEdit( QWidget * Parent, ANetNodeInstance * TNNI ) :
14 ProfileGUI( Parent ), TrafficRefresh(this) { 14 ProfileGUI( Parent ), RefreshTimer(this) {
15 InterfaceInfo * II; 15 InterfaceInfo * II;
16 16
17 NNI = TNNI; 17 NNI = TNNI;
18 Dev = NNI->runtime()->device(); 18 Dev = NNI->runtime()->device();
19 if( ( II = Dev->assignedInterface() ) ) { 19 if( ( II = Dev->assignedInterface() ) ) {
20
20 Refresh_CB->setEnabled( TRUE ); 21 Refresh_CB->setEnabled( TRUE );
21 Snd_GB->setEnabled( TRUE ); 22 Snd_GB->setEnabled( TRUE );
22 Rcv_GB->setEnabled( TRUE ); 23 Rcv_GB->setEnabled( TRUE );
23 Collisions_FRM->setEnabled( TRUE ); 24 Collisions_FRM->setEnabled( TRUE );
25
24 // show current content 26 // show current content
25 SLOT_Refresh(); 27 SLOT_Refresh();
26 28
27 // fill in static data 29 // fill in static data
28 InterfaceName_LBL->setText( II->Name ); 30 InterfaceName_LBL->setText( II->Name );
29 IPAddress_LBL->setText( II->Address ); 31 IPAddress_LBL->setText( II->Address );
@@ -39,16 +41,17 @@ ProfileEdit::ProfileEdit( QWidget * Parent, ANetNodeInstance * TNNI ) :
39 S += "Multicast"; 41 S += "Multicast";
40 } 42 }
41 if( ! S.isEmpty() ) { 43 if( ! S.isEmpty() ) {
42 S.prepend( " : " ); 44 S.prepend( " : " );
43 } 45 }
44 InterfaceOptions_LBL->setText( S ); 46 InterfaceOptions_LBL->setText( S );
47
48 connect( &RefreshTimer, SIGNAL( timeout() ),
49 this, SLOT( SLOT_Refresh() ) );
45 } 50 }
46 51
47 connect( &TrafficRefresh, SIGNAL( timeout() ),
48 this, SLOT( SLOT_Refresh() ) );
49} 52}
50 53
51QString ProfileEdit::acceptable( void ) { 54QString ProfileEdit::acceptable( void ) {
52 return QString(); 55 return QString();
53} 56}
54 57
@@ -82,12 +85,12 @@ void ProfileEdit::SLOT_Refresh( void ) {
82 SndDropped_LBL->setText( II->SndDropped ); 85 SndDropped_LBL->setText( II->SndDropped );
83 Collisions_LBL->setText( II->Collisions ); 86 Collisions_LBL->setText( II->Collisions );
84} 87}
85 88
86void ProfileEdit::SLOT_AutoRefresh( bool ar ) { 89void ProfileEdit::SLOT_AutoRefresh( bool ar ) {
87 if( ar ) { 90 if( ar ) {
88 TrafficRefresh.start( 1000 ); 91 RefreshTimer.start( 1000 );
89 SLOT_Refresh(); 92 SLOT_Refresh();
90 } else { 93 } else {
91 TrafficRefresh.stop(); 94 RefreshTimer.stop();
92 } 95 }
93} 96}
diff --git a/noncore/settings/networksettings2/profile/profileedit.h b/noncore/settings/networksettings2/profile/profileedit.h
index 8ca34be..b186b58 100644
--- a/noncore/settings/networksettings2/profile/profileedit.h
+++ b/noncore/settings/networksettings2/profile/profileedit.h
@@ -20,10 +20,10 @@ public slots :
20 20
21 void SLOT_AutoRefresh( bool ); 21 void SLOT_AutoRefresh( bool );
22 void SLOT_Refresh( void ); 22 void SLOT_Refresh( void );
23 23
24private : 24private :
25 25
26 QTimer TrafficRefresh; 26 QTimer RefreshTimer;
27 ANetNodeInstance * NNI; 27 ANetNodeInstance * NNI;
28 AsDevice * Dev; 28 AsDevice * Dev;
29}; 29};
diff --git a/noncore/settings/networksettings2/profile/profilerun.cpp b/noncore/settings/networksettings2/profile/profilerun.cpp
index feebf86..79bb93e 100644
--- a/noncore/settings/networksettings2/profile/profilerun.cpp
+++ b/noncore/settings/networksettings2/profile/profilerun.cpp
@@ -9,13 +9,13 @@ void ProfileRun::detectState( NodeCollection * NC ) {
9 // find next item in connection 9 // find next item in connection
10 // convert to runtime and ask to detect the state 10 // convert to runtime and ask to detect the state
11 netNode()->nextNode()->runtime()->detectState( NC ); 11 netNode()->nextNode()->runtime()->detectState( NC );
12 } 12 }
13} 13}
14 14
15bool ProfileRun::setState( NodeCollection * NC, Action_t A ) { 15bool ProfileRun::setState( NodeCollection * NC, Action_t A, bool ) {
16 ANetNodeInstance * NNNI; 16 ANetNodeInstance * NNNI;
17 17
18 NNNI = netNode()->nextNode(); 18 NNNI = netNode()->nextNode();
19 switch ( A ) { 19 switch ( A ) {
20 case Enable : 20 case Enable :
21 if( NC->currentState() == Disabled ) { 21 if( NC->currentState() == Disabled ) {
diff --git a/noncore/settings/networksettings2/profile/profilerun.h b/noncore/settings/networksettings2/profile/profilerun.h
index 6e8385c..c8ea063 100644
--- a/noncore/settings/networksettings2/profile/profilerun.h
+++ b/noncore/settings/networksettings2/profile/profilerun.h
@@ -10,13 +10,13 @@ public :
10 10
11 ProfileRun( ANetNodeInstance * NNI, ProfileData & D ) : 11 ProfileRun( ANetNodeInstance * NNI, ProfileData & D ) :
12 AsFullSetup( NNI ) 12 AsFullSetup( NNI )
13 { Data = &D; } 13 { Data = &D; }
14 14
15 void detectState( NodeCollection * NC ); 15 void detectState( NodeCollection * NC );
16 bool setState( NodeCollection * NC, Action_t A ); 16 bool setState( NodeCollection * NC, Action_t A, bool );
17 bool canSetState( State_t Curr, Action_t A ); 17 bool canSetState( State_t Curr, Action_t A );
18 18
19 bool handlesInterface( const QString & I ); 19 bool handlesInterface( const QString & I );
20 20
21 virtual const QString & description( void ) 21 virtual const QString & description( void )
22 { return Data->Description; } 22 { return Data->Description; }
diff --git a/noncore/settings/networksettings2/usb/usbrun.cpp b/noncore/settings/networksettings2/usb/usbrun.cpp
index 4ce6721..beacd7b 100644
--- a/noncore/settings/networksettings2/usb/usbrun.cpp
+++ b/noncore/settings/networksettings2/usb/usbrun.cpp
@@ -72,13 +72,13 @@ void USBRun::detectState( NodeCollection * NC ) {
72 // no free found 72 // no free found
73 fprintf( stderr, "UNA\n" ); 73 fprintf( stderr, "UNA\n" );
74 74
75 NC->setCurrentState( Unavailable ); 75 NC->setCurrentState( Unavailable );
76} 76}
77 77
78bool USBRun::setState( NodeCollection * NC, Action_t A ) { 78bool USBRun::setState( NodeCollection * NC, Action_t A, bool ) {
79 79
80 // we only handle activate and deactivate 80 // we only handle activate and deactivate
81 switch( A ) { 81 switch( A ) {
82 case Activate : 82 case Activate :
83 { 83 {
84 if( NC->currentState() != Off ) { 84 if( NC->currentState() != Off ) {
diff --git a/noncore/settings/networksettings2/usb/usbrun.h b/noncore/settings/networksettings2/usb/usbrun.h
index 6c6e4e4..03e21ab 100644
--- a/noncore/settings/networksettings2/usb/usbrun.h
+++ b/noncore/settings/networksettings2/usb/usbrun.h
@@ -20,13 +20,13 @@ public :
20 20
21 virtual AsDevice * asDevice( void ) 21 virtual AsDevice * asDevice( void )
22 { return (AsDevice *)this; } 22 { return (AsDevice *)this; }
23protected : 23protected :
24 24
25 void detectState( NodeCollection * ); 25 void detectState( NodeCollection * );
26 bool setState( NodeCollection * , Action_t A ); 26 bool setState( NodeCollection * , Action_t A, bool );
27 bool canSetState( State_t , Action_t A ); 27 bool canSetState( State_t , Action_t A );
28 28
29 bool handlesInterface( const QString & I ); 29 bool handlesInterface( const QString & I );
30 30
31private : 31private :
32 32
diff --git a/noncore/settings/networksettings2/vpn/vpnrun.h b/noncore/settings/networksettings2/vpn/vpnrun.h
index 4d26298..c19b609 100644
--- a/noncore/settings/networksettings2/vpn/vpnrun.h
+++ b/noncore/settings/networksettings2/vpn/vpnrun.h
@@ -16,13 +16,13 @@ public :
16 { return (AsConnection *)this; } 16 { return (AsConnection *)this; }
17protected : 17protected :
18 18
19 void detectState( NodeCollection * ) 19 void detectState( NodeCollection * )
20 { } 20 { }
21 21
22 bool setState( NodeCollection *, Action_t ) 22 bool setState( NodeCollection *, Action_t, bool )
23 { return 0; } 23 { return 0; }
24 24
25 bool canSetState( State_t, Action_t ) 25 bool canSetState( State_t, Action_t )
26 { return 0; } 26 { return 0; }
27 27
28 bool handlesInterface( const QString & I ); 28 bool handlesInterface( const QString & I );
diff --git a/noncore/settings/networksettings2/wlan/wlanGUI.ui b/noncore/settings/networksettings2/wlan/wlanGUI.ui
index 9614369..1aec138 100644
--- a/noncore/settings/networksettings2/wlan/wlanGUI.ui
+++ b/noncore/settings/networksettings2/wlan/wlanGUI.ui
@@ -8,14 +8,14 @@
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>192</width> 14 <width>209</width>
15 <height>329</height> 15 <height>307</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>Form1</string> 20 <string>Form1</string>
21 </property> 21 </property>
@@ -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>0</number> 35 <number>1</number>
36 </property> 36 </property>
37 <widget> 37 <widget>
38 <class>QTabWidget</class> 38 <class>QTabWidget</class>
39 <property stdset="1"> 39 <property stdset="1">
40 <name>name</name> 40 <name>name</name>
41 <cstring>WLan_TAB</cstring> 41 <cstring>WLan_TAB</cstring>
@@ -70,86 +70,82 @@
70 <number>2</number> 70 <number>2</number>
71 </property> 71 </property>
72 <widget> 72 <widget>
73 <class>QLayoutWidget</class> 73 <class>QLayoutWidget</class>
74 <property stdset="1"> 74 <property stdset="1">
75 <name>name</name> 75 <name>name</name>
76 <cstring>Layout6</cstring> 76 <cstring>Layout11</cstring>
77 </property> 77 </property>
78 <property> 78 <property>
79 <name>layoutMargin</name> 79 <name>layoutSpacing</name>
80 </property> 80 </property>
81 <grid> 81 <grid>
82 <property stdset="1"> 82 <property stdset="1">
83 <name>margin</name> 83 <name>margin</name>
84 <number>1</number> 84 <number>0</number>
85 </property> 85 </property>
86 <property stdset="1"> 86 <property stdset="1">
87 <name>spacing</name> 87 <name>spacing</name>
88 <number>6</number> 88 <number>1</number>
89 </property> 89 </property>
90 <widget row="1" column="0" > 90 <widget row="0" column="1" >
91 <class>QLabel</class> 91 <class>QComboBox</class>
92 <item>
93 <property>
94 <name>text</name>
95 <string>Auto</string>
96 </property>
97 </item>
98 <item>
99 <property>
100 <name>text</name>
101 <string>Managed</string>
102 </property>
103 </item>
104 <item>
105 <property>
106 <name>text</name>
107 <string>Ad-Hoc</string>
108 </property>
109 </item>
92 <property stdset="1"> 110 <property stdset="1">
93 <name>name</name> 111 <name>name</name>
94 <cstring>essidLabel</cstring> 112 <cstring>Mode_CB</cstring>
95 </property> 113 </property>
96 <property stdset="1"> 114 <property stdset="1">
97 <name>enabled</name> 115 <name>enabled</name>
98 <bool>true</bool> 116 <bool>true</bool>
99 </property> 117 </property>
100 <property stdset="1"> 118 <property stdset="1">
101 <name>sizePolicy</name> 119 <name>sizePolicy</name>
102 <sizepolicy> 120 <sizepolicy>
103 <hsizetype>1</hsizetype> 121 <hsizetype>1</hsizetype>
104 <vsizetype>1</vsizetype> 122 <vsizetype>0</vsizetype>
105 </sizepolicy> 123 </sizepolicy>
106 </property> 124 </property>
107 <property stdset="1">
108 <name>text</name>
109 <string>ESS-ID</string>
110 </property>
111 </widget> 125 </widget>
112 <widget row="1" column="1" > 126 <widget row="2" column="0" >
113 <class>QComboBox</class> 127 <class>QLabel</class>
114 <item>
115 <property>
116 <name>text</name>
117 <string>any</string>
118 </property>
119 </item>
120 <property stdset="1"> 128 <property stdset="1">
121 <name>name</name> 129 <name>name</name>
122 <cstring>ESSID_CB</cstring> 130 <cstring>essidLabel_2</cstring>
123 </property>
124 <property stdset="1">
125 <name>sizePolicy</name>
126 <sizepolicy>
127 <hsizetype>7</hsizetype>
128 <vsizetype>0</vsizetype>
129 </sizepolicy>
130 </property> 131 </property>
131 <property stdset="1"> 132 <property stdset="1">
132 <name>editable</name> 133 <name>enabled</name>
133 <bool>true</bool> 134 <bool>true</bool>
134 </property> 135 </property>
135 <property stdset="1"> 136 <property stdset="1">
136 <name>currentItem</name> 137 <name>sizePolicy</name>
137 <number>0</number> 138 <sizepolicy>
138 </property> 139 <hsizetype>1</hsizetype>
139 <property stdset="1"> 140 <vsizetype>1</vsizetype>
140 <name>sizeLimit</name> 141 </sizepolicy>
141 <number>5</number>
142 </property>
143 <property stdset="1">
144 <name>autoCompletion</name>
145 <bool>true</bool>
146 </property> 142 </property>
147 <property stdset="1"> 143 <property stdset="1">
148 <name>duplicatesEnabled</name> 144 <name>text</name>
149 <bool>false</bool> 145 <string>Name</string>
150 </property> 146 </property>
151 </widget> 147 </widget>
152 <widget row="0" column="0" > 148 <widget row="0" column="0" >
153 <class>QLabel</class> 149 <class>QLabel</class>
154 <property stdset="1"> 150 <property stdset="1">
155 <name>name</name> 151 <name>name</name>
@@ -168,53 +164,51 @@
168 </property> 164 </property>
169 <property stdset="1"> 165 <property stdset="1">
170 <name>text</name> 166 <name>text</name>
171 <string>Mode</string> 167 <string>Mode</string>
172 </property> 168 </property>
173 </widget> 169 </widget>
174 <widget row="0" column="1" > 170 <widget row="1" column="1" >
175 <class>QComboBox</class> 171 <class>QLineEdit</class>
176 <item>
177 <property>
178 <name>text</name>
179 <string>Infrastructure</string>
180 </property>
181 </item>
182 <item>
183 <property>
184 <name>text</name>
185 <string>Auto</string>
186 </property>
187 </item>
188 <item>
189 <property>
190 <name>text</name>
191 <string>Managed</string>
192 </property>
193 </item>
194 <item>
195 <property>
196 <name>text</name>
197 <string>Ad-Hoc</string>
198 </property>
199 </item>
200 <property stdset="1"> 172 <property stdset="1">
201 <name>name</name> 173 <name>name</name>
202 <cstring>Mode_CB</cstring> 174 <cstring>ESSID_LE</cstring>
175 </property>
176 </widget>
177 <widget row="1" column="0" >
178 <class>QLabel</class>
179 <property stdset="1">
180 <name>name</name>
181 <cstring>essidLabel</cstring>
203 </property> 182 </property>
204 <property stdset="1"> 183 <property stdset="1">
205 <name>enabled</name> 184 <name>enabled</name>
206 <bool>true</bool> 185 <bool>true</bool>
207 </property> 186 </property>
208 <property stdset="1"> 187 <property stdset="1">
209 <name>sizePolicy</name> 188 <name>sizePolicy</name>
210 <sizepolicy> 189 <sizepolicy>
211 <hsizetype>1</hsizetype> 190 <hsizetype>1</hsizetype>
212 <vsizetype>0</vsizetype> 191 <vsizetype>1</vsizetype>
213 </sizepolicy> 192 </sizepolicy>
214 </property> 193 </property>
194 <property stdset="1">
195 <name>text</name>
196 <string>ESS-ID</string>
197 </property>
198 </widget>
199 <widget row="2" column="1" >
200 <class>QLineEdit</class>
201 <property stdset="1">
202 <name>name</name>
203 <cstring>NodeName_LE</cstring>
204 </property>
205 <property stdset="1">
206 <name>text</name>
207 <string>&lt;UseHostName&gt;</string>
208 </property>
215 </widget> 209 </widget>
216 </grid> 210 </grid>
217 </widget> 211 </widget>
218 <widget> 212 <widget>
219 <class>QLayoutWidget</class> 213 <class>QLayoutWidget</class>
220 <property stdset="1"> 214 <property stdset="1">
@@ -241,13 +235,13 @@
241 <property stdset="1"> 235 <property stdset="1">
242 <name>name</name> 236 <name>name</name>
243 <cstring>SpecifyAP_CB</cstring> 237 <cstring>SpecifyAP_CB</cstring>
244 </property> 238 </property>
245 <property stdset="1"> 239 <property stdset="1">
246 <name>text</name> 240 <name>text</name>
247 <string>Specify &amp;Access Point</string> 241 <string>Specify Access Point</string>
248 </property> 242 </property>
249 </widget> 243 </widget>
250 <widget row="1" column="1" > 244 <widget row="1" column="1" >
251 <class>QLabel</class> 245 <class>QLabel</class>
252 <property stdset="1"> 246 <property stdset="1">
253 <name>name</name> 247 <name>name</name>
@@ -307,66 +301,12 @@
307 <height>20</height> 301 <height>20</height>
308 </size> 302 </size>
309 </property> 303 </property>
310 </spacer> 304 </spacer>
311 </grid> 305 </grid>
312 </widget> 306 </widget>
313 <widget>
314 <class>QLayoutWidget</class>
315 <property stdset="1">
316 <name>name</name>
317 <cstring>Layout7</cstring>
318 </property>
319 <property>
320 <name>layoutMargin</name>
321 </property>
322 <hbox>
323 <property stdset="1">
324 <name>margin</name>
325 <number>1</number>
326 </property>
327 <property stdset="1">
328 <name>spacing</name>
329 <number>6</number>
330 </property>
331 <widget>
332 <class>QCheckBox</class>
333 <property stdset="1">
334 <name>name</name>
335 <cstring>SpecifyChannel_CB</cstring>
336 </property>
337 <property stdset="1">
338 <name>text</name>
339 <string>Specific &amp;Channel</string>
340 </property>
341 </widget>
342 <widget>
343 <class>QSpinBox</class>
344 <property stdset="1">
345 <name>name</name>
346 <cstring>ChannelNr_SB</cstring>
347 </property>
348 <property stdset="1">
349 <name>enabled</name>
350 <bool>false</bool>
351 </property>
352 <property stdset="1">
353 <name>maxValue</name>
354 <number>15</number>
355 </property>
356 <property stdset="1">
357 <name>minValue</name>
358 <number>1</number>
359 </property>
360 <property stdset="1">
361 <name>value</name>
362 <number>1</number>
363 </property>
364 </widget>
365 </hbox>
366 </widget>
367 <spacer> 307 <spacer>
368 <property> 308 <property>
369 <name>name</name> 309 <name>name</name>
370 <cstring>Spacer7</cstring> 310 <cstring>Spacer7</cstring>
371 </property> 311 </property>
372 <property stdset="1"> 312 <property stdset="1">
@@ -407,13 +347,13 @@
407 <number>2</number> 347 <number>2</number>
408 </property> 348 </property>
409 <widget> 349 <widget>
410 <class>QCheckBox</class> 350 <class>QCheckBox</class>
411 <property stdset="1"> 351 <property stdset="1">
412 <name>name</name> 352 <name>name</name>
413 <cstring>EnableWEB_CB</cstring> 353 <cstring>EnableWEP_CB</cstring>
414 </property> 354 </property>
415 <property stdset="1"> 355 <property stdset="1">
416 <name>text</name> 356 <name>text</name>
417 <string>&amp;Enable Encryption</string> 357 <string>&amp;Enable Encryption</string>
418 </property> 358 </property>
419 </widget> 359 </widget>
@@ -508,34 +448,46 @@
508 <widget row="1" column="1" > 448 <widget row="1" column="1" >
509 <class>QLineEdit</class> 449 <class>QLineEdit</class>
510 <property stdset="1"> 450 <property stdset="1">
511 <name>name</name> 451 <name>name</name>
512 <cstring>Key2_LE</cstring> 452 <cstring>Key2_LE</cstring>
513 </property> 453 </property>
454 <property stdset="1">
455 <name>enabled</name>
456 <bool>false</bool>
457 </property>
514 </widget> 458 </widget>
515 <widget row="3" column="1" > 459 <widget row="3" column="1" >
516 <class>QLineEdit</class> 460 <class>QLineEdit</class>
517 <property stdset="1"> 461 <property stdset="1">
518 <name>name</name> 462 <name>name</name>
519 <cstring>Key4_LE</cstring> 463 <cstring>Key4_LE</cstring>
520 </property> 464 </property>
465 <property stdset="1">
466 <name>enabled</name>
467 <bool>false</bool>
468 </property>
521 </widget> 469 </widget>
522 <widget row="2" column="1" > 470 <widget row="2" column="1" >
523 <class>QLineEdit</class> 471 <class>QLineEdit</class>
524 <property stdset="1"> 472 <property stdset="1">
525 <name>name</name> 473 <name>name</name>
526 <cstring>Key3_LE</cstring> 474 <cstring>Key3_LE</cstring>
527 </property> 475 </property>
476 <property stdset="1">
477 <name>enabled</name>
478 <bool>false</bool>
479 </property>
528 </widget> 480 </widget>
529 </grid> 481 </grid>
530 </widget> 482 </widget>
531 <widget> 483 <widget>
532 <class>QCheckBox</class> 484 <class>QCheckBox</class>
533 <property stdset="1"> 485 <property stdset="1">
534 <name>name</name> 486 <name>name</name>
535 <cstring>CheckBox4</cstring> 487 <cstring>AcceptNonEncrypted_CB</cstring>
536 </property> 488 </property>
537 <property stdset="1"> 489 <property stdset="1">
538 <name>enabled</name> 490 <name>enabled</name>
539 <bool>false</bool> 491 <bool>false</bool>
540 </property> 492 </property>
541 <property stdset="1"> 493 <property stdset="1">
@@ -586,13 +538,13 @@
586 <number>2</number> 538 <number>2</number>
587 </property> 539 </property>
588 <widget> 540 <widget>
589 <class>QLayoutWidget</class> 541 <class>QLayoutWidget</class>
590 <property stdset="1"> 542 <property stdset="1">
591 <name>name</name> 543 <name>name</name>
592 <cstring>Layout12</cstring> 544 <cstring>Layout13</cstring>
593 </property> 545 </property>
594 <property> 546 <property>
595 <name>layoutSpacing</name> 547 <name>layoutSpacing</name>
596 </property> 548 </property>
597 <grid> 549 <grid>
598 <property stdset="1"> 550 <property stdset="1">
@@ -600,106 +552,92 @@
600 <number>0</number> 552 <number>0</number>
601 </property> 553 </property>
602 <property stdset="1"> 554 <property stdset="1">
603 <name>spacing</name> 555 <name>spacing</name>
604 <number>2</number> 556 <number>2</number>
605 </property> 557 </property>
606 <widget row="0" column="0" > 558 <widget row="4" column="1" >
607 <class>QLabel</class>
608 <property stdset="1">
609 <name>name</name>
610 <cstring>TextLabel1_3</cstring>
611 </property>
612 <property stdset="1">
613 <name>text</name>
614 <string>Station</string>
615 </property>
616 </widget>
617 <widget row="3" column="1" >
618 <class>QLabel</class> 559 <class>QLabel</class>
619 <property stdset="1"> 560 <property stdset="1">
620 <name>name</name> 561 <name>name</name>
621 <cstring>Channel_LBL</cstring> 562 <cstring>Frequency_LBL</cstring>
622 </property> 563 </property>
623 <property stdset="1"> 564 <property stdset="1">
624 <name>frameShape</name> 565 <name>frameShape</name>
625 <enum>Panel</enum> 566 <enum>Box</enum>
626 </property> 567 </property>
627 <property stdset="1"> 568 <property stdset="1">
628 <name>frameShadow</name> 569 <name>frameShadow</name>
629 <enum>Plain</enum> 570 <enum>Plain</enum>
630 </property> 571 </property>
631 <property stdset="1"> 572 <property stdset="1">
632 <name>indent</name> 573 <name>indent</name>
633 <number>0</number> 574 <number>0</number>
634 </property> 575 </property>
635 </widget> 576 </widget>
636 <widget row="3" column="0" >
637 <class>QLabel</class>
638 <property stdset="1">
639 <name>name</name>
640 <cstring>TextLabel4_3</cstring>
641 </property>
642 <property stdset="1">
643 <name>text</name>
644 <string>Channel</string>
645 </property>
646 </widget>
647 <widget row="2" column="0" > 577 <widget row="2" column="0" >
648 <class>QLabel</class> 578 <class>QLabel</class>
649 <property stdset="1"> 579 <property stdset="1">
650 <name>name</name> 580 <name>name</name>
651 <cstring>TextLabel3_3</cstring> 581 <cstring>TextLabel9_2</cstring>
652 </property> 582 </property>
653 <property stdset="1"> 583 <property stdset="1">
654 <name>text</name> 584 <name>text</name>
655 <string>Mode</string> 585 <string>AP</string>
656 </property> 586 </property>
657 </widget> 587 </widget>
658 <widget row="1" column="0" > 588 <widget row="5" column="1" >
659 <class>QLabel</class> 589 <class>QLabel</class>
660 <property stdset="1"> 590 <property stdset="1">
661 <name>name</name> 591 <name>name</name>
662 <cstring>TextLabel2_3</cstring> 592 <cstring>Channel_LBL</cstring>
663 </property> 593 </property>
664 <property stdset="1"> 594 <property stdset="1">
665 <name>text</name> 595 <name>frameShape</name>
666 <string>ESSID</string> 596 <enum>Box</enum>
667 </property> 597 </property>
668 </widget>
669 <widget row="4" column="0" >
670 <class>QLabel</class>
671 <property stdset="1"> 598 <property stdset="1">
672 <name>name</name> 599 <name>frameShadow</name>
673 <cstring>TextLabel9_2</cstring> 600 <enum>Plain</enum>
674 </property> 601 </property>
675 <property stdset="1"> 602 <property stdset="1">
676 <name>text</name> 603 <name>indent</name>
677 <string>AP</string> 604 <number>0</number>
678 </property> 605 </property>
679 </widget> 606 </widget>
680 <widget row="0" column="1" > 607 <widget row="0" column="1" >
681 <class>QLabel</class> 608 <class>QLabel</class>
682 <property stdset="1"> 609 <property stdset="1">
683 <name>name</name> 610 <name>name</name>
684 <cstring>Station_LBL</cstring> 611 <cstring>Station_LBL</cstring>
685 </property> 612 </property>
686 <property stdset="1"> 613 <property stdset="1">
687 <name>frameShape</name> 614 <name>frameShape</name>
688 <enum>Panel</enum> 615 <enum>Box</enum>
689 </property> 616 </property>
690 <property stdset="1"> 617 <property stdset="1">
691 <name>frameShadow</name> 618 <name>frameShadow</name>
692 <enum>Plain</enum> 619 <enum>Plain</enum>
693 </property> 620 </property>
694 <property stdset="1"> 621 <property stdset="1">
695 <name>indent</name> 622 <name>indent</name>
696 <number>0</number> 623 <number>0</number>
697 </property> 624 </property>
698 </widget> 625 </widget>
699 <widget row="5" column="1" > 626 <widget row="6" column="0" >
627 <class>QLabel</class>
628 <property stdset="1">
629 <name>name</name>
630 <cstring>TextLabel4_2_2</cstring>
631 </property>
632 <property stdset="1">
633 <name>text</name>
634 <string>Rate</string>
635 </property>
636 </widget>
637 <widget row="6" column="1" >
700 <class>QLabel</class> 638 <class>QLabel</class>
701 <property stdset="1"> 639 <property stdset="1">
702 <name>name</name> 640 <name>name</name>
703 <cstring>Rate_LBL</cstring> 641 <cstring>Rate_LBL</cstring>
704 </property> 642 </property>
705 <property stdset="1"> 643 <property stdset="1">
@@ -708,43 +646,51 @@
708 <hsizetype>7</hsizetype> 646 <hsizetype>7</hsizetype>
709 <vsizetype>1</vsizetype> 647 <vsizetype>1</vsizetype>
710 </sizepolicy> 648 </sizepolicy>
711 </property> 649 </property>
712 <property stdset="1"> 650 <property stdset="1">
713 <name>frameShape</name> 651 <name>frameShape</name>
714 <enum>Panel</enum> 652 <enum>Box</enum>
715 </property> 653 </property>
716 <property stdset="1"> 654 <property stdset="1">
717 <name>frameShadow</name> 655 <name>frameShadow</name>
718 <enum>Plain</enum> 656 <enum>Plain</enum>
719 </property> 657 </property>
720 <property stdset="1"> 658 <property stdset="1">
721 <name>indent</name> 659 <name>indent</name>
722 <number>0</number> 660 <number>0</number>
723 </property> 661 </property>
724 </widget> 662 </widget>
725 <widget row="5" column="0" > 663 <widget row="2" column="1" >
726 <class>QLabel</class> 664 <class>QLabel</class>
727 <property stdset="1"> 665 <property stdset="1">
728 <name>name</name> 666 <name>name</name>
729 <cstring>TextLabel4_2_2</cstring> 667 <cstring>AP_LBL</cstring>
730 </property> 668 </property>
731 <property stdset="1"> 669 <property stdset="1">
732 <name>text</name> 670 <name>frameShape</name>
733 <string>Rate</string> 671 <enum>Box</enum>
672 </property>
673 <property stdset="1">
674 <name>frameShadow</name>
675 <enum>Plain</enum>
676 </property>
677 <property stdset="1">
678 <name>indent</name>
679 <number>0</number>
734 </property> 680 </property>
735 </widget> 681 </widget>
736 <widget row="4" column="1" > 682 <widget row="3" column="1" >
737 <class>QLabel</class> 683 <class>QLabel</class>
738 <property stdset="1"> 684 <property stdset="1">
739 <name>name</name> 685 <name>name</name>
740 <cstring>AP_LBL</cstring> 686 <cstring>Mode_LBL</cstring>
741 </property> 687 </property>
742 <property stdset="1"> 688 <property stdset="1">
743 <name>frameShape</name> 689 <name>frameShape</name>
744 <enum>Panel</enum> 690 <enum>Box</enum>
745 </property> 691 </property>
746 <property stdset="1"> 692 <property stdset="1">
747 <name>frameShadow</name> 693 <name>frameShadow</name>
748 <enum>Plain</enum> 694 <enum>Plain</enum>
749 </property> 695 </property>
750 <property stdset="1"> 696 <property stdset="1">
@@ -757,51 +703,91 @@
757 <property stdset="1"> 703 <property stdset="1">
758 <name>name</name> 704 <name>name</name>
759 <cstring>ESSID_LBL</cstring> 705 <cstring>ESSID_LBL</cstring>
760 </property> 706 </property>
761 <property stdset="1"> 707 <property stdset="1">
762 <name>frameShape</name> 708 <name>frameShape</name>
763 <enum>Panel</enum> 709 <enum>Box</enum>
764 </property> 710 </property>
765 <property stdset="1"> 711 <property stdset="1">
766 <name>frameShadow</name> 712 <name>frameShadow</name>
767 <enum>Plain</enum> 713 <enum>Plain</enum>
768 </property> 714 </property>
769 <property stdset="1"> 715 <property stdset="1">
770 <name>indent</name> 716 <name>indent</name>
771 <number>0</number> 717 <number>0</number>
772 </property> 718 </property>
773 </widget> 719 </widget>
774 <widget row="2" column="1" > 720 <widget row="3" column="0" >
775 <class>QLabel</class> 721 <class>QLabel</class>
776 <property stdset="1"> 722 <property stdset="1">
777 <name>name</name> 723 <name>name</name>
778 <cstring>Mode_LBL</cstring> 724 <cstring>TextLabel3_3</cstring>
779 </property> 725 </property>
780 <property stdset="1"> 726 <property stdset="1">
781 <name>frameShape</name> 727 <name>text</name>
782 <enum>Panel</enum> 728 <string>Mode</string>
783 </property> 729 </property>
730 </widget>
731 <widget row="5" column="0" >
732 <class>QLabel</class>
784 <property stdset="1"> 733 <property stdset="1">
785 <name>frameShadow</name> 734 <name>name</name>
786 <enum>Plain</enum> 735 <cstring>TextLabel4_3</cstring>
787 </property> 736 </property>
788 <property stdset="1"> 737 <property stdset="1">
789 <name>indent</name> 738 <name>text</name>
790 <number>0</number> 739 <string>Channel</string>
740 </property>
741 </widget>
742 <widget row="0" column="0" >
743 <class>QLabel</class>
744 <property stdset="1">
745 <name>name</name>
746 <cstring>TextLabel1_3</cstring>
747 </property>
748 <property stdset="1">
749 <name>text</name>
750 <string>Station</string>
751 </property>
752 </widget>
753 <widget row="1" column="0" >
754 <class>QLabel</class>
755 <property stdset="1">
756 <name>name</name>
757 <cstring>TextLabel2_3</cstring>
758 </property>
759 <property stdset="1">
760 <name>text</name>
761 <string>ESSID</string>
762 </property>
763 </widget>
764 <widget row="4" column="0" >
765 <class>QLabel</class>
766 <property stdset="1">
767 <name>name</name>
768 <cstring>TextLabel4_3_2</cstring>
769 </property>
770 <property stdset="1">
771 <name>text</name>
772 <string>Frequency</string>
791 </property> 773 </property>
792 </widget> 774 </widget>
793 </grid> 775 </grid>
794 </widget> 776 </widget>
795 <widget> 777 <widget>
796 <class>QGroupBox</class> 778 <class>QGroupBox</class>
797 <property stdset="1"> 779 <property stdset="1">
798 <name>name</name> 780 <name>name</name>
799 <cstring>GroupBox1</cstring> 781 <cstring>GroupBox1</cstring>
800 </property> 782 </property>
801 <property stdset="1"> 783 <property stdset="1">
784 <name>margin</name>
785 <number>0</number>
786 </property>
787 <property stdset="1">
802 <name>title</name> 788 <name>title</name>
803 <string>Link Quality</string> 789 <string>Link Quality</string>
804 </property> 790 </property>
805 <property> 791 <property>
806 <name>layoutMargin</name> 792 <name>layoutMargin</name>
807 </property> 793 </property>
@@ -812,13 +798,13 @@
812 <property stdset="1"> 798 <property stdset="1">
813 <name>margin</name> 799 <name>margin</name>
814 <number>2</number> 800 <number>2</number>
815 </property> 801 </property>
816 <property stdset="1"> 802 <property stdset="1">
817 <name>spacing</name> 803 <name>spacing</name>
818 <number>2</number> 804 <number>0</number>
819 </property> 805 </property>
820 <widget row="1" column="0" > 806 <widget row="1" column="0" >
821 <class>QLabel</class> 807 <class>QLabel</class>
822 <property stdset="1"> 808 <property stdset="1">
823 <name>name</name> 809 <name>name</name>
824 <cstring>TextLabel2_2_2</cstring> 810 <cstring>TextLabel2_2_2</cstring>
@@ -844,24 +830,24 @@
844 <property stdset="1"> 830 <property stdset="1">
845 <name>name</name> 831 <name>name</name>
846 <cstring>Noise_PB</cstring> 832 <cstring>Noise_PB</cstring>
847 </property> 833 </property>
848 <property stdset="1"> 834 <property stdset="1">
849 <name>progress</name> 835 <name>progress</name>
850 <number>0</number> 836 <number>10</number>
851 </property> 837 </property>
852 </widget> 838 </widget>
853 <widget row="2" column="2" > 839 <widget row="2" column="2" >
854 <class>QProgressBar</class> 840 <class>QProgressBar</class>
855 <property stdset="1"> 841 <property stdset="1">
856 <name>name</name> 842 <name>name</name>
857 <cstring>Quality_PB</cstring> 843 <cstring>Quality_PB</cstring>
858 </property> 844 </property>
859 <property stdset="1"> 845 <property stdset="1">
860 <name>progress</name> 846 <name>progress</name>
861 <number>0</number> 847 <number>10</number>
862 </property> 848 </property>
863 </widget> 849 </widget>
864 <widget row="0" column="0" > 850 <widget row="0" column="0" >
865 <class>QLabel</class> 851 <class>QLabel</class>
866 <property stdset="1"> 852 <property stdset="1">
867 <name>name</name> 853 <name>name</name>
@@ -869,33 +855,12 @@
869 </property> 855 </property>
870 <property stdset="1"> 856 <property stdset="1">
871 <name>text</name> 857 <name>text</name>
872 <string>Signal</string> 858 <string>Signal</string>
873 </property> 859 </property>
874 </widget> 860 </widget>
875 <spacer row="0" column="1" >
876 <property>
877 <name>name</name>
878 <cstring>Spacer28</cstring>
879 </property>
880 <property stdset="1">
881 <name>orientation</name>
882 <enum>Horizontal</enum>
883 </property>
884 <property stdset="1">
885 <name>sizeType</name>
886 <enum>Fixed</enum>
887 </property>
888 <property>
889 <name>sizeHint</name>
890 <size>
891 <width>16</width>
892 <height>20</height>
893 </size>
894 </property>
895 </spacer>
896 <widget row="0" column="2" > 861 <widget row="0" column="2" >
897 <class>QProgressBar</class> 862 <class>QProgressBar</class>
898 <property stdset="1"> 863 <property stdset="1">
899 <name>name</name> 864 <name>name</name>
900 <cstring>Signal_PB</cstring> 865 <cstring>Signal_PB</cstring>
901 </property> 866 </property>
@@ -906,13 +871,13 @@
906 <property stdset="1"> 871 <property stdset="1">
907 <name>lineWidth</name> 872 <name>lineWidth</name>
908 <number>1</number> 873 <number>1</number>
909 </property> 874 </property>
910 <property stdset="1"> 875 <property stdset="1">
911 <name>progress</name> 876 <name>progress</name>
912 <number>0</number> 877 <number>10</number>
913 </property> 878 </property>
914 </widget> 879 </widget>
915 </grid> 880 </grid>
916 </widget> 881 </widget>
917 <spacer> 882 <spacer>
918 <property> 883 <property>
@@ -932,20 +897,76 @@
932 <size> 897 <size>
933 <width>20</width> 898 <width>20</width>
934 <height>20</height> 899 <height>20</height>
935 </size> 900 </size>
936 </property> 901 </property>
937 </spacer> 902 </spacer>
903 <widget>
904 <class>QLayoutWidget</class>
905 <property stdset="1">
906 <name>name</name>
907 <cstring>Layout21</cstring>
908 </property>
909 <hbox>
910 <property stdset="1">
911 <name>margin</name>
912 <number>0</number>
913 </property>
914 <property stdset="1">
915 <name>spacing</name>
916 <number>6</number>
917 </property>
918 <widget>
919 <class>QCheckBox</class>
920 <property stdset="1">
921 <name>name</name>
922 <cstring>Refresh_CB</cstring>
923 </property>
924 <property stdset="1">
925 <name>sizePolicy</name>
926 <sizepolicy>
927 <hsizetype>1</hsizetype>
928 <vsizetype>5</vsizetype>
929 </sizepolicy>
930 </property>
931 <property stdset="1">
932 <name>text</name>
933 <string>Live feed </string>
934 </property>
935 </widget>
936 <spacer>
937 <property>
938 <name>name</name>
939 <cstring>Spacer16</cstring>
940 </property>
941 <property stdset="1">
942 <name>orientation</name>
943 <enum>Horizontal</enum>
944 </property>
945 <property stdset="1">
946 <name>sizeType</name>
947 <enum>Expanding</enum>
948 </property>
949 <property>
950 <name>sizeHint</name>
951 <size>
952 <width>20</width>
953 <height>20</height>
954 </size>
955 </property>
956 </spacer>
957 </hbox>
958 </widget>
938 </vbox> 959 </vbox>
939 </widget> 960 </widget>
940 </widget> 961 </widget>
941 </vbox> 962 </vbox>
942</widget> 963</widget>
943<connections> 964<connections>
944 <connection> 965 <connection>
945 <sender>EnableWEB_CB</sender> 966 <sender>EnableWEP_CB</sender>
946 <signal>toggled(bool)</signal> 967 <signal>toggled(bool)</signal>
947 <receiver>KeyButtonGroup</receiver> 968 <receiver>KeyButtonGroup</receiver>
948 <slot>setEnabled(bool)</slot> 969 <slot>setEnabled(bool)</slot>
949 </connection> 970 </connection>
950 <connection> 971 <connection>
951 <sender>SpecifyAP_CB</sender> 972 <sender>SpecifyAP_CB</sender>
@@ -957,19 +978,44 @@
957 <sender>SpecifyAP_CB</sender> 978 <sender>SpecifyAP_CB</sender>
958 <signal>toggled(bool)</signal> 979 <signal>toggled(bool)</signal>
959 <receiver>macLabel</receiver> 980 <receiver>macLabel</receiver>
960 <slot>setEnabled(bool)</slot> 981 <slot>setEnabled(bool)</slot>
961 </connection> 982 </connection>
962 <connection> 983 <connection>
963 <sender>SpecifyChannel_CB</sender> 984 <sender>EnableWEP_CB</sender>
985 <signal>toggled(bool)</signal>
986 <receiver>AcceptNonEncrypted_CB</receiver>
987 <slot>setEnabled(bool)</slot>
988 </connection>
989 <connection>
990 <sender>Key1_RB</sender>
991 <signal>toggled(bool)</signal>
992 <receiver>Key1_LE</receiver>
993 <slot>setEnabled(bool)</slot>
994 </connection>
995 <connection>
996 <sender>Key2_RB</sender>
997 <signal>toggled(bool)</signal>
998 <receiver>Key2_LE</receiver>
999 <slot>setEnabled(bool)</slot>
1000 </connection>
1001 <connection>
1002 <sender>Key3_RB</sender>
964 <signal>toggled(bool)</signal> 1003 <signal>toggled(bool)</signal>
965 <receiver>ChannelNr_SB</receiver> 1004 <receiver>Key3_LE</receiver>
966 <slot>setEnabled(bool)</slot> 1005 <slot>setEnabled(bool)</slot>
967 </connection> 1006 </connection>
968 <connection> 1007 <connection>
969 <sender>EnableWEB_CB</sender> 1008 <sender>Key4_RB</sender>
970 <signal>toggled(bool)</signal> 1009 <signal>toggled(bool)</signal>
971 <receiver>CheckBox4</receiver> 1010 <receiver>Key4_LE</receiver>
972 <slot>setEnabled(bool)</slot> 1011 <slot>setEnabled(bool)</slot>
973 </connection> 1012 </connection>
1013 <connection>
1014 <sender>Refresh_CB</sender>
1015 <signal>toggled(bool)</signal>
1016 <receiver>WLanGUI</receiver>
1017 <slot>SLOT_AutoRefresh(bool)</slot>
1018 </connection>
1019 <slot access="public">SLOT_AutoRefresh(bool)</slot>
974</connections> 1020</connections>
975</UI> 1021</UI>
diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.cpp b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp
index 78e756c..61969f2 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NNI.cpp
+++ b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp
@@ -1,23 +1,74 @@
1#include <unistd.h>
1#include "wlanedit.h" 2#include "wlanedit.h"
2#include "wlan_NNI.h" 3#include "wlan_NNI.h"
3#include "wlan_NN.h" 4#include "wlan_NN.h"
4 5
5AWLan::AWLan( WLanNetNode * PNN ) : ANetNodeInstance( PNN ) { 6AWLan::AWLan( WLanNetNode * PNN ) : ANetNodeInstance( PNN ) {
6 GUI = 0; 7 GUI = 0;
7 RT = 0; 8 RT = 0;
9 Data.ESSID = "";
10 Data.NodeName = tr("<UseHostName>");
11 Data.Mode = 0;
12 Data.SpecificAP = 0;
13 Data.APMac = "";
14 Data.Encrypted = 0;
15 Data.AcceptNonEncrypted = 0;
16 Data.Key[0] = "";
17 Data.Key[1] = "";
18 Data.Key[2] = "";
19 Data.Key[3] = "";
8} 20}
9 21
10void AWLan::setSpecificAttribute( QString & , QString & ) { 22void AWLan::setSpecificAttribute( QString & A, QString & V ) {
23 if( A == "essid" ) {
24 Data.ESSID = V;
25 } else if( A == "nodename" ) {
26 Data.NodeName = V;
27 } else if( A == "mode" ) {
28 Data.Mode = V.toShort();
29 } else if( A == "specificap" ) {
30 Data.SpecificAP = (V=="yes");
31 } else if( A == "apmac" ) {
32 Data.APMac = V;
33 } else if( A == "encrypted" ) {
34 Data.Encrypted = (V=="yes");
35 } else if( A == "acceptnonencrypted" ) {
36 Data.AcceptNonEncrypted = (V=="yes");
37 } else if( A == "key0" ) {
38 Data.Key[0] = V;
39 } else if( A == "key1" ) {
40 Data.Key[1] = V;
41 } else if( A == "key2" ) {
42 Data.Key[2] = V;
43 } else if( A == "key3" ) {
44 Data.Key[3] = V;
45 }
11} 46}
12 47
13void AWLan::saveSpecificAttribute( QTextStream & ) { 48void AWLan::saveSpecificAttribute( QTextStream & S ) {
49 S << "essid=" << quote( Data.ESSID ) << endl;
50 S << "nodename=" << quote( Data.NodeName ) << endl;
51 S << "mode=" << Data.Mode << endl;
52 S << "specificap="
53 << ((Data.SpecificAP) ? "yes" : "no")
54 << endl;
55 S << "apmac=" << Data.APMac << endl;
56 S << "encrypted="
57 << ((Data.Encrypted) ? "yes" : "no")
58 << endl;
59 S << "acceptnonencrypted="
60 << ((Data.AcceptNonEncrypted) ? "yes" : "no")
61 << endl;
62 for( int i = 0 ;i < 4 ; i ++ ) {
63 S << "key" << i << "=" << Data.Key[i] << endl;
64 }
14} 65}
15 66
16QWidget * AWLan::edit( QWidget * parent ) { 67QWidget * AWLan::edit( QWidget * parent ) {
17 GUI = new WLanEdit( parent ); 68 GUI = new WLanEdit( parent, this );
18 GUI->showData( Data ); 69 GUI->showData( Data );
19 return GUI; 70 return GUI;
20} 71}
21 72
22QString AWLan::acceptable( void ) { 73QString AWLan::acceptable( void ) {
23 return ( GUI ) ? GUI->acceptable( ) : QString(); 74 return ( GUI ) ? GUI->acceptable( ) : QString();
@@ -26,11 +77,64 @@ QString AWLan::acceptable( void ) {
26void AWLan::commit( void ) { 77void AWLan::commit( void ) {
27 if( GUI && GUI->commit( Data ) ) 78 if( GUI && GUI->commit( Data ) )
28 setModified( 1 ); 79 setModified( 1 );
29} 80}
30 81
31bool AWLan::generateDataForCommonFile( 82bool AWLan::generateDataForCommonFile(
32 SystemFile &, 83 SystemFile & S,
33 long ) { 84 long ) {
34 return 1; 85
86 S << " wireless_essid \""
87 << Data.ESSID
88 << "\""
89 << endl;
90
91 if( ! Data.NodeName.isEmpty() ) {
92 if( Data.NodeName == tr("<UseHostName>") ) {
93 char Buf[100];
94 if( gethostname(Buf, sizeof(Buf) ) == 0 ) {
95 Buf[99] = '\0'; // just to make sure
96 S << " wireless_nick "
97 << Buf
98 << endl;
99 }
100 } else {
101 S << " wireless_nick \""
102 << Data.NodeName
103 << "\""
104 << endl;
105 }
106 }
107
108 char * M;
109 switch ( Data.Mode ) {
110 case 0 :
111 M = "Auto";
112 break;
113 case 1 :
114 M = "Managed";
115 break;
116 case 2 :
117 M = "Ad-Hoc";
118 break;
119 }
120
121 S << " wireless_mode "
122 << M
123 << endl;
124 if( Data.Encrypted ) {
125 for( int i = 0; i < 4; i ++ ) {
126 if( ! Data.Key[i].isEmpty() ) {
127 S << " wireless_key"
128 << i
129 << " "
130 << Data.Key[i]
131 << endl;
132 }
133 }
134 S << " wireless_keymode "
135 << ((Data.AcceptNonEncrypted) ? "open" : "restricted")
136 << endl;
137 }
138 return 0;
35} 139}
36 140
diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.h b/noncore/settings/networksettings2/wlan/wlan_NNI.h
index d861d13..2211c47 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NNI.h
+++ b/noncore/settings/networksettings2/wlan/wlan_NNI.h
@@ -25,13 +25,13 @@ public :
25 } 25 }
26 26
27 virtual void * data( void ) 27 virtual void * data( void )
28 { return (void *)&Data; } 28 { return (void *)&Data; }
29 29
30 virtual bool hasDataFor( const QString & ) 30 virtual bool hasDataFor( const QString & )
31 { return 0; } 31 { return 1; }
32 virtual bool generateDataForCommonFile( 32 virtual bool generateDataForCommonFile(
33 SystemFile & SF, long DevNr ); 33 SystemFile & SF, long DevNr );
34protected : 34protected :
35 35
36 virtual void setSpecificAttribute( QString & Attr, QString & Value ); 36 virtual void setSpecificAttribute( QString & Attr, QString & Value );
37 virtual void saveSpecificAttribute( QTextStream & TS ); 37 virtual void saveSpecificAttribute( QTextStream & TS );
diff --git a/noncore/settings/networksettings2/wlan/wlandata.h b/noncore/settings/networksettings2/wlan/wlandata.h
index ba1f2c2..36990a9 100644
--- a/noncore/settings/networksettings2/wlan/wlandata.h
+++ b/noncore/settings/networksettings2/wlan/wlandata.h
@@ -1,17 +1,16 @@
1#ifndef WLAN_DATA_H 1#ifndef WLAN_DATA_H
2#define WLAN_DATA_H 2#define WLAN_DATA_H
3 3
4#include <qstring.h> 4#include <qstring.h>
5typedef struct WLanData { 5typedef struct WLanData {
6 QString Device; 6 QString ESSID;
7 QString LockFile; 7 QString NodeName;
8 long Speed; 8 short Mode;
9 short Parity; 9 bool SpecificAP;
10 short DataBits; 10 QString APMac;
11 short StopBits; 11 bool Encrypted;
12 bool HardwareControl; 12 QString Key[4];
13 bool SoftwareControl; 13 bool AcceptNonEncrypted;
14
15} WLanData_t; 14} WLanData_t;
16 15
17#endif 16#endif
diff --git a/noncore/settings/networksettings2/wlan/wlanedit.cpp b/noncore/settings/networksettings2/wlan/wlanedit.cpp
index c884886..8d3979e 100644
--- a/noncore/settings/networksettings2/wlan/wlanedit.cpp
+++ b/noncore/settings/networksettings2/wlan/wlanedit.cpp
@@ -1,16 +1,115 @@
1#include <qlineedit.h>
2#include <qprogressbar.h>
3#include <qcombobox.h>
4#include <qlabel.h>
5#include <qregexp.h>
6#include <qcheckbox.h>
1#include <GUIUtils.h> 7#include <GUIUtils.h>
8#include <resources.h>
9#include <wextensions.h>
10
2#include "wlanedit.h" 11#include "wlanedit.h"
12#include "wlan_NN.h"
13#include "wlan_NNI.h"
14
15WLanEdit::WLanEdit( QWidget * Parent, ANetNodeInstance * TNNI ) :
16 WLanGUI( Parent ), RefreshTimer(this){
17
18 InterfaceInfo * II;
19
20 NNI = TNNI;
21 Dev = NNI->runtime()->device();
22 WE = 0;
23 if( ( II = Dev->assignedInterface() ) ) {
24 // show data
25 WE = new WExtensions( II->Name );
26
27 if( WE->doesHaveWirelessExtensions() ) {
28 QString S;
29 Station_LBL->setText( WE->station() );
30 ESSID_LBL->setText( WE->essid() );
31 Mode_LBL->setText( WE->mode() );
32 S.setNum( WE->frequency() );
33 Frequency_LBL->setText( S );
34 S.setNum( WE->channel() );
35 Channel_LBL->setText( S );
36 S.setNum( WE->rate() );
37 Rate_LBL->setText( S );
38 AP_LBL->setText( WE->ap() );
39
40 SLOT_Refresh();
41
42 connect( &RefreshTimer, SIGNAL( timeout() ),
43 this, SLOT( SLOT_Refresh() ) );
44 }
45 }
46}
3 47
4WLanEdit::WLanEdit( QWidget * Parent ) : WLanGUI( Parent ){ 48WLanEdit::~WLanEdit( void ) {
49 if( WE )
50 delete WE;
5} 51}
6 52
7QString WLanEdit::acceptable( void ) { 53QString WLanEdit::acceptable( void ) {
54 if( ESSID_LE->text().isEmpty() ) {
55 return QString("ESSID is mandatory");
56 }
57 if( SpecifyAP_CB->isChecked() &&
58 APMac_LE->text().isEmpty() ) {
59 return QString("APMac must have value");
60 }
8 return QString(); 61 return QString();
9} 62}
10 63
11void WLanEdit::showData( WLanData_t & Data ) { 64void WLanEdit::showData( WLanData_t & Data ) {
65 Mode_CB->setCurrentItem( Data.Mode );
66 ESSID_LE->setText( Data.ESSID );
67 NodeName_LE->setText( Data.NodeName );
68 SpecifyAP_CB->setChecked( Data.SpecificAP );
69 APMac_LE->setText( Data.APMac );
70
71 EnableWEP_CB->setChecked( Data.Encrypted );
72 AcceptNonEncrypted_CB->setChecked( Data.AcceptNonEncrypted );
73 Key1_LE->setText( Data.Key[0] );
74 Key2_LE->setText( Data.Key[1] );
75 Key3_LE->setText( Data.Key[2] );
76 Key4_LE->setText( Data.Key[3] );
12} 77}
13 78
14bool WLanEdit::commit( WLanData_t & Data ) { 79bool WLanEdit::commit( WLanData_t & Data ) {
80 bool SM = 0;
81
82 TXTM( Data.ESSID, ESSID_LE, SM );
83 TXTM( Data.NodeName, NodeName_LE, SM );
84 TXTM( Data.APMac, APMac_LE, SM );
85 TXTM( Data.Key[0], Key1_LE, SM );
86 TXTM( Data.Key[1], Key2_LE, SM );
87 TXTM( Data.Key[2], Key3_LE, SM );
88 TXTM( Data.Key[3], Key4_LE, SM );
89 CBM( Data.SpecificAP, SpecifyAP_CB, SM );
90 CBM( Data.Encrypted, EnableWEP_CB, SM );
91 CBM( Data.AcceptNonEncrypted, AcceptNonEncrypted_CB, SM );
92 CIM( Data.Mode, Mode_CB, SM );
15 return 0; 93 return 0;
16} 94}
95
96void WLanEdit::SLOT_Refresh( void ) {
97 if( WE ) {
98 int signal, noise, quality;
99 WE->stats( signal, noise, quality);
100
101 Signal_PB->setProgress( signal );
102 Noise_PB->setProgress( noise );
103 Quality_PB->setProgress( quality );
104 }
105}
106
107void WLanEdit::SLOT_AutoRefresh( bool ar ) {
108 if( ar ) {
109 RefreshTimer.start( 1000 );
110 SLOT_Refresh();
111 } else {
112 RefreshTimer.stop();
113 }
114}
115
diff --git a/noncore/settings/networksettings2/wlan/wlanedit.h b/noncore/settings/networksettings2/wlan/wlanedit.h
index b7442d5..e550c14 100644
--- a/noncore/settings/networksettings2/wlan/wlanedit.h
+++ b/noncore/settings/networksettings2/wlan/wlanedit.h
@@ -1,12 +1,32 @@
1#include <qtimer.h>
2#include <wextensions.h>
1#include "wlandata.h" 3#include "wlandata.h"
2#include "wlanGUI.h" 4#include "wlanGUI.h"
3 5
6class ANetNodeInstance;
7class AsDevice;
8class WExtensions;
9
4class WLanEdit : public WLanGUI { 10class WLanEdit : public WLanGUI {
5 11
6public : 12public :
7 13
8 WLanEdit( QWidget * parent ); 14 WLanEdit( QWidget * parent, ANetNodeInstance * NNI );
15 ~WLanEdit( void );
9 QString acceptable( void ); 16 QString acceptable( void );
10 void showData( WLanData_t & Data ); 17 void showData( WLanData_t & Data );
11 bool commit( WLanData_t & Data ); 18 bool commit( WLanData_t & Data );
19
20public slots :
21
22 void SLOT_AutoRefresh( bool );
23 void SLOT_Refresh( void );
24
25private :
26
27 ANetNodeInstance * NNI;
28 AsDevice * Dev;
29 QTimer RefreshTimer;
30 WExtensions * WE;
31
12}; 32};
diff --git a/noncore/settings/networksettings2/wlan/wlanrun.cpp b/noncore/settings/networksettings2/wlan/wlanrun.cpp
index 79f11f7..3f1d4a9 100644
--- a/noncore/settings/networksettings2/wlan/wlanrun.cpp
+++ b/noncore/settings/networksettings2/wlan/wlanrun.cpp
@@ -1,5 +1,185 @@
1
2#include <qfile.h>
3#include <qtextstream.h>
4#include <qstringlist.h>
5#include <resources.h>
1#include "wlanrun.h" 6#include "wlanrun.h"
2 7
8void WLanRun::detectState( NodeCollection * NC ) {
9
10 // unavailable : no card found
11 // available : card found and assigned to us or free
12 // up : card found and assigned to us and up
13
14 QString S = QString( "/tmp/profile-%1.up" ).arg(NC->number());
15 System & Sys = NSResources->system();
16 InterfaceInfo * Run;
17
18 QFile F( S );
19
20 if( F.open( IO_ReadOnly ) ) {
21 // could open file -> read interface and assign
22 QString X;
23 QTextStream TS(&F);
24 X = TS.readLine();
25 // find interface
26 if( handlesInterface( X ) ) {
27 for( QDictIterator<InterfaceInfo> It(Sys.interfaces());
28 It.current();
29 ++It ) {
30 Run = It.current();
31 if( X == Run->Name ) {
32 Run->assignNode( netNode() );
33 assignInterface( Run );
34 NC->setCurrentState( IsUp );
35 return;
36 }
37 }
38 }
39 }
40
41 if( ( Run = assignedInterface() ) ) {
42 // we already have an interface assigned -> still present ?
43 if( ! Run->IsUp ) {
44 // usb is still free -> keep assignment
45 NC->setCurrentState( Available );
46 return;
47 } // else interface is up but NOT us -> some other profile
48 }
49
50 // nothing (valid) assigned to us
51 assignInterface( 0 );
52
53 // find possible interface
54 for( QDictIterator<InterfaceInfo> It(Sys.interfaces());
55 It.current();
56 ++It ) {
57 Run = It.current();
58 if( handlesInterface( *Run ) &&
59 ( Run->CardType == ARPHRD_ETHER
60#ifdef ARPHRD_IEEE1394
61 || Run->CardType == ARPHRD_IEEE1394
62#endif
63 ) &&
64 ! Run->IsUp
65 ) {
66 // proper type, and Not UP -> free
67 NC->setCurrentState( Off );
68 return;
69 }
70 }
71 // no free found
72
73 NC->setCurrentState( Unavailable );
74
75}
76
77bool WLanRun::setState( NodeCollection * NC, Action_t A, bool ) {
78
79 // we only handle activate and deactivate
80 switch( A ) {
81 case Activate :
82 {
83 if( NC->currentState() != Off ) {
84 return 0;
85 }
86 InterfaceInfo * N = getInterface();
87 if( ! N ) {
88 // no interface available
89 NC->setCurrentState( Unavailable );
90 return 0;
91 }
92 // because we were OFF the interface
93 // we get back is NOT assigned
94 N->assignNode( netNode() );
95 assignInterface( N );
96 NC->setCurrentState( Available );
97 return 1;
98 }
99 case Deactivate :
100 if( NC->currentState() == IsUp ) {
101 // bring down first
102 if( ! connection()->setState( Down ) )
103 // could not ...
104 return 0;
105 } else if( NC->currentState() != Available ) {
106 return 1;
107 }
108 assignedInterface()->assignNode( 0 ); // release
109 assignInterface( 0 );
110 NC->setCurrentState( Off );
111 return 1;
112 default :
113 // FT
114 break;
115 }
116 return 0;
117}
118
119bool WLanRun::canSetState( State_t Curr, Action_t A ) {
120 // we only handle up down activate and deactivate
121 switch( A ) {
122 case Activate :
123 { // at least available
124 if( Curr == Available ) {
125 return 1;
126 }
127 // or we can make one available
128 InterfaceInfo * N = getInterface();
129 if( ! N || N->assignedNode() != 0 ) {
130 // non available or assigned
131 return 0;
132 }
133 return 1;
134 }
135 case Deactivate :
136 return ( Curr >= Available );
137 default :
138 // FT
139 break;
140 }
141 return 0;
142}
143
144// get interface that is free or assigned to us
145InterfaceInfo * WLanRun::getInterface( void ) {
146
147 System & S = NSResources->system();
148 InterfaceInfo * best = 0, * Run;
149
150 for( QDictIterator<InterfaceInfo> It(S.interfaces());
151 It.current();
152 ++It ) {
153 Run = It.current();
154 if( handlesInterface( *Run ) &&
155 ( Run->CardType == ARPHRD_ETHER
156#ifdef ARPHRD_IEEE1394
157 || Run->CardType == ARPHRD_IEEE1394
158#endif
159 )
160 ) {
161 // this is a LAN card
162 if( Run->assignedNode() == netNode() ) {
163 // assigned to us
164 return Run;
165 } else if( Run->assignedNode() == 0 ) {
166 // free
167 best = Run;
168 }
169 }
170 }
171 return best; // can be 0
172}
173
3bool WLanRun::handlesInterface( const QString & S ) { 174bool WLanRun::handlesInterface( const QString & S ) {
175 InterfaceInfo * II;
176 II = NSResources->system().interface( S );
177 if( ( II = NSResources->system().interface( S ) ) ) {
178 return handlesInterface( *II );
179 }
4 return Pat.match( S ) >= 0; 180 return Pat.match( S ) >= 0;
5} 181}
182
183bool WLanRun::handlesInterface( const InterfaceInfo & II ) {
184 return ( Pat.match( II.Name ) < 0 );
185}
diff --git a/noncore/settings/networksettings2/wlan/wlanrun.h b/noncore/settings/networksettings2/wlan/wlanrun.h
index f46bcb7..25d5b96 100644
--- a/noncore/settings/networksettings2/wlan/wlanrun.h
+++ b/noncore/settings/networksettings2/wlan/wlanrun.h
@@ -18,23 +18,20 @@ public :
18 { return (AsDevice *)this; } 18 { return (AsDevice *)this; }
19 virtual AsDevice * asDevice( void ) 19 virtual AsDevice * asDevice( void )
20 { return (AsDevice *)this; } 20 { return (AsDevice *)this; }
21 21
22protected : 22protected :
23 23
24 void detectState( NodeCollection * ) 24 void detectState( NodeCollection * );
25 { } 25 bool setState( NodeCollection *, Action_t, bool );
26 26 bool canSetState( State_t, Action_t );
27 bool setState( NodeCollection *, Action_t )
28 { return 0; }
29
30 bool canSetState( State_t, Action_t )
31 { return 0; }
32
33 bool handlesInterface( const QString & I ); 27 bool handlesInterface( const QString & I );
28 bool handlesInterface( const InterfaceInfo & II );
34 29
35private : 30private :
36 31
32 InterfaceInfo * getInterface( void );
37 QRegExp Pat; 33 QRegExp Pat;
34 WLanData * Data;
38}; 35};
39 36
40#endif 37#endif