summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/wlan
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/wlan') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/wlan/wlanedit.cpp2
-rw-r--r--noncore/settings/networksettings2/wlan/wlanrun.cpp8
-rw-r--r--noncore/settings/networksettings2/wlan/wlanrun.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/noncore/settings/networksettings2/wlan/wlanedit.cpp b/noncore/settings/networksettings2/wlan/wlanedit.cpp
index 74174bf..73c0c7c 100644
--- a/noncore/settings/networksettings2/wlan/wlanedit.cpp
+++ b/noncore/settings/networksettings2/wlan/wlanedit.cpp
@@ -11,25 +11,25 @@
11#include "wlanedit.h" 11#include "wlanedit.h"
12#include "wlan_NN.h" 12#include "wlan_NN.h"
13#include "wlan_NNI.h" 13#include "wlan_NNI.h"
14 14
15WLanEdit::WLanEdit( QWidget * Parent, ANetNodeInstance * TNNI ) : 15WLanEdit::WLanEdit( QWidget * Parent, ANetNodeInstance * TNNI ) :
16 WLanGUI( Parent ), RefreshTimer(this){ 16 WLanGUI( Parent ), RefreshTimer(this){
17 17
18 InterfaceInfo * II; 18 InterfaceInfo * II;
19 19
20 NNI = TNNI; 20 NNI = TNNI;
21 Dev = NNI->runtime()->device(); 21 Dev = NNI->runtime()->device();
22 WE = 0; 22 WE = 0;
23 if( ( II = NNI->connection()->assignedInterface() ) ) { 23 if( ( II = NNI->networkSetup()->assignedInterface() ) ) {
24 // show data 24 // show data
25 WE = new WExtensions( II->Name ); 25 WE = new WExtensions( II->Name );
26 26
27 if( WE->doesHaveWirelessExtensions() ) { 27 if( WE->doesHaveWirelessExtensions() ) {
28 QString S; 28 QString S;
29 Station_LBL->setText( WE->station() ); 29 Station_LBL->setText( WE->station() );
30 ESSID_LBL->setText( WE->essid() ); 30 ESSID_LBL->setText( WE->essid() );
31 Mode_LBL->setText( WE->mode() ); 31 Mode_LBL->setText( WE->mode() );
32 S.setNum( WE->frequency() ); 32 S.setNum( WE->frequency() );
33 Frequency_LBL->setText( S ); 33 Frequency_LBL->setText( S );
34 S.setNum( WE->channel() ); 34 S.setNum( WE->channel() );
35 Channel_LBL->setText( S ); 35 Channel_LBL->setText( S );
diff --git a/noncore/settings/networksettings2/wlan/wlanrun.cpp b/noncore/settings/networksettings2/wlan/wlanrun.cpp
index b15a560..a0c5884 100644
--- a/noncore/settings/networksettings2/wlan/wlanrun.cpp
+++ b/noncore/settings/networksettings2/wlan/wlanrun.cpp
@@ -2,25 +2,25 @@
2#include <qfile.h> 2#include <qfile.h>
3#include <qtextstream.h> 3#include <qtextstream.h>
4#include <qstringlist.h> 4#include <qstringlist.h>
5#include <resources.h> 5#include <resources.h>
6#include "wlanrun.h" 6#include "wlanrun.h"
7 7
8State_t WLanRun::detectState( void ) { 8State_t WLanRun::detectState( void ) {
9 9
10 // unavailable : no card found 10 // unavailable : no card found
11 // available : card found and assigned to us or free 11 // available : card found and assigned to us or free
12 // up : card found and assigned to us and up 12 // up : card found and assigned to us and up
13 13
14 NodeCollection * NC = nodeCollection(); 14 NetworkSetup * NC = networkSetup();
15 QString S = QString( "/tmp/profile-%1.up" ).arg(NC->number()); 15 QString S = QString( "/tmp/profile-%1.up" ).arg(NC->number());
16 System & Sys = NSResources->system(); 16 System & Sys = NSResources->system();
17 InterfaceInfo * Run; 17 InterfaceInfo * Run;
18 18
19 QFile F( S ); 19 QFile F( S );
20 20
21 if( F.open( IO_ReadOnly ) ) { 21 if( F.open( IO_ReadOnly ) ) {
22 // could open file -> read interface and assign 22 // could open file -> read interface and assign
23 QString X; 23 QString X;
24 QTextStream TS(&F); 24 QTextStream TS(&F);
25 X = TS.readLine(); 25 X = TS.readLine();
26 // find interface 26 // find interface
@@ -61,52 +61,52 @@ State_t WLanRun::detectState( void ) {
61 ) && 61 ) &&
62 ! Run->IsUp 62 ! Run->IsUp
63 ) { 63 ) {
64 // proper type, and Not UP -> free 64 // proper type, and Not UP -> free
65 return Off; 65 return Off;
66 } 66 }
67 } 67 }
68 68
69 return Unavailable; 69 return Unavailable;
70 70
71} 71}
72 72
73QString WLanRun::setMyState( NodeCollection * , Action_t , bool ) { 73QString WLanRun::setMyState( NetworkSetup * , Action_t , bool ) {
74 74
75 // we only handle activate and deactivate 75 // we only handle activate and deactivate
76 return QString(); 76 return QString();
77} 77}
78 78
79// get interface that is free or assigned to us 79// get interface that is free or assigned to us
80InterfaceInfo * WLanRun::getInterface( void ) { 80InterfaceInfo * WLanRun::getInterface( void ) {
81 81
82 System & S = NSResources->system(); 82 System & S = NSResources->system();
83 InterfaceInfo * best = 0, * Run; 83 InterfaceInfo * best = 0, * Run;
84 84
85 for( QDictIterator<InterfaceInfo> It(S.interfaces()); 85 for( QDictIterator<InterfaceInfo> It(S.interfaces());
86 It.current(); 86 It.current();
87 ++It ) { 87 ++It ) {
88 Run = It.current(); 88 Run = It.current();
89 if( handlesInterface( *Run ) && 89 if( handlesInterface( *Run ) &&
90 ( Run->CardType == ARPHRD_ETHER 90 ( Run->CardType == ARPHRD_ETHER
91#ifdef ARPHRD_IEEE1394 91#ifdef ARPHRD_IEEE1394
92 || Run->CardType == ARPHRD_IEEE1394 92 || Run->CardType == ARPHRD_IEEE1394
93#endif 93#endif
94 ) 94 )
95 ) { 95 ) {
96 // this is a LAN card 96 // this is a LAN card
97 if( Run->assignedConnection() == netNode()->connection() ) { 97 if( Run->assignedToNetworkSetup() == netNode()->networkSetup() ) {
98 // assigned to us 98 // assigned to us
99 return Run; 99 return Run;
100 } else if( Run->assignedConnection() == 0 ) { 100 } else if( Run->assignedToNetworkSetup() == 0 ) {
101 // free 101 // free
102 best = Run; 102 best = Run;
103 } 103 }
104 } 104 }
105 } 105 }
106 return best; // can be 0 106 return best; // can be 0
107} 107}
108 108
109bool WLanRun::handlesInterface( const QString & S ) { 109bool WLanRun::handlesInterface( const QString & S ) {
110 InterfaceInfo * II; 110 InterfaceInfo * II;
111 II = NSResources->system().interface( S ); 111 II = NSResources->system().interface( S );
112 if( ( II = NSResources->system().interface( S ) ) ) { 112 if( ( II = NSResources->system().interface( S ) ) ) {
diff --git a/noncore/settings/networksettings2/wlan/wlanrun.h b/noncore/settings/networksettings2/wlan/wlanrun.h
index fd325d4..e3e7735 100644
--- a/noncore/settings/networksettings2/wlan/wlanrun.h
+++ b/noncore/settings/networksettings2/wlan/wlanrun.h
@@ -15,22 +15,22 @@ public :
15 } 15 }
16 16
17 virtual RuntimeInfo * device( void ) 17 virtual RuntimeInfo * device( void )
18 { return this; } 18 { return this; }
19 19
20 bool handlesInterface( const QString & I ); 20 bool handlesInterface( const QString & I );
21 bool handlesInterface( const InterfaceInfo & II ); 21 bool handlesInterface( const InterfaceInfo & II );
22 22
23 State_t detectState( void ); 23 State_t detectState( void );
24 24
25protected : 25protected :
26 26
27 QString setMyState( NodeCollection * , Action_t, bool ); 27 QString setMyState( NetworkSetup * , Action_t, bool );
28 28
29private : 29private :
30 30
31 InterfaceInfo * getInterface( void ); 31 InterfaceInfo * getInterface( void );
32 QRegExp Pat; 32 QRegExp Pat;
33 WLanData * Data; 33 WLanData * Data;
34}; 34};
35 35
36#endif 36#endif