summaryrefslogtreecommitdiff
authorwimpie <wimpie>2005-01-11 21:42:31 (UTC)
committer wimpie <wimpie>2005-01-11 21:42:31 (UTC)
commit96678694f8952f60d0a895cede2b621404b4bfb8 (patch) (side-by-side diff)
tree7138e554e5ba200b8f9ca8b51c89b47531dc34f2
parentf89120a7a1a3d0bf9c0805456490906ca914e560 (diff)
downloadopie-96678694f8952f60d0a895cede2b621404b4bfb8.zip
opie-96678694f8952f60d0a895cede2b621404b4bfb8.tar.gz
opie-96678694f8952f60d0a895cede2b621404b4bfb8.tar.bz2
Major rename of NodeCollection to NetworkSetup
this commit is broken (missing symbols)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/activateprofile.cpp2
-rw-r--r--noncore/settings/networksettings2/activateprofile.h2
-rw-r--r--noncore/settings/networksettings2/activatevpn.cpp10
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.cpp40
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h4
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp12
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h4
-rw-r--r--noncore/settings/networksettings2/cable/cable_NN.cpp2
-rw-r--r--noncore/settings/networksettings2/cable/cablerun.cpp2
-rw-r--r--noncore/settings/networksettings2/cable/cablerun.h2
-rw-r--r--noncore/settings/networksettings2/editconnection.cpp54
-rw-r--r--noncore/settings/networksettings2/editconnection.h14
-rw-r--r--noncore/settings/networksettings2/editconnectionGUI.ui12
-rw-r--r--noncore/settings/networksettings2/gprs/GPRS_NN.cpp2
-rw-r--r--noncore/settings/networksettings2/gprs/GPRS_NNI.cpp18
-rw-r--r--noncore/settings/networksettings2/gprs/GPRSrun.cpp4
-rw-r--r--noncore/settings/networksettings2/gprs/GPRSrun.h2
-rw-r--r--noncore/settings/networksettings2/irda/irdarun.h2
-rw-r--r--noncore/settings/networksettings2/lancard/lancardrun.cpp8
-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/network_NN.cpp2
-rw-r--r--noncore/settings/networksettings2/network/network_NNI.cpp14
-rw-r--r--noncore/settings/networksettings2/network/networkrun.cpp9
-rw-r--r--noncore/settings/networksettings2/network/networkrun.h2
-rw-r--r--noncore/settings/networksettings2/networksettings.cpp54
-rw-r--r--noncore/settings/networksettings2/networksettings2/asconnection.h6
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.cpp59
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.h73
-rw-r--r--noncore/settings/networksettings2/networksettings2/resources.cpp64
-rw-r--r--noncore/settings/networksettings2/networksettings2/resources.h28
-rw-r--r--noncore/settings/networksettings2/networksettings2/system.cpp4
-rw-r--r--noncore/settings/networksettings2/networksettings2/system.h8
-rw-r--r--noncore/settings/networksettings2/nsdata.cpp108
-rw-r--r--noncore/settings/networksettings2/nsdata.h4
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTDriver.cpp4
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTDriver.h4
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTGateway.cpp20
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTGateway.h12
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTInquiry.h2
-rw-r--r--noncore/settings/networksettings2/ppp/PPPDialingedit.cpp5
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.cpp4
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NNI.cpp16
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.cpp4
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.h2
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.cpp8
-rw-r--r--noncore/settings/networksettings2/profile/profiledata.h2
-rw-r--r--noncore/settings/networksettings2/profile/profileedit.cpp8
-rw-r--r--noncore/settings/networksettings2/profile/profilerun.cpp6
-rw-r--r--noncore/settings/networksettings2/profile/profilerun.h2
-rw-r--r--noncore/settings/networksettings2/usb/usb_NN.cpp2
-rw-r--r--noncore/settings/networksettings2/usb/usbrun.cpp8
-rw-r--r--noncore/settings/networksettings2/usb/usbrun.h2
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NN.cpp6
-rw-r--r--noncore/settings/networksettings2/vpn/vpnrun.h2
-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
58 files changed, 393 insertions, 373 deletions
diff --git a/noncore/settings/networksettings2/activateprofile.cpp b/noncore/settings/networksettings2/activateprofile.cpp
index e4064e3..fe98fc4 100644
--- a/noncore/settings/networksettings2/activateprofile.cpp
+++ b/noncore/settings/networksettings2/activateprofile.cpp
@@ -4,17 +4,17 @@
ActivateProfile::ActivateProfile( const char * Interface ) :
ActivateProfileGUI( 0, 0, TRUE ), NSD() {
Possible = NSD.collectPossible( Interface );
DeviceName_LBL->setText( Interface );
Profiles_LB->clear();
- for( NodeCollection * NC = Possible.first();
+ for( NetworkSetup * NC = Possible.first();
NC;
NC = Possible.next() ) {
Profiles_LB->insertItem( NC->devicePixmap(),
NC->name() );
}
}
ActivateProfile::~ActivateProfile( void ) {
diff --git a/noncore/settings/networksettings2/activateprofile.h b/noncore/settings/networksettings2/activateprofile.h
index dedeb51..385c665 100644
--- a/noncore/settings/networksettings2/activateprofile.h
+++ b/noncore/settings/networksettings2/activateprofile.h
@@ -10,10 +10,10 @@ public :
ActivateProfile( const char * interface );
~ActivateProfile( void );
long selectedProfile( void );
private :
NetworkSettingsData NSD;
- QList<NodeCollection> Possible;
+ QList<NetworkSetup> Possible;
};
diff --git a/noncore/settings/networksettings2/activatevpn.cpp b/noncore/settings/networksettings2/activatevpn.cpp
index 768a031..35a881b 100644
--- a/noncore/settings/networksettings2/activatevpn.cpp
+++ b/noncore/settings/networksettings2/activatevpn.cpp
@@ -2,36 +2,36 @@
#include <qheader.h>
#include <resources.h>
#include "activatevpn.h"
class MyCheckListItem : public QCheckListItem {
public :
- MyCheckListItem( NodeCollection * N, QListView * V );
+ MyCheckListItem( NetworkSetup * N, QListView * V );
- NodeCollection * NC;
+ NetworkSetup * NC;
};
-MyCheckListItem::MyCheckListItem( NodeCollection * N, QListView * V ):
+MyCheckListItem::MyCheckListItem( NetworkSetup * N, QListView * V ):
QCheckListItem( V, N->name() ) {
NC = N;
}
ActivateVPN::ActivateVPN( const QString & I ) :
ActivateVPNGUI( 0, 0, TRUE ), NSD() {
QCheckListItem * CI;
VPN_LV->clear();
VPN_LV->header()->hide();
- // find all connections that want to be triggered by this interface
- for( QDictIterator<NodeCollection> it(NSResources->connections());
+ // find all NetworkSetups that want to be triggered by this interface
+ for( QDictIterator<NetworkSetup> it(NSResources->networkSetups());
it.current();
++it ) {
if( it.current()->triggeredBy( I ) ) {
CI = new MyCheckListItem( it.current(), VPN_LV );
}
}
}
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.cpp
index 5c937a1..5c71a0a 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.cpp
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.cpp
@@ -1,17 +1,17 @@
#include <qfile.h>
#include <qfileinfo.h>
#include <qtextstream.h>
#include <resources.h>
#include "bluetoothBNEPrun.h"
using Opietooth2::OTGateway;
-using Opietooth2::OTPANConnection;
-using Opietooth2::PANConnectionVector;
+using Opietooth2::OTPANNetworkSetup;
+using Opietooth2::PANNetworkSetupVector;
BluetoothBNEPRun::BluetoothBNEPRun( ANetNodeInstance * NNI,
BluetoothBNEPData & D ) :
RuntimeInfo( NNI ),
Data( D),
Pat( "bnep[0-6]" ) {
OT = 0;
}
@@ -23,50 +23,50 @@ BluetoothBNEPRun::~BluetoothBNEPRun( void ) {
}
State_t BluetoothBNEPRun::detectState( void ) {
/*
need to detect
- 1. for any PAN connection that is found if that
+ 1. for any PAN NetworkSetup that is found if that
PAN is connected.
if it is connected it is not available (since we do
not manage IP settings and we are called to detect
- the state we knwo that we do not have an UP connection)
+ the state we knwo that we do not have an UP NetworkSetup)
- 2. if it not connected and we allow any connection we
- are available or if that PAN connection is to a device
+ 2. if it not connected and we allow any NetworkSetup we
+ are available or if that PAN NetworkSetup is to a device
with a correct address
3. if it is not connected and the address do not match or
we do not accept any address, we are Unavailable but
- not DOWN. I.e a new connection could perhaps be created
+ not DOWN. I.e a new NetworkSetup could perhaps be created
*/
if( ! OT ) {
OT = OTGateway::getOTGateway();
}
if( ! OT->isEnabled() ) {
return Unavailable;
}
- // if there is a PAN connection that is UP but not
+ // if there is a PAN NetworkSetup that is UP but not
// yet configured (no ifup) the we are available
- return ( hasFreePANConnection() ) ? Available : Unknown;
+ return ( hasFreePANNetworkSetup() ) ? Available : Unknown;
}
-QString BluetoothBNEPRun::setMyState( NodeCollection * NC, Action_t A, bool ) {
+QString BluetoothBNEPRun::setMyState( NetworkSetup * NC, Action_t A, bool ) {
if( A == Activate ) {
- if( hasFreePANConnection( 1 ) ) {
+ if( hasFreePANNetworkSetup( 1 ) ) {
// we have now an assignedinterface
} else {
return QString("TODO : Start PAND");
}
Log(( "Assigned interface" ));
NC->setCurrentState( Available );
@@ -84,82 +84,82 @@ QString BluetoothBNEPRun::setMyState( NodeCollection * NC, Action_t A, bool ) {
bool BluetoothBNEPRun::handlesInterface( const QString & S ) {
return Pat.match( S ) >= 0;
}
bool BluetoothBNEPRun::handlesInterface( InterfaceInfo * I ) {
return handlesInterface( I->Name );
}
-bool BluetoothBNEPRun::hasFreePANConnection( bool Grab ) {
+bool BluetoothBNEPRun::hasFreePANNetworkSetup( bool Grab ) {
if( ! OT ) {
OT = OTGateway::getOTGateway();
}
- // load PAN connections
- OTPANConnection * C;
+ // load PAN NetworkSetups
+ OTPANNetworkSetup * C;
InterfaceInfo * Run;
InterfaceInfo * Candidate = 0; // reuse this interface
- PANConnectionVector Conns = OT->getPANConnections();
+ PANNetworkSetupVector Conns = OT->getPANNetworkSetups();
System & Sys = NSResources->system();
bool IsValid;
for( unsigned int i = 0;
i < Conns.count();
i ++ ) {
C = Conns[i];
if( Data.AllowAll ) {
// we allow all
IsValid = 1;
} else {
- // is this PAN connection connecting to a Peer
+ // is this PAN NetworkSetup connecting to a Peer
// we allow ?
IsValid = 0;
for ( QStringList::Iterator it = Data.BDAddress.begin();
it != Data.BDAddress.end();
++ it ) {
if( C->ConnectedTo == (*it) ) {
- // this is a connection we could accept
+ // this is a NetworkSetup we could accept
IsValid = 1;
break;
}
}
}
if( ! IsValid ) {
Log(("%s to %s not acceptable\n",
C->Device.latin1(),
C->ConnectedTo.latin1() ));
// don't bother checking this address
// it is not acceptable
continue;
}
- // is this PAN connection available to us ?
+ // is this PAN NetworkSetup available to us ?
Run = Sys.findInterface( C->Device );
if( Run && Run->IsUp ) {
- // this PAN connection is up
+ // this PAN NetworkSetup is up
Log(("%s acceptable but unavailable\n",
C->Device.latin1() ));
// find others
continue;
}
// we at least have a possible interface
if( ! Candidate ) {
Candidate = Run;
}
}
if( Candidate ) {
if ( Grab ) {
- netNode()->connection()->assignInterface( Candidate );
+ netNode()->networkSetup()->assignInterface( Candidate );
}
return 1;
}
// no free PAN
return 0;
}
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
index 8551a2e..7346a8d 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
@@ -17,18 +17,18 @@ public :
bool handlesInterface( const QString & );
bool handlesInterface( InterfaceInfo * );
State_t detectState( void );
protected :
- QString setMyState( NodeCollection * , Action_t, bool );
+ QString setMyState( NetworkSetup * , Action_t, bool );
private :
- bool hasFreePANConnection( bool Grab = 0 );
+ bool hasFreePANNetworkSetup( bool Grab = 0 );
BluetoothBNEPData & Data;
Opietooth2::OTGateway * OT;
QRegExp Pat;
};
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp
index 3df7f5c..cd7bb4a 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp
@@ -15,28 +15,28 @@ BluetoothRFCOMMRun::~BluetoothRFCOMMRun( void ) {
}
State_t BluetoothRFCOMMRun::detectState( void ) {
if( ! OT ) {
OT = OTGateway::getOTGateway();
}
- if( deviceNrOfConnection() >= 0 ) {
+ if( deviceNrOfNetworkSetup() >= 0 ) {
return Available;
}
odebug << "Bluetooth "
<< OT->isEnabled()
<< oendl;
return ( OT->isEnabled() ) ? Off : Unavailable;
}
-QString BluetoothRFCOMMRun::setMyState( NodeCollection *,
+QString BluetoothRFCOMMRun::setMyState( NetworkSetup *,
Action_t A,
bool ) {
if( OT ) {
OTGateway::getOTGateway();
}
if( A == Activate ) {
@@ -65,17 +65,17 @@ QString BluetoothRFCOMMRun::setMyState( NodeCollection *,
Log(( "No channel selected -> cancel\n" ));
return QString( "No channel selected. Operation cancelled" );
}
}
if( A == Deactivate ) {
if( DeviceNr >= 0 ) {
if( OT->releaseRFCommDevice( DeviceNr ) ) {
- return QString( "Cannot release RFCOMM connection" );
+ return QString( "Cannot release RFCOMM NetworkSetup" );
}
DeviceNr = -1;
}
}
return QString();
}
#include <qlistbox.h>
@@ -126,25 +126,25 @@ RFCOMMChannel * BluetoothRFCOMMRun::getChannel( void ) {
}
}
delete Dlg;
return Ch;
}
QString BluetoothRFCOMMRun::deviceFile( void ) {
- if( deviceNrOfConnection() >= 0 ) {
+ if( deviceNrOfNetworkSetup() >= 0 ) {
OTDevice * OTD = OT->getOTDevice();
- // there is a connection
+ // there is a NetworkSetup
return OTD->getRFCommDevicePattern().arg(DeviceNr);
}
return QString();
}
-int BluetoothRFCOMMRun::deviceNrOfConnection( void ) {
+int BluetoothRFCOMMRun::deviceNrOfNetworkSetup( void ) {
if( ! OT ) {
OT = OTGateway::getOTGateway();
}
DeviceNr = -1;
for( unsigned int i = 0; i < Data->Devices.count(); i ++ ) {
odebug << "Check for rfcomm on "
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h
index 5a31a94..32986d3 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h
@@ -15,18 +15,18 @@ public :
virtual RuntimeInfo * line( void )
{ return this; }
virtual QString deviceFile( void );
State_t detectState( void );
protected :
- QString setMyState( NodeCollection * , Action_t, bool );
+ QString setMyState( NetworkSetup * , Action_t, bool );
private :
- int deviceNrOfConnection( void );
+ int deviceNrOfNetworkSetup( void );
RFCOMMChannel * getChannel( void );
BluetoothRFCOMMData * Data;
Opietooth2::OTGateway * OT;
int DeviceNr; // cached from detection
};
diff --git a/noncore/settings/networksettings2/cable/cable_NN.cpp b/noncore/settings/networksettings2/cable/cable_NN.cpp
index 58237a1..3f34bb2 100644
--- a/noncore/settings/networksettings2/cable/cable_NN.cpp
+++ b/noncore/settings/networksettings2/cable/cable_NN.cpp
@@ -10,17 +10,17 @@ static const char * CableNeeds[] =
static const char * CableProvides[] =
{ "line",
0
};
/**
* Constructor, find all of the possible interfaces
*/
-CableNetNode::CableNetNode() : ANetNode(tr("Cable Connection")) {
+CableNetNode::CableNetNode() : ANetNode(tr("Cable NetworkSetup")) {
}
/**
* Delete any interfaces that we own.
*/
CableNetNode::~CableNetNode(){
}
diff --git a/noncore/settings/networksettings2/cable/cablerun.cpp b/noncore/settings/networksettings2/cable/cablerun.cpp
index 7a8deb9..edbeb89 100644
--- a/noncore/settings/networksettings2/cable/cablerun.cpp
+++ b/noncore/settings/networksettings2/cable/cablerun.cpp
@@ -8,15 +8,15 @@ State_t CableRun::detectState( void ) {
if( fd < 0 ) {
return Unavailable;
}
close( fd );
return Available;
}
-QString CableRun::setMyState( NodeCollection *, Action_t , bool ) {
+QString CableRun::setMyState( NetworkSetup *, Action_t , bool ) {
return QString();
}
QString CableRun::deviceFile( void ) {
return Data->Device;
}
diff --git a/noncore/settings/networksettings2/cable/cablerun.h b/noncore/settings/networksettings2/cable/cablerun.h
index 41aea01..6a457c4 100644
--- a/noncore/settings/networksettings2/cable/cablerun.h
+++ b/noncore/settings/networksettings2/cable/cablerun.h
@@ -13,14 +13,14 @@ public :
{ return this; }
virtual QString deviceFile( void );
State_t detectState( void );
protected :
- QString setMyState( NodeCollection * , Action_t, bool );
+ QString setMyState( NetworkSetup * , Action_t, bool );
private :
CableData * Data;
};
diff --git a/noncore/settings/networksettings2/editconnection.cpp b/noncore/settings/networksettings2/editconnection.cpp
index 717d9e9..6ab2dd6 100644
--- a/noncore/settings/networksettings2/editconnection.cpp
+++ b/noncore/settings/networksettings2/editconnection.cpp
@@ -80,51 +80,53 @@ void MyQListViewItem::paintCell( QPainter *p, const QColorGroup &cg,
}
//
//
// REAL GUI
//
//
-bool EditConnection::AutoCollapse = 1;
+bool EditNetworkSetup::AutoCollapse = 1;
-EditConnection::EditConnection( QWidget* parent ) :
- EditConnectionGUI( parent, 0, TRUE ), TmpCollection() {
+EditNetworkSetup::EditNetworkSetup( QWidget* parent ) :
+ EditNetworkSetupGUI( parent, 0, TRUE ), TmpCollection() {
Tab_TB->setTabEnabled( Setup_FRM, FALSE );
Setup_FRM->setEnabled( FALSE );
TmpIsValid = 0;
SelectedNodes = 0;
AutoCollapse_CB->setChecked( AutoCollapse );
Mapping = new QPtrDict<ANetNode>;
Mapping->setAutoDelete( FALSE );
Nodes_LV->header()->hide();
// popluate tree with all NetNodes
buildFullTree();
}
-NodeCollection * EditConnection::getTmpCollection( void ) {
+NetworkSetup * EditNetworkSetup::getTmpCollection( void ) {
if( TmpIsValid )
// content is stil OK
return &(TmpCollection);
// reset collection -> delete all NEW NetNodes
for( QListIterator<ANetNodeInstance> it(TmpCollection);
it.current();
++it ) {
if( it.current()->isNew() ) {
delete it.current();
}
}
+
TmpCollection.clear();
+ TmpCollection.copyFrom( *SelectedNodes );
// update content
QListViewItem * it = Nodes_LV->firstChild();
ANetNode * NN;
// start iter (if there is a collection)
/*
@@ -188,18 +190,18 @@ NodeCollection * EditConnection::getTmpCollection( void ) {
// or an item
it = it->firstChild();
}
TmpIsValid = 1;
return &(TmpCollection);
}
-// pass a connection NodeCollection to be edited
-void EditConnection::setConnection( NodeCollection * NC ) {
+// pass a NetworkSetup NetworkSetup to be edited
+void EditNetworkSetup::setNetworkSetup( NetworkSetup * NC ) {
ANetNodeInstance * NNI;
ANetNode * NN;
SelectedNodes = NC;
Name_LE->setText( NC->name() );
NNI = NC->first();
// show configure tabl
@@ -238,54 +240,54 @@ void EditConnection::setConnection( NodeCollection * NC ) {
it = it->nextSibling();
}
if( ! Found ) {
// this means that this level is NOT present in collection
// probably INCOMPATIBEL collection OR Missing plugin
QMessageBox::warning(
0,
- tr( "Error presentig Connection" ),
- tr( "<p>Old connection or missing plugin \"<i>%1</i>\"</p>" ).
+ tr( "Error presentig NetworkSetup" ),
+ tr( "<p>Old NetworkSetup or missing plugin \"<i>%1</i>\"</p>" ).
arg(NNI->nodeClass()->name()) );
return;
}
// it now contains selected radio
NN = (*Mapping)[it];
} else {
// automatic selection
if( NNI == 0 || it->text(0) != NNI->nodeClass()->name() ) {
// should exist and be the same
if( NNI ) {
QMessageBox::warning(
0,
- tr( "Error presentig Connection" ),
- tr( "<p>Old connection or missing plugin \"<i>%1</i>\"</p>" ).
+ tr( "Error presentig NetworkSetup" ),
+ tr( "<p>Old NetworkSetup or missing plugin \"<i>%1</i>\"</p>" ).
arg(NNI->nodeClass()->name()) );
} else {
QMessageBox::warning(
0,
- tr( "Error presentig Connection" ),
- tr( "<p>Missing connection\"<i>%1</i>\"</p>" ).
+ tr( "Error presentig NetworkSetup" ),
+ tr( "<p>Missing NetworkSetup\"<i>%1</i>\"</p>" ).
arg(it->text(0)) );
}
return;
}
it = it->firstChild();
}
}
}
// get result of editing (either new OR updated collection
-NodeCollection * EditConnection::connection( void ) {
+NetworkSetup * EditNetworkSetup::networkSetup( void ) {
if( SelectedNodes == 0 ) {
// new collection
- SelectedNodes = new NodeCollection;
+ SelectedNodes = new NetworkSetup;
}
// clean out old entries
SelectedNodes->clear();
// transfer
for( QListIterator<ANetNodeInstance> it(TmpCollection);
it.current();
@@ -300,31 +302,31 @@ NodeCollection * EditConnection::connection( void ) {
SelectedNodes->setName( Name_LE->text() );
SelectedNodes->setModified( 1 );
}
return SelectedNodes;
}
// Build device tree -> start
-void EditConnection::buildFullTree( void ) {
+void EditNetworkSetup::buildFullTree( void ) {
ANetNode * NN;
// toplevel item
MyQCheckListItem * TheTop = new MyQCheckListItem(
Nodes_LV,
NSResources->netNode2Name("fullsetup"),
QCheckListItem::Controller );
TheTop->setOpen( TRUE );
Description_LBL->setText(
NSResources->netNode2Description( "fullsetup" ) );
Nodes_LV->setSelected( TheTop, TRUE );
// find all Nodes that are toplevel nodes -> ie provide
- // TCP/IP Connection
+ // TCP/IP NetworkSetup
for( QDictIterator<ANetNode> Iter(NSResources->netNodes());
Iter.current();
++Iter ) {
NN = Iter.current();
if( ! NN->isToplevel() ) {
continue;
}
@@ -337,17 +339,17 @@ void EditConnection::buildFullTree( void ) {
);
// remember that this node maps to this listitem
Mapping->insert( it, NN );
buildSubTree( it, NN );
}
}
// Build device tree -> help function
-void EditConnection::buildSubTree( QListViewItem * it, ANetNode *NN ) {
+void EditNetworkSetup::buildSubTree( QListViewItem * it, ANetNode *NN ) {
ANetNode::NetNodeList & NNL = NN->alternatives();
if( NNL.size() > 1 ) {
// this node has alternatives -> needs radio buttons
it = new MyQCheckListItem(
it,
NSResources->netNode2Name(NN->needs()[0]),
QCheckListItem::Controller );
@@ -373,21 +375,21 @@ void EditConnection::buildSubTree( QListViewItem * it, ANetNode *NN ) {
CI->setSelectable( FALSE );
CI->setPixmap( 0, NSResources->getPixmap( NNL[i]->pixmapName() ) );
}
buildSubTree( CI, NNL[i] );
}
}
// Clicked ok OK button
-void EditConnection::accept( void ) {
+void EditNetworkSetup::accept( void ) {
if( ! haveCompleteConfig( 0 ) || Name_LE->text().isEmpty() ) {
QMessageBox::warning(
0,
- tr( "Closing Connection Setup" ),
+ tr( "Closing NetworkSetup Setup" ),
tr( "Definition not complete or no name" ) );
return;
}
// check if all devices have acceptable input
getTmpCollection();
{ ANetNodeInstance * NNI;
QString S;
@@ -413,22 +415,22 @@ void EditConnection::accept( void ) {
}
}
}
QDialog::accept();
}
// triggered by CB
-void EditConnection::SLOT_AutoCollapse( bool b ) {
+void EditNetworkSetup::SLOT_AutoCollapse( bool b ) {
AutoCollapse = b;
}
// clicked on node in tree -> update GUI
-void EditConnection::SLOT_SelectNode( QListViewItem * it ) {
+void EditNetworkSetup::SLOT_SelectNode( QListViewItem * it ) {
ANetNode * NN;
if( it == 0 || it->depth() == 0 ) {
Description_LBL->setText(
NSResources->netNode2Description( "fullsetup" ) );
// topevel or no selection
return;
}
@@ -460,17 +462,17 @@ void EditConnection::SLOT_SelectNode( QListViewItem * it ) {
}
// item has really changed -> update
TmpIsValid = 0;
updateGUI( it, NN );
}
// cliecked on TAB to go to setup
-void EditConnection::SLOT_AlterTab( const QString & S ) {
+void EditNetworkSetup::SLOT_AlterTab( const QString & S ) {
if( S == tr( "Setup" ) && Setup_FRM->isEnabled() ) {
// switched to setup -> update CB and populate ws with
// forms for devices
if( ! TmpIsValid ) {
getTmpCollection();
// clear CB and Ws
@@ -509,17 +511,17 @@ void EditConnection::SLOT_AlterTab( const QString & S ) {
}
}
Setup_WS->raiseWidget( 0 );
} // still valid
}
}
// update visual feedback of selection state
-void EditConnection::updateGUI( QListViewItem * it, ANetNode * NN ) {
+void EditNetworkSetup::updateGUI( QListViewItem * it, ANetNode * NN ) {
bool HCC = haveCompleteConfig( it );
Tab_TB->setTabEnabled( Setup_FRM, HCC );
Setup_FRM->setEnabled( HCC );
// disable children of all siblings at same level
QListViewItem * Sbl = it->parent()->firstChild();
while( Sbl ) {
@@ -535,29 +537,29 @@ void EditConnection::updateGUI( QListViewItem * it, ANetNode * NN ) {
// enable selected path (as deep as it goes
it->setOpen( TRUE );
enablePath( it->firstChild(),
(it->depth()==1) ?
1 : // toplevel always alternatives
(NN->alternatives().size() > 1) );
}
-void EditConnection::disableTree( QListViewItem * it, bool Mode ) {
+void EditNetworkSetup::disableTree( QListViewItem * it, bool Mode ) {
while( it ) {
// disable sbl's chidren
it->setSelectable( Mode );
if( AutoCollapse )
it->setOpen( Mode );
disableTree( it->firstChild(), Mode );
it = it->nextSibling();
}
}
// pah : ParentHasAlternatives
-void EditConnection::enablePath( QListViewItem * it, bool pha ) {
+void EditNetworkSetup::enablePath( QListViewItem * it, bool pha ) {
while( it ) {
ANetNode * NN;
NN = (*Mapping)[it];
if( NN ) {
if( pha ) {
bool doOn = ((QCheckListItem *)it)->isOn();
// we are a checklistitem for sure
it->setSelectable( TRUE );
@@ -584,17 +586,17 @@ void EditConnection::enablePath( QListViewItem * it, bool pha ) {
it->setOpen( TRUE );
enablePath( it->firstChild(), pha );
}
it = it->nextSibling();
}
}
// do we have a complete configuration (all needs are provided for ?)
-bool EditConnection::haveCompleteConfig( QListViewItem * it ) {
+bool EditNetworkSetup::haveCompleteConfig( QListViewItem * it ) {
// check if all below this level is selected
it = ( it ) ?it : Nodes_LV->firstChild();
ANetNode *NN;
bool Found;
while ( it ) {
NN = (*Mapping)[it];
diff --git a/noncore/settings/networksettings2/editconnection.h b/noncore/settings/networksettings2/editconnection.h
index e8d7a2c..c2fc643 100644
--- a/noncore/settings/networksettings2/editconnection.h
+++ b/noncore/settings/networksettings2/editconnection.h
@@ -5,45 +5,45 @@
#include "netnode.h"
class ANetNodeInstance;
class ANetNode;
class QListViewItem;
class NetNodeLVI;
class QCloseEvent;
-class EditConnection : public EditConnectionGUI {
+class EditNetworkSetup : public EditNetworkSetupGUI {
Q_OBJECT
public :
- EditConnection( QWidget * P );
+ EditNetworkSetup( QWidget * P );
ANetNodeInstance * netNodeInstance( void );
- void setConnection( NodeCollection * NC );
- NodeCollection * connection( void );
+ void setNetworkSetup( NetworkSetup * NC );
+ NetworkSetup * networkSetup( void );
public slots :
void SLOT_AutoCollapse( bool );
void SLOT_SelectNode( QListViewItem * it );
void SLOT_AlterTab( const QString & S );
virtual void accept( void );
private :
- NodeCollection * getTmpCollection( void );
+ NetworkSetup * getTmpCollection( void );
void updateGUI( QListViewItem * it, ANetNode * NN );
void buildFullTree( void );
void buildSubTree( QListViewItem * Parent, ANetNode * NN );
void disableTree( QListViewItem * it, bool Mode);
void enablePath( QListViewItem * it, bool pha);
bool haveCompleteConfig( QListViewItem * it );
QPtrDict<ANetNode> * Mapping;
- NodeCollection * SelectedNodes;
+ NetworkSetup * SelectedNodes;
bool TmpIsValid;
- NodeCollection TmpCollection;
+ NetworkSetup TmpCollection;
static bool AutoCollapse;
};
diff --git a/noncore/settings/networksettings2/editconnectionGUI.ui b/noncore/settings/networksettings2/editconnectionGUI.ui
index dfb2596..5e50490 100644
--- a/noncore/settings/networksettings2/editconnectionGUI.ui
+++ b/noncore/settings/networksettings2/editconnectionGUI.ui
@@ -1,15 +1,15 @@
<!DOCTYPE UI><UI>
-<class>EditConnectionGUI</class>
+<class>EditNetworkSetupGUI</class>
<widget>
<class>QDialog</class>
<property stdset="1">
<name>name</name>
- <cstring>EditConnectionGUI</cstring>
+ <cstring>EditNetworkSetupGUI</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
<width>427</width>
<height>523</height>
@@ -112,17 +112,17 @@
<enum>MShape</enum>
</property>
<property stdset="1">
<name>frameShadow</name>
<enum>MShadow</enum>
</property>
<property stdset="1">
<name>text</name>
- <string>Connection profile</string>
+ <string>NetworkSetup profile</string>
</property>
<property stdset="1">
<name>alignment</name>
<set>AlignVCenter|AlignLeft</set>
</property>
<property>
<name>vAlign</name>
</property>
@@ -373,34 +373,34 @@
<name>image0</name>
<data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753</data>
</image>
</images>
<connections>
<connection>
<sender>Nodes_LV</sender>
<signal>clicked(QListViewItem*)</signal>
- <receiver>EditConnectionGUI</receiver>
+ <receiver>EditNetworkSetupGUI</receiver>
<slot>SLOT_SelectNode( QListViewItem *)</slot>
</connection>
<connection>
<sender>AutoCollapse_CB</sender>
<signal>toggled(bool)</signal>
- <receiver>EditConnectionGUI</receiver>
+ <receiver>EditNetworkSetupGUI</receiver>
<slot>SLOT_AutoCollapse( bool)</slot>
</connection>
<connection>
<sender>Devices_CB</sender>
<signal>activated(int)</signal>
<receiver>Setup_WS</receiver>
<slot>raiseWidget( int )</slot>
</connection>
<connection>
<sender>Tab_TB</sender>
<signal>selected(const QString&amp;)</signal>
- <receiver>EditConnectionGUI</receiver>
+ <receiver>EditNetworkSetupGUI</receiver>
<slot>SLOT_AlterTab( const QString &amp; )</slot>
</connection>
<slot access="public">SLOT_AlterTab( const QString &amp; )</slot>
<slot access="public">SLOT_AutoCollapse( bool)</slot>
<slot access="public">SLOT_SelectNode( QListViewItem *)</slot>
</connections>
</UI>
diff --git a/noncore/settings/networksettings2/gprs/GPRS_NN.cpp b/noncore/settings/networksettings2/gprs/GPRS_NN.cpp
index e9553a6..374cf5a 100644
--- a/noncore/settings/networksettings2/gprs/GPRS_NN.cpp
+++ b/noncore/settings/networksettings2/gprs/GPRS_NN.cpp
@@ -7,17 +7,17 @@
#include "netnodeinterface.h"
static const char * GPRSNeeds[] =
{ "GPRS",
0
};
static const char * GPRSProvides[] =
- { "connection",
+ { "NetworkSetup",
0
};
/**
* Constructor, find all of the possible interfaces
*/
GPRSNetNode::GPRSNetNode() : ANetNode(tr("GPRS capable device")) {
NSResources->addSystemFile(
diff --git a/noncore/settings/networksettings2/gprs/GPRS_NNI.cpp b/noncore/settings/networksettings2/gprs/GPRS_NNI.cpp
index 2f61cba..bf8cc59 100644
--- a/noncore/settings/networksettings2/gprs/GPRS_NNI.cpp
+++ b/noncore/settings/networksettings2/gprs/GPRS_NNI.cpp
@@ -117,43 +117,43 @@ short AGPRSDevice::generateFile( SystemFile & SF,
SF << "TIMEOUT 10" << oendl;
SF << "CONNECT \"\"" << oendl;
SF << "SAY \"READY\\n\"" << oendl;
return 0;
} else if( SF.name() == "peers" ) {
SF << "noauth" << oendl;
SF << "user " << Data.User << oendl;
SF << "connect \"/usr/sbin/chat -s -v -f /etc/chatscripts/"
- << removeSpaces( connection()->name() )
+ << removeSpaces( networkSetup()->name() )
<< "\""
<< oendl;
SF << "ipcp-accept-local" << oendl;
SF << "ipcp-accept-remote" << oendl;
if( Data.DefaultGateway ) {
SF << "defaultroute" << oendl;
if( Data.SetIfSet ) {
SF << "replacedefaultroute" << oendl;
}
}
if( Data.Debug ) {
SF << "logfile /tmp/"
- << removeSpaces( connection()->name() )
+ << removeSpaces( networkSetup()->name() )
<< oendl;
for( int i = 0; i < Data.Debug; i ++ ) {
SF << "debug" << oendl;
}
}
SF << "nocrtscts" << oendl;
SF << "local" << oendl;
SF << "lcp-echo-interval 0" << oendl;
SF << "lcp-echo-failure 0" << oendl;
SF << "usepeerdns" << oendl;
- SF << "linkname " << removeSpaces( connection()->name() ) << oendl;
+ SF << "linkname " << removeSpaces( networkSetup()->name() ) << oendl;
SF << "nopersist" << oendl;
- SF << "ipparam " << removeSpaces( connection()->name() ) <<oendl;
+ SF << "ipparam " << removeSpaces( networkSetup()->name() ) <<oendl;
SF << "maxfail 1" << oendl;
return 0;
} else if( SF.name() == "extra" ) {
unsigned long Bits;
// generate 'fixed' settings
for( unsigned int i = 0 ;
i < Data.Routing.count();
i ++ ) {
@@ -187,45 +187,45 @@ short AGPRSDevice::generateFile( SystemFile & SF,
<< " gw $PPP_REMOTE"
<< oendl;
}
if( ! Data.DNS1.isEmpty() ) {
SF << "nameserver "
<< Data.DNS1
<< " # profile "
- << removeSpaces( connection()->name() )
+ << removeSpaces( networkSetup()->name() )
<<oendl;
}
if( ! Data.DNS2.isEmpty() ) {
SF << "nameserver "
<< Data.DNS2
<< " # profile "
- << removeSpaces( connection()->name() )
+ << removeSpaces( networkSetup()->name() )
<<oendl;
}
}
return 1;
}
bool AGPRSDevice::openFile( SystemFile & SF ) {
if( SF.name() == "peers" ) {
SF.setPath(
QString( "/etc/ppp/peers/" ) +
- removeSpaces( connection()->name() )
+ removeSpaces( networkSetup()->name() )
);
return 1;
} else if ( SF.name() == "chatscripts" ) {
SF.setPath(
QString( "/etc/chatscripts/" ) +
- removeSpaces( connection()->name() )
+ removeSpaces( networkSetup()->name() )
);
return 1;
} else if ( SF.name() == "extra" ) {
SF.setPath(
QString( "/etc/ppp/" ) +
- removeSpaces( connection()->name() ) + ".fixed"
+ removeSpaces( networkSetup()->name() ) + ".fixed"
);
return 1;
}
return 0;
}
diff --git a/noncore/settings/networksettings2/gprs/GPRSrun.cpp b/noncore/settings/networksettings2/gprs/GPRSrun.cpp
index cccc71a..fd61f3a 100644
--- a/noncore/settings/networksettings2/gprs/GPRSrun.cpp
+++ b/noncore/settings/networksettings2/gprs/GPRSrun.cpp
@@ -6,17 +6,17 @@
#include <resources.h>
#include <netnode.h>
#include "GPRSrun.h"
State_t GPRSRun::detectState( void ) {
// is pppd still running ?
// is rfcomm still active
- NodeCollection * NC = nodeCollection();
+ NetworkSetup * NC = networkSetup();
InterfaceInfo * I = NC->assignedInterface();
QDir D("/var/run");
if( I ) {
// has some pppx attached
return ( I->IsUp ) ? IsUp : Available;
}
@@ -57,17 +57,17 @@ State_t GPRSRun::detectState( void ) {
PPPPid = 0;
}
} // else pppd is down
}
NC->assignInterface( 0 );
return Unknown;
}
-QString GPRSRun::setMyState( NodeCollection * NC, Action_t A , bool ) {
+QString GPRSRun::setMyState( NetworkSetup * NC, Action_t A , bool ) {
if( A == Up ) {
// start ppp on deviceFile
QStringList SL;
SL << "pon"
<< removeSpaces( NC->name() )
<< NC->device()->deviceFile();
diff --git a/noncore/settings/networksettings2/gprs/GPRSrun.h b/noncore/settings/networksettings2/gprs/GPRSrun.h
index 817f8a9..c3c2015 100644
--- a/noncore/settings/networksettings2/gprs/GPRSrun.h
+++ b/noncore/settings/networksettings2/gprs/GPRSrun.h
@@ -19,16 +19,16 @@ public :
{ return this; }
virtual RuntimeInfo * connection( void )
{ return this; }
State_t detectState( void );
protected :
- QString setMyState( NodeCollection * , Action_t, bool );
+ QString setMyState( NetworkSetup * , Action_t, bool );
private :
QRegExp Pat;
size_t PPPPid;
};
diff --git a/noncore/settings/networksettings2/irda/irdarun.h b/noncore/settings/networksettings2/irda/irdarun.h
index d3b714b..e5ba79a 100644
--- a/noncore/settings/networksettings2/irda/irdarun.h
+++ b/noncore/settings/networksettings2/irda/irdarun.h
@@ -15,11 +15,11 @@ public :
virtual QString deviceFile( void )
{ return QString( "/dev/irda" ); }
State_t detectState( void )
{ return Unknown; }
protected :
- QString setMyState( NodeCollection * , Action_t, bool )
+ QString setMyState( NetworkSetup * , Action_t, bool )
{ return QString(); }
};
diff --git a/noncore/settings/networksettings2/lancard/lancardrun.cpp b/noncore/settings/networksettings2/lancard/lancardrun.cpp
index 8157dce..8a71aa9 100644
--- a/noncore/settings/networksettings2/lancard/lancardrun.cpp
+++ b/noncore/settings/networksettings2/lancard/lancardrun.cpp
@@ -5,17 +5,17 @@
#include "lancardrun.h"
State_t LanCardRun::detectState( void ) {
// unavailable : no card found
// available : card found and assigned to us or free
// up : card found and assigned to us and up
- NodeCollection * NC = nodeCollection();
+ NetworkSetup * NC = networkSetup();
QString S = QString( "/tmp/profile-%1.up" ).
arg( NC->number());
System & Sys = NSResources->system();
InterfaceInfo * Run;
QFile F( S );
if( F.open( IO_ReadOnly ) ) {
@@ -65,17 +65,17 @@ State_t LanCardRun::detectState( void ) {
return Off;
}
}
// no free found
return Unavailable;
}
-QString LanCardRun::setMyState( NodeCollection * NC, Action_t A, bool ) {
+QString LanCardRun::setMyState( NetworkSetup * NC, Action_t A, bool ) {
if( A == Activate ) {
InterfaceInfo * N = getInterface();
if( ! N ) {
// no interface available
NC->setCurrentState( Unavailable );
return tr("No interface found");
@@ -109,20 +109,20 @@ InterfaceInfo * LanCardRun::getInterface( void ) {
if( handlesInterface( *Run ) &&
( Run->CardType == ARPHRD_ETHER
#ifdef ARPHRD_IEEE1394
|| Run->CardType == ARPHRD_IEEE1394
#endif
)
) {
// this is a LAN card
- if( Run->assignedConnection() == netNode()->connection() ) {
+ if( Run->assignedToNetworkSetup() == netNode()->networkSetup() ) {
// assigned to us
return Run;
- } else if( Run->assignedConnection() == 0 ) {
+ } else if( Run->assignedToNetworkSetup() == 0 ) {
// free
best = Run;
}
}
}
return best; // can be 0
}
diff --git a/noncore/settings/networksettings2/lancard/lancardrun.h b/noncore/settings/networksettings2/lancard/lancardrun.h
index 57ef3fb..dfd3d62 100644
--- a/noncore/settings/networksettings2/lancard/lancardrun.h
+++ b/noncore/settings/networksettings2/lancard/lancardrun.h
@@ -20,17 +20,17 @@ public :
bool handlesInterface( const QString & I );
bool handlesInterface( const InterfaceInfo & II );
State_t detectState( void );
protected :
- QString setMyState( NodeCollection * , Action_t, bool );
+ QString setMyState( NetworkSetup * , Action_t, bool );
private :
InterfaceInfo * getInterface( void );
QRegExp Pat;
LanCardData * Data;
};
diff --git a/noncore/settings/networksettings2/modem/modemrun.h b/noncore/settings/networksettings2/modem/modemrun.h
index eb3a193..df6b370 100644
--- a/noncore/settings/networksettings2/modem/modemrun.h
+++ b/noncore/settings/networksettings2/modem/modemrun.h
@@ -15,11 +15,11 @@ public :
virtual QString deviceFile( void )
{ return QString("/dev/modem"); }
State_t detectState( void )
{ return Unknown;}
protected :
- QString setMyState( NodeCollection * , Action_t, bool )
+ QString setMyState( NetworkSetup * , Action_t, bool )
{ return QString(); }
};
diff --git a/noncore/settings/networksettings2/network/network_NN.cpp b/noncore/settings/networksettings2/network/network_NN.cpp
index 2fa31bd..80a7fac 100644
--- a/noncore/settings/networksettings2/network/network_NN.cpp
+++ b/noncore/settings/networksettings2/network/network_NN.cpp
@@ -7,17 +7,17 @@
#include "netnodeinterface.h"
static const char * NetworkNeeds[] =
{ "device",
0
};
static const char * NetworkProvides[] =
- { "connection",
+ { "NetworkSetup",
0
};
/**
* Constructor, find all of the possible interfaces
*/
NetworkNetNode::NetworkNetNode() : ANetNode(tr("IP Configuration")) {
diff --git a/noncore/settings/networksettings2/network/network_NNI.cpp b/noncore/settings/networksettings2/network/network_NNI.cpp
index 34dac54..c183d5e 100644
--- a/noncore/settings/networksettings2/network/network_NNI.cpp
+++ b/noncore/settings/networksettings2/network/network_NNI.cpp
@@ -112,51 +112,51 @@ short ANetwork::generateFile( SystemFile &SF,
rvl = 1;
if( SF.name() == "interfaces" ) {
Log(("Generate Network for %s\n", SF.name().latin1() ));
// we can safely call from here since device item is deeper
if( Data.UseDHCP ) {
SF << "iface "
<< "A"
- << connection()->number()
+ << networkSetup()->number()
<< NIC
<< " inet dhcp"
<< endl;
SF << " up echo \""
<< NIC
<< "\" > /tmp/profile-"
- << connection()->number()
+ << networkSetup()->number()
<< ".up"
<< endl;
if( Data.SendHostname ) {
SF << " hostname "
<< Data.Hostname
<< endl;
}
SF << " down rm -f /tmp/profile-"
- << connection()->number()
+ << networkSetup()->number()
<< ".up"
<< endl;
} else {
SF << "iface "
<< "A"
- << connection()->number()
+ << networkSetup()->number()
<< NIC
<< " inet static"
<< endl;
SF << " up echo \""
<< NIC
<< "\" > /tmp/profile-"
- << connection()->number()
+ << networkSetup()->number()
<< ".up"
<< endl;
SF << " down rm -f /tmp/profile-"
- << connection()->number()
+ << networkSetup()->number()
<< ".up"
<< endl;
SF << " address "
<< Data.IPAddress
<< endl;
SF << " broadcast "
<< Data.Broadcast
<< endl;
@@ -206,13 +206,13 @@ short ANetwork::generateFile( SystemFile &SF,
SF << " post-down "
<< (*it)
<< endl;
}
rvl = 0;
}
// embed other info in it
- rvd = connection()->getToplevel()->generateFileEmbedded( SF, DevNr );
+ rvd = networkSetup()->getToplevel()->generateFileEmbedded( SF, DevNr );
return (rvd == 2 || rvl == 2 ) ? 2 :
(rvd == 0 || rvl == 0 ) ? 0 : 1;
}
diff --git a/noncore/settings/networksettings2/network/networkrun.cpp b/noncore/settings/networksettings2/network/networkrun.cpp
index 74467ad..7039a36 100644
--- a/noncore/settings/networksettings2/network/networkrun.cpp
+++ b/noncore/settings/networksettings2/network/networkrun.cpp
@@ -1,29 +1,28 @@
#include <system.h>
#include <netnode.h>
#include <resources.h>
#include "networkrun.h"
State_t NetworkRun::detectState( void ) {
- InterfaceInfo * II = nodeCollection()->assignedInterface();
+ InterfaceInfo * II = networkSetup()->assignedInterface();
- Log(( "Interface %p %p : %d\n", II, nodeCollection(), (II) ? II->IsUp : 0 ));
if( II && II->IsUp ) {
// device has assigned interface
return IsUp;
}
// had no interface or interface is no longer up -> release
- nodeCollection()->assignInterface( 0 );
+ networkSetup()->assignInterface( 0 );
return Unknown;
}
-QString NetworkRun::setMyState( NodeCollection * NC, Action_t A, bool ) {
+QString NetworkRun::setMyState( NetworkSetup * NC, Action_t A, bool ) {
// we handle UP and DOWN
InterfaceInfo * II = NC->assignedInterface();
if( ! II ) {
Log(( "no interface assigned." ));
return QString();
}
@@ -35,17 +34,17 @@ QString NetworkRun::setMyState( NodeCollection * NC, Action_t A, bool ) {
} else if( A == Down ) {
SL << "ifdown";
} else {
return QString();
}
SL << QString().sprintf( "%s=A%ld%s",
II->Name.latin1(),
- nodeCollection()->number(),
+ networkSetup()->number(),
II->Name.latin1() );
if( ! NSResources->system().runAsRoot( SL ) ) {
return QString("Cannot call %1").arg(SL.join(" "));
}
return QString();
}
diff --git a/noncore/settings/networksettings2/network/networkrun.h b/noncore/settings/networksettings2/network/networkrun.h
index 78a1694..ac186e7 100644
--- a/noncore/settings/networksettings2/network/networkrun.h
+++ b/noncore/settings/networksettings2/network/networkrun.h
@@ -11,10 +11,10 @@ public :
virtual RuntimeInfo * connection( void )
{ return this; }
State_t detectState( void );
protected :
- QString setMyState( NodeCollection * , Action_t, bool );
+ QString setMyState( NetworkSetup * , Action_t, bool );
};
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp
index 78b6cce..80dcb3d 100644
--- a/noncore/settings/networksettings2/networksettings.cpp
+++ b/noncore/settings/networksettings2/networksettings.cpp
@@ -59,34 +59,34 @@ NetworkSettings::NetworkSettings( QWidget *parent,
Profiles_LB->clear();
QPEApplication::setStylusOperation(
Profiles_LB->viewport(), QPEApplication::RightOnHold );
connect( Profiles_LB,
SIGNAL(rightButtonPressed(QListBoxItem*,const QPoint&)),
this, SLOT(SLOT_EditNode(QListBoxItem*)) );
- { Name2Connection_t & M = NSResources->connections();
- NodeCollection * NC;
- // for all connections
- for( QDictIterator<NodeCollection> it(M);
+ { Name2NetworkSetup_t & M = NSResources->networkSetups();
+ NetworkSetup * NC;
+ // for all NetworkSetups
+ for( QDictIterator<NetworkSetup> it(M);
it.current();
++it ) {
NC = it.current();
Profiles_LB->insertItem( NC->devicePixmap(),
NC->name() );
}
}
if( Profiles_LB->count() ) {
Profiles_LB->setSelected( 0, TRUE );
}
// if no profiles -> auto popup editing
- if( NSResources->connections().count() == 0 ) {
+ if( NSResources->networkSetups().count() == 0 ) {
QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) );
}
connect( &(NSResources->system()),
SIGNAL( stdoutLine(const QString &) ),
this, SLOT( SLOT_CmdMessage(const QString &) ) );
connect( &(NSResources->system()),
@@ -131,36 +131,36 @@ void NetworkSettings::SLOT_CmdMessage( const QString & S ) {
Messages_LB->setCurrentItem( Messages_LB->count()-1 );
Messages_LB->ensureCurrentVisible();
}
void NetworkSettings::SLOT_RefreshStates( void ) {
QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); // remember
if( LBI ) {
- NodeCollection * NC;
+ NetworkSetup * NC;
NSResources->system().probeInterfaces();
// update current selection only
- NC = NSResources->findConnection( LBI->text() );
+ NC = NSResources->findNetworkSetup( LBI->text() );
if( NC ) {
State_t OldS = NC->state();
State_t NewS = NC->state(1);
if( OldS != NewS ) {
updateProfileState( LBI );
}
}
}
/* -> LATER !!
bool is;
- NodeCollection * NC;
+ NetworkSetup * NC;
for( unsigned int i = 0; i < Profiles_LB->count() ; i ++ ) {
- NC = NSResources->findConnection( Profiles_LB->text(i) );
+ NC = NSResources->findNetworkSetup( Profiles_LB->text(i) );
if( NC ) {
State_t OldS = NC->state();
State_t NewS = NC->state(1);
if( OldS != NewS ) {
is = Profiles_LB->isSelected(i);
Profiles_LB->changeItem( NC->statePixmap(NewS),
NC->name(),
i );
@@ -185,97 +185,97 @@ void NetworkSettings::SLOT_DeleteNode( void ) {
if ( ! LBI )
return;
if( QMessageBox::warning(
0,
tr( "Removing profile" ),
tr( "Remove selected profile ?" ),
1, 0 ) == 1 ) {
- NSResources->removeConnection( LBI->text() );
+ NSResources->removeNetworkSetup( LBI->text() );
delete LBI;
NSD.setModified( 1 );
}
}
void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
QString OldName = "";
- EditConnection EC( this );
+ EditNetworkSetup EC( this );
if( LBI ) {
- NodeCollection * NC = NSResources->findConnection( LBI->text() );
+ NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
if( ! NC ) {
return;
}
OldName = NC->name();
- EC.setConnection( NC );
+ EC.setNetworkSetup( NC );
}
EC.showMaximized();
// disable refresh timer
UpdateTimer->stop();
// we need to retry
while( 1 ) {
if( EC.exec() == QDialog::Accepted ) {
// toplevel item -> store
- NodeCollection * NC = EC.connection();
+ NetworkSetup * NC = EC.networkSetup();
if( NC->isModified() ) {
if( LBI ) {
if( NC->name() != OldName ) {
// find if new name is free
- NodeCollection * LCN = NSResources->findConnection(
+ NetworkSetup * LCN = NSResources->findNetworkSetup(
NC->name() );
if( LCN ) {
QMessageBox::warning(
0,
tr( "In System Config" ),
tr( "Name %1 already exists" ).arg(NC->name())
);
continue; // restart exec
} // else new name
// new name -> remove item
- NSResources->removeConnection( OldName );
- NSResources->addConnection( NC, 0 );
+ NSResources->removeNetworkSetup( OldName );
+ NSResources->addNetworkSetup( NC, 0 );
} // else not changed
// must add it here since change will trigger event
Profiles_LB->changeItem( NC->devicePixmap(),
NC->name(),
Profiles_LB->index( LBI )
);
} else {
// new item
int ci = Profiles_LB->count();
- NSResources->addConnection( NC, 0 );
- NC->setNumber( NSResources->assignConnectionNumber() );
+ NSResources->addNetworkSetup( NC, 0 );
+ NC->setNumber( NSResources->assignNetworkSetupNumber() );
Profiles_LB->insertItem( NC->devicePixmap(), NC->name() );
Profiles_LB->setSelected( ci, TRUE );
}
updateProfileState( LBI );
}
} else {
- // cancelled : reset connection
+ // cancelled : reset NetworkSetup
if( LBI ) {
- NodeCollection * NC = NSResources->findConnection( LBI->text() );
+ NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
NC->reassign();
}
}
break;
}
// reenable
UpdateTimer->start( 5000 );
}
void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) {
if( LBI == 0 )
return;
- NodeCollection * NC = NSResources->findConnection( LBI->text() );
+ NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
if( NC->description().isEmpty() ) {
Description_LBL->setText( tr( "<<No description>>" ) );
} else {
Description_LBL->setText( NC->description() );
}
Profile_GB->setTitle( LBI->text() + " : " + NC->stateName() );
@@ -348,17 +348,17 @@ void NetworkSettings::SLOT_GenerateConfig( void ) {
void NetworkSettings::SLOT_Disable( bool T ) {
QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
QString Msg;
if ( ! LBI )
return;
- NodeCollection * NC = NSResources->findConnection( LBI->text() );
+ NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
Log(( "Prepare to %sable\n", (T) ? "en" : "dis" ));
Msg = NC->setState( (T) ? Disable : Enable );
if( ! Msg.isEmpty() ) {
Msg.insert( 0, "<p>" );
Msg.append( "</p>" );
QMessageBox::warning(
0,
@@ -377,18 +377,18 @@ void NetworkSettings::SLOT_Up( void ) {
QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
QString Msg;
int led = -1;
if ( ! LBI )
return;
- NodeCollection * NC =
- NSResources->findConnection( LBI->text() );
+ NetworkSetup * NC =
+ NSResources->findNetworkSetup( LBI->text() );
switch( NC->state() ) {
case Disabled : // cannot modify this state
case Unknown : // cannot modify this state
case Unchecked : // cannot modify this state
case Unavailable : // cannot modify this state
case IsUp : // highest UP state
return;
@@ -433,18 +433,18 @@ void NetworkSettings::SLOT_Down( void ) {
QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
int led = -1;
QString Msg;
if ( ! LBI )
return;
- NodeCollection * NC =
- NSResources->findConnection( LBI->text() );
+ NetworkSetup * NC =
+ NSResources->findNetworkSetup( LBI->text() );
switch( NC->state() ) {
case Disabled : // cannot modify this state
case Unknown : // cannot modify this state
case Unchecked : // cannot modify this state
case Unavailable : // cannot modify this state
case Off : // highest DOWN state
break;
diff --git a/noncore/settings/networksettings2/networksettings2/asconnection.h b/noncore/settings/networksettings2/networksettings2/asconnection.h
index 1ed7e74..eeb0939 100644
--- a/noncore/settings/networksettings2/networksettings2/asconnection.h
+++ b/noncore/settings/networksettings2/networksettings2/asconnection.h
@@ -1,18 +1,18 @@
#ifndef ASCONNECTION_H
#define ASCONNECTION_H
#include <resources.h>
// pure virtual (component oriented) interface of any
-// plugin that offers a connection
-class AsConnection : public RuntimeInfo {
+// plugin that offers a networkSetup
+class AsNetworkSetup : public RuntimeInfo {
public :
- AsConnection( ANetNodeInstance * NNI ) :
+ AsNetworkSetup( ANetNodeInstance * NNI ) :
RuntimeInfo( NNI ) {
}
};
#endif
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.cpp b/noncore/settings/networksettings2/networksettings2/netnode.cpp
index f00e0b3..0ab0e5b 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.cpp
+++ b/noncore/settings/networksettings2/networksettings2/netnode.cpp
@@ -120,37 +120,37 @@ void ANetNodeInstance::setAttribute( QString & Attr, QString & Value ){
}
void ANetNodeInstance::saveAttributes( QTextStream & TS ) {
TS << "__name=" << name() << endl;
saveSpecificAttribute( TS );
}
ANetNodeInstance * ANetNodeInstance::nextNode( void ) {
- return connection()->findNext( this );
+ return networkSetup()->findNext( this );
}
//
//
// NODECOLLECTION
//
//
-NodeCollection::NodeCollection( void ) : QList<ANetNodeInstance>() {
+NetworkSetup::NetworkSetup( void ) : QList<ANetNodeInstance>() {
IsModified = 0;
Index = -1;
Name="";
IsNew = 1;
CurrentState = Unchecked;
AssignedInterface = 0;
Number = -1;
Done = 0;
}
-NodeCollection::NodeCollection( QTextStream & TS, bool & Dangling ) :
+NetworkSetup::NetworkSetup( QTextStream & TS, bool & Dangling ) :
QList<ANetNodeInstance>() {
long idx;
QString S, A, N;
Number = -1;
Done = 0;
IsModified = 0;
Index = -1;
@@ -182,84 +182,84 @@ NodeCollection::NodeCollection( QTextStream & TS, bool & Dangling ) :
setNumber( N.toLong() );
} else if( A == "node" ) {
ANetNodeInstance * NNI = NSResources->findNodeInstance( N );
Log(( "Find node %s : %p\n", N.latin1(), NNI ));
if( NNI ) {
append( NNI );
} else {
// could not find a node type -> collection invalid
- Log(( "Node %s missing -> connection dangling\n",
+ Log(( "Node %s missing -> NetworkSetup dangling\n",
N.latin1() ));
// create placeholder for this dangling NNI
NNI = new ErrorNNI( N );
Dangling = 1;
}
}
} while( 1 );
Log(( "Profile number %s : %d nodes\n",
Name.latin1(), count() ));
}
-NodeCollection::~NodeCollection( void ) {
+NetworkSetup::~NetworkSetup( void ) {
}
-const QString & NodeCollection::description( void ) {
+const QString & NetworkSetup::description( void ) {
ANetNodeInstance * NNI = getToplevel();
return (NNI) ? NNI->runtime()->description() : Name;
}
-void NodeCollection::append( ANetNodeInstance * NNI ) {
- NNI->setConnection( this );
+void NetworkSetup::append( ANetNodeInstance * NNI ) {
+ NNI->setNetworkSetup( this );
QList<ANetNodeInstance>::append( NNI );
}
-void NodeCollection::save( QTextStream & TS ) {
+void NetworkSetup::save( QTextStream & TS ) {
TS << "name=" << quote( Name ) << endl;
TS << "number=" << number() << endl;
ANetNodeInstance * NNI;
for( QListIterator<ANetNodeInstance> it(*this);
it.current();
++it ) {
NNI = it.current();
TS << "node=" << NNI->name() << endl;
}
TS << endl;
IsNew = 0;
}
-ANetNodeInstance * NodeCollection::getToplevel( void ) {
+ANetNodeInstance * NetworkSetup::getToplevel( void ) {
ANetNodeInstance * NNI = 0;
for( QListIterator<ANetNodeInstance> it(*this);
it.current();
++it ) {
NNI = it.current();
if( NNI->nodeClass()->isToplevel() ) {
return NNI;
}
}
return 0;
}
-ANetNodeInstance * NodeCollection::findByName( const QString & S ) {
+ANetNodeInstance * NetworkSetup::findByName( const QString & S ) {
ANetNodeInstance * NNI = 0;
for( QListIterator<ANetNodeInstance> it(*this);
it.current();
++it ) {
NNI = it.current();
if( NNI->name() == S ) {
return NNI;
}
}
return 0;
}
-ANetNodeInstance * NodeCollection::findNext( ANetNodeInstance * NNI ) {
+ANetNodeInstance * NetworkSetup::findNext( ANetNodeInstance * NNI ) {
ANetNodeInstance * NNNI;
if( ! NNI )
getToplevel();
for( QListIterator<ANetNodeInstance> it(*this);
it.current();
++it ) {
@@ -267,17 +267,17 @@ ANetNodeInstance * NodeCollection::findNext( ANetNodeInstance * NNI ) {
if( NNNI == NNI ) {
++it;
return it.current();
}
}
return 0; // no more next
}
-int NodeCollection::compareItems( QCollection::Item I1,
+int NetworkSetup::compareItems( QCollection::Item I1,
QCollection::Item I2 ) {
ANetNodeInstance * NNI1, * NNI2;
NNI1 = (ANetNodeInstance *)I1;
NNI2 = (ANetNodeInstance *)I2;
return strcmp( NNI1->name(), NNI2->name() );
}
static char * State2PixmapTbl[] = {
@@ -285,17 +285,17 @@ static char * State2PixmapTbl[] = {
"check", // Unknown
"delete", // unavailable
"disabled", // disabled
"off", // off
"disconnected", // available
"connected" // up
};
-QPixmap NodeCollection::devicePixmap( void ) {
+QPixmap NetworkSetup::devicePixmap( void ) {
QPixmap pm = NSResources->getPixmap(
getToplevel()->nextNode()->pixmapName()+"-large");
QPixmap Mini = NSResources->getPixmap(
device()->netNode()->pixmapName() );
if( pm.isNull() || Mini.isNull() )
return Resource::loadPixmap("Unknown");
@@ -303,21 +303,21 @@ QPixmap NodeCollection::devicePixmap( void ) {
QPainter painter( &pm );
painter.drawPixmap( pm.width()-Mini.width(),
pm.height()-Mini.height(),
Mini );
pm.setMask( pm.createHeuristicMask( TRUE ) );
return pm;
}
-QPixmap NodeCollection::statePixmap( State_t S) {
+QPixmap NetworkSetup::statePixmap( State_t S) {
return NSResources->getPixmap( State2PixmapTbl[S] );
}
-QString NodeCollection::stateName( State_t S) {
+QString NetworkSetup::stateName( State_t S) {
switch( S ) {
case Unknown :
return qApp->translate( "networksettings2", "Unknown");
case Unavailable :
return qApp->translate( "networksettings2", "Unavailable");
case Disabled :
return qApp->translate( "networksettings2", "Disabled");
case Off :
@@ -328,51 +328,51 @@ QString NodeCollection::stateName( State_t S) {
return qApp->translate( "networksettings2", "Up");
case Unchecked : /* FT */
default :
break;
}
return QString("");
}
-void NodeCollection::reassign( void ) {
+void NetworkSetup::reassign( void ) {
for( QListIterator<ANetNodeInstance> it(*this);
it.current();
++it ) {
- it.current()->setConnection( this );
+ it.current()->setNetworkSetup( this );
}
}
-const QStringList & NodeCollection::triggers() {
+const QStringList & NetworkSetup::triggers() {
return getToplevel()->runtime()->triggers();
}
-bool NodeCollection::hasDataForFile( SystemFile & S ) {
+bool NetworkSetup::hasDataForFile( SystemFile & S ) {
return ( firstWithDataForFile( S ) != 0 );
}
-ANetNodeInstance * NodeCollection::firstWithDataForFile( SystemFile & S ) {
+ANetNodeInstance * NetworkSetup::firstWithDataForFile( SystemFile & S ) {
for( QListIterator<ANetNodeInstance> it(*this);
it.current();
++it ) {
if( it.current()->hasDataForFile( S ) ) {
return it.current();
}
}
return 0;
}
-State_t NodeCollection::state( bool Update ) {
+State_t NetworkSetup::state( bool Update ) {
State_t NodeState;
if( CurrentState == Unchecked || Update ) {
// collect states of all nodes until with get the 'higest'
// state possible
- Log(( "Connection %s state %s\n",
+ Log(( "NetworkSetup %s state %s\n",
Name.latin1(), StateName[CurrentState] ));
CurrentState = Unknown;
for( QListIterator<ANetNodeInstance> it(*this);
it.current();
++it ) {
Log(( "-> Detect %s\n", it.current()->name() ));
NodeState = it.current()->runtime()->detectState();
@@ -390,17 +390,17 @@ State_t NodeCollection::state( bool Update ) {
CurrentState = NodeState;
}
}
}
return CurrentState;
}
-QString NodeCollection::setState( Action_t A, bool Force ) {
+QString NetworkSetup::setState( Action_t A, bool Force ) {
QString msg;
Action_t Actions[10];
int NoOfActions = 0;
// get current state
state( Force );
@@ -487,23 +487,32 @@ QString NodeCollection::setState( Action_t A, bool Force ) {
msg = getToplevel()->runtime()->setState( this, Actions[i], Force );
if( ! msg.isEmpty() ) {
return msg;
}
}
return QString();
}
+void NetworkSetup::copyFrom( const NetworkSetup & N ) {
+ Number = N.Number;
+ CurrentState = N.CurrentState;
+ Name = N.Name;
+ IsNew = N.IsNew;
+ Index = N.Index;
+ AssignedInterface = N.AssignedInterface;
+}
+
//
//
// RuntimeInfo
//
//
-QString RuntimeInfo::setState( NodeCollection * NC,
+QString RuntimeInfo::setState( NetworkSetup * NC,
Action_t A,
bool Force ) {
QString M;
RuntimeInfo * Deeper = nextNode();
if( Deeper ) {
// first go deeper
M = Deeper->setState( NC, A, Force );
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.h b/noncore/settings/networksettings2/networksettings2/netnode.h
index 151d546..8aebdc0 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.h
+++ b/noncore/settings/networksettings2/networksettings2/netnode.h
@@ -10,69 +10,69 @@
#include <time.h>
#include <Utils.h>
#include <system.h>
// difference feature interfaces
class AsDevice;
class AsLine;
-class AsConnection;
+class AsNetworkSetup;
class AsFullSetup;
// needed for plugin creation function
#include <qlist.h>
class ANetNode;
class ANetNodeInstance;
-class NodeCollection;
+class NetworkSetup;
class QTextStream;
class RuntimeInfo;
class InterfaceInfo;
class NSResources;
extern QString & deQuote( QString & X );
extern QString quote( QString X );
#include "systemfile.h"
typedef enum State {
// if we have not yet detected the state of the device
Unchecked = 0,
// if we cannot determine the state
Unknown = 1,
- // if connection cannot be established e.g. because
+ // if networkSetup cannot be established e.g. because
// the hardware is not available
Unavailable = 2,
- // if the connection cannot be establishec but NOT
+ // if the networkSetup cannot be establishec but NOT
// because it is physically impossible but because
// it has been disabled for FUNCTIONAL reasons
Disabled = 3,
- // if connection is available to is currently down
+ // if networkSetup is available to is currently down
// i.e. the corresponding hardware is not activated
Off = 4,
- // if connection is available to be used (i.e. the
+ // if networkSetup is available to be used (i.e. the
// devices if fully ready to be used
Available = 5,
- // if connection is being used
+ // if networkSetup is being used
IsUp = 6
} State_t;
typedef enum Action {
// to make the device unavailable functionally -> to disabled
Disable = 0,
// to make the device available functionally -> to off
Enable = 1,
// bring the hardware up -> to Available
Activate = 2,
// bring the hardware down -> to off
Deactivate = 3,
- // bring the connection up -> to IsUp
+ // bring the networkSetup up -> to IsUp
Up = 4,
- // bring the connection down -> to Available
+ // bring the networkSetup down -> to Available
Down = 5
} Action_t;
class ANetNode : public QObject {
public:
typedef QArray<ANetNode *> NetNodeList;
@@ -86,17 +86,17 @@ public:
//
//
inline int done( void )
{ return Done; }
inline void setDone( int D )
{ Done = D; }
- // does this Node provide a Connection
+ // does this Node provide a NetworkSetup
bool isToplevel( void );
// set the value of an attribute
void setAttribute( QString & Attr, QString & Value ) ;
void saveAttributes( QTextStream & TS ) ;
// compiled references to 'needed' NetNodes -> needs list
inline void setAlternatives( NetNodeList * Alt )
@@ -240,20 +240,20 @@ public:
{ return NodeType->pixmapName(); }
inline const char ** provides( void )
{ return NodeType->provides(); }
inline const char ** needs( void )
{ return NodeType->needs(); }
- inline void setConnection( NodeCollection * NC )
- { Connection = NC; }
- inline NodeCollection * connection( void )
- { return Connection; }
+ inline void setNetworkSetup( NetworkSetup * NC )
+ { TheNetworkSetup = NC; }
+ inline NetworkSetup * networkSetup( void )
+ { return TheNetworkSetup; }
//
//
// Virtual methods with sensible defaults
//
//
@@ -310,18 +310,18 @@ public:
virtual void * data( void ) = 0;
protected :
virtual void setSpecificAttribute( QString & , QString & ) = 0;
virtual void saveSpecificAttribute( QTextStream & ) = 0;
ANetNode * NodeType;
- // connection to which this node belongs to
- NodeCollection * Connection;
+ // networkSetup to which this node belongs to
+ NetworkSetup * TheNetworkSetup;
QString Description;
bool IsModified;
// true if this nodeinstance was just created (and not
// loaded from file
bool IsNew;
int Done;
static long InstanceCounter;
@@ -373,17 +373,17 @@ class RuntimeInfo : public QObject {
public :
RuntimeInfo( ANetNodeInstance * TheNNI )
{ NNI = TheNNI; }
//
//
- // methods to be overloaded by connection capable
+ // methods to be overloaded by networkSetup capable
// runtimes
//
//
//
//
// methods to be overloaded by device capable
@@ -470,53 +470,56 @@ public :
virtual RuntimeInfo * fullSetup( void )
{ RuntimeInfo * RI = nextNode();
return (RI) ? RI->fullSetup() : 0;
}
inline ANetNodeInstance * netNode()
{ return NNI; }
- inline NodeCollection * nodeCollection()
- { return NNI->connection(); }
+ inline NetworkSetup * networkSetup()
+ { return NNI->networkSetup(); }
virtual State_t detectState( void ) = 0;
// public API to set the state
- virtual QString setState( NodeCollection * NC,
+ virtual QString setState( NetworkSetup * NC,
Action_t A,
bool Force = 0 );
inline RuntimeInfo * nextNode( void ) {
ANetNodeInstance * NNI = netNode()->nextNode();
return (NNI) ? NNI->runtime() : 0;
}
signals :
// sent by device if state changes
void stateChanged( State_t S, ANetNodeInstance * NNI );
protected :
// set state of this node (private API)
- virtual QString setMyState( NodeCollection * NC,
+ virtual QString setMyState( NetworkSetup * NC,
Action_t A,
bool Force = 0 ) = 0;
- // connection this runtime info belongs to
+ // networkSetup this runtime info belongs to
ANetNodeInstance * NNI;
};
-class NodeCollection : public QList<ANetNodeInstance> {
+class NetworkSetup : public QList<ANetNodeInstance> {
public :
- NodeCollection( void );
- NodeCollection( QTextStream & TS, bool & Dangling );
- ~NodeCollection( void );
+ NetworkSetup( void );
+ NetworkSetup( QTextStream & TS, bool & Dangling );
+ ~NetworkSetup( void );
+
+ // copy settings from NC to this
+ void copyFrom( const NetworkSetup & NC );
inline int done( void )
{ return Done; }
inline void setDone( int D )
{ Done = D; }
inline int number( void )
{ return Number; }
@@ -538,25 +541,25 @@ public :
// return the interface in the OS that is assigned to
// this device
inline InterfaceInfo * assignedInterface( void ) {
return AssignedInterface;
}
// assign the interface to this device
inline void assignInterface( InterfaceInfo * NI ) {
- if( NI == 0 ) {
- if( AssignedInterface ) {
- AssignedInterface->assignConnection( 0 );
- }
- }
- AssignedInterface = NI;
+ // cleanup previous
if( AssignedInterface ) {
- AssignedInterface->assignConnection( this );
+ AssignedInterface->assignToNetworkSetup( 0 );
}
+ if( NI ) {
+ // assign new
+ NI->assignToNetworkSetup( this );
+ }
+ AssignedInterface = NI;
}
inline RuntimeInfo * device() {
return getToplevel()->runtime()->device();
}
const QStringList & triggers();
@@ -572,17 +575,17 @@ public :
{ return stateName( state(Update) ); }
QString setState( Action_t A, bool Force = 0 );
void save( QTextStream & TS );
void append( ANetNodeInstance * NNI );
- // makes sure that all items in the connection point to
+ // makes sure that all items in the networkSetup point to
// that connectoin
void reassign( void );
ANetNodeInstance * getToplevel( void );
ANetNodeInstance * findNext( ANetNodeInstance * NNI );
ANetNodeInstance * findByName( const QString & S );
inline const QString & name()
@@ -614,17 +617,17 @@ public :
private :
int compareItems ( QCollection::Item item1,
QCollection::Item item2 );
long Number;
- // state of this connection
+ // state of this networkSetup
State_t CurrentState;
QString Name;
// true if this collection was just created (and not
// loaded from file
bool IsNew;
// index in listbox
int Index;
diff --git a/noncore/settings/networksettings2/networksettings2/resources.cpp b/noncore/settings/networksettings2/networksettings2/resources.cpp
index b81dcaa..0e72c25 100644
--- a/noncore/settings/networksettings2/networksettings2/resources.cpp
+++ b/noncore/settings/networksettings2/networksettings2/resources.cpp
@@ -20,17 +20,17 @@
#define PLUGINDIR "plugins/networksettings2"
#define ICONDIR "/pics/networksettings2/"
// single resources instance
TheNSResources * _NSResources = 0;
TheNSResources::TheNSResources( void ) : NodeTypeNameMap(),
- ConnectionsMap(), DanglingConnectionsMap() {
+ NetworkSetupsMap(), DanglingNetworkSetupsMap() {
_NSResources = this;
detectCurrentUser();
// load available netnodes
Plugins = 0;
@@ -75,22 +75,22 @@ TheNSResources::TheNSResources( void ) : NodeTypeNameMap(),
}
}
// define built in Node types to Description map
addNodeType( "device", tr( "Network Device" ),
tr( "<p>Devices that can handle IP packets</p>" ) );
addNodeType( "line", tr( "Character device" ),
tr( "<p>Devices that can handle single bytes</p>" ) );
- addNodeType( "connection", tr( "IP Connection" ),
- tr( "<p>Nodes that provide working IP connections</p>" ) );
- addNodeType( "fullsetup", tr( "Connection Profile" ),
- tr( "<p>Fully configured connection profile</p>" ) );
- addNodeType( "GPRS", tr( "Connection to GPRS device" ),
- tr( "<p>Connection to a GPRS capable device</p>" ) );
+ addNodeType( "NetworkSetup", tr( "IP NetworkSetup" ),
+ tr( "<p>Nodes that provide working IP NetworkSetups</p>" ) );
+ addNodeType( "fullsetup", tr( "NetworkSetup Profile" ),
+ tr( "<p>Fully configured NetworkSetup profile</p>" ) );
+ addNodeType( "GPRS", tr( "NetworkSetup to GPRS device" ),
+ tr( "<p>NetworkSetup to a GPRS capable device</p>" ) );
// get access to the system
TheSystem = new System();
}
TheNSResources::~TheNSResources( void ) {
@@ -196,22 +196,22 @@ void TheNSResources::findAvailableNetNodes( void ){
if( trans->load( fn ) )
qApp->installTranslator( trans );
else
delete trans;
}
}
-// used to find unique connection number
-int TheNSResources::assignConnectionNumber( void ) {
+// used to find unique NetworkSetup number
+int TheNSResources::assignNetworkSetupNumber( void ) {
bool found = 1;
for( int trial = 0; ; trial ++ ) {
found = 1;
- for( QDictIterator<NodeCollection> it(ConnectionsMap);
+ for( QDictIterator<NetworkSetup> it(NetworkSetupsMap);
it.current();
++it ) {
if( it.current()->number() == trial ) {
found = 0;
break;
}
}
@@ -240,83 +240,83 @@ QString TheNSResources::tr( const char * s ) {
const QString & TheNSResources::netNode2Name( const char * s ) {
return NodeTypeNameMap[s];
}
const QString & TheNSResources::netNode2Description( const char * s ) {
return NodeTypeDescriptionMap[s];
}
-void TheNSResources::addConnection( NodeCollection * NC, bool Dangling ) {
+void TheNSResources::addNetworkSetup( NetworkSetup * NC, bool Dangling ) {
ANetNodeInstance * NNI;
- Log(( "Add Connection %s, Dangling %d\n",
+ Log(( "Add NetworkSetup %s, Dangling %d\n",
NC->name().latin1(), Dangling ));
if( Dangling ) {
- DanglingConnectionsMap.insert( NC->name(), NC );
+ DanglingNetworkSetupsMap.insert( NC->name(), NC );
} else {
- ConnectionsMap.insert( NC->name(), NC );
+ NetworkSetupsMap.insert( NC->name(), NC );
}
// add (new) nodes to NodeList
for( QListIterator<ANetNodeInstance> it(*NC);
it.current();
++it ) {
NNI = it.current();
if( findNodeInstance( NNI->name() ) == 0 ) {
// new item
addNodeInstance( NNI );
}
}
}
-void TheNSResources::removeConnection( const QString & N ) {
- NodeCollection * NC = findConnection( N );
+void TheNSResources::removeNetworkSetup( const QString & N ) {
+ NetworkSetup * NC = findNetworkSetup( N );
if( ! NC )
return;
- // delete netnodes in this connection
+ // delete netnodes in this NetworkSetup
ANetNodeInstance * NNI;
for( NNI = NC->first(); NNI != 0; NNI = NC->next() ) {
removeNodeInstance( NNI->name() );
}
- if( ConnectionsMap.find( N ) ) {
- ConnectionsMap.remove( N );
+ if( NetworkSetupsMap.find( N ) ) {
+ NetworkSetupsMap.remove( N );
} else {
- DanglingConnectionsMap.remove( N );
+ DanglingNetworkSetupsMap.remove( N );
}
}
-// dangling connections are filtered out
-NodeCollection * TheNSResources::findConnection( const QString & S ) {
- return ConnectionsMap[ S ];
+// dangling NetworkSetups are filtered out
+NetworkSetup * TheNSResources::findNetworkSetup( const QString & S ) {
+ return NetworkSetupsMap[ S ];
}
-NodeCollection * TheNSResources::getConnection( int nr ) {
- for( QDictIterator<NodeCollection> it(ConnectionsMap);
+NetworkSetup * TheNSResources::getNetworkSetup( int nr ) {
+ for( QDictIterator<NetworkSetup> it(NetworkSetupsMap);
it.current();
++it ) {
if( it.current()->number() == nr ) {
return it.current();
}
}
return 0;
}
/*
-void TheNSResources::renumberConnections( void ) {
- Name2Connection_t & M = NSResources->connections();
- NodeCollection * NC;
+void TheNSResources::renumberNetworkSetups( void ) {
+ Name2NetworkSetup_t & M = NSResources->NetworkSetups();
+ NetworkSetup * NC;
- // for all connections
- NodeCollection::resetMaxNr();
- for( QDictIterator<NodeCollection> it(M);
+ // for all NetworkSetups
+ NetworkSetup::resetMaxNr();
+ for( QDictIterator<NetworkSetup> it(M);
it.current();
++it ) {
NC = it.current();
- NC->setNumber( NC->maxConnectionNumber()+1 );
+ NC->setNumber( NC->maxNetworkSetupNumber()+1 );
NC->setModified( 1 );
}
}
*/
typedef struct EnvVars {
char * Name;
int Len;
diff --git a/noncore/settings/networksettings2/networksettings2/resources.h b/noncore/settings/networksettings2/networksettings2/resources.h
index 51c4250..f7393d3 100644
--- a/noncore/settings/networksettings2/networksettings2/resources.h
+++ b/noncore/settings/networksettings2/networksettings2/resources.h
@@ -35,33 +35,33 @@ public :
QString HomeDir;
int Uid;
int Gid;
QArray<char *> EnvList;
};
typedef QDict<ANetNode> Name2NetNode_t;
typedef QDict<ANetNodeInstance > Name2Instance_t;
-typedef QDict<NodeCollection> Name2Connection_t;
+typedef QDict<NetworkSetup> Name2NetworkSetup_t;
typedef QDict<SystemFile> Name2SystemFile_t;
class TheNSResources {
public :
TheNSResources( void );
~TheNSResources( );
// give busy feedback
void busy( bool B );
System & system()
{ return *TheSystem; }
- int assignConnectionNumber(void);
+ int assignNetworkSetupNumber(void);
QPixmap getPixmap( const QString & Name );
Name2NetNode_t & netNodes( void )
{ return AllNodeTypes; }
bool netNodeExists( const QString & X )
{ return AllNodeTypes.find(X)!=0; }
ANetNode * findNetNode( const QString & N )
{ return AllNodeTypes.find(N);
@@ -98,44 +98,44 @@ public :
void removeNodeInstance( const QString & N )
{ AllNodes.remove( N );}
ANetNodeInstance * findNodeInstance( const QString & S )
{ return AllNodes[S]; }
const QString & netNode2Name( const char * Type );
const QString & netNode2Description( const char * Type );
- void addConnection( NodeCollection * NC, bool Dangling );
- void removeConnection( const QString & N );
- NodeCollection * findConnection( const QString & N );
- NodeCollection * getConnection( int nr );
- Name2Connection_t & connections( void )
- { return ConnectionsMap; }
- Name2Connection_t & danglingConnections( void )
- { return DanglingConnectionsMap; }
+ void addNetworkSetup( NetworkSetup * NC, bool Dangling );
+ void removeNetworkSetup( const QString & N );
+ NetworkSetup * findNetworkSetup( const QString & N );
+ NetworkSetup * getNetworkSetup( int nr );
+ Name2NetworkSetup_t & networkSetups( void )
+ { return NetworkSetupsMap; }
+ Name2NetworkSetup_t & danglingNetworkSetups( void )
+ { return DanglingNetworkSetupsMap; }
inline bool userKnown( void )
{ return CurrentUser.known(); }
CurrentQPEUser & currentUser( void )
{ return CurrentUser; }
private :
void detectCurrentUser( void );
QString tr( const char * path );
void findAvailableNetNodes( void );
QMap< QString, QString> NodeTypeNameMap;
QMap< QString, QString> NodeTypeDescriptionMap;
- // list of connections that are valid
- Name2Connection_t ConnectionsMap;
- // list of connection configurations that are not valid
+ // list of networkSetups that are valid
+ Name2NetworkSetup_t NetworkSetupsMap;
+ // list of networkSetup configurations that are not valid
// e.g. because plugins are missing
- Name2Connection_t DanglingConnectionsMap;
+ Name2NetworkSetup_t DanglingNetworkSetupsMap;
System * TheSystem;
Name2SystemFile_t SystemFiles;
// all node type classes
Name2NetNode_t AllNodeTypes;
// all nodes
Name2Instance_t AllNodes;
diff --git a/noncore/settings/networksettings2/networksettings2/system.cpp b/noncore/settings/networksettings2/networksettings2/system.cpp
index a290f08..33cc5bd 100644
--- a/noncore/settings/networksettings2/networksettings2/system.cpp
+++ b/noncore/settings/networksettings2/networksettings2/system.cpp
@@ -448,23 +448,23 @@ void System::probeInterfaces( void ) {
Log(("NIC %s UP ? %d\n", NicName.latin1(), IFI->IsUp ));
}
::close( sockfd );
}
InterfaceInfo * System::findInterface( const QString & N ) {
InterfaceInfo * Run;
- // has PAN connection UP interface ?
+ // has PAN NetworkSetup UP interface ?
for( QDictIterator<InterfaceInfo> It(ProbedInterfaces);
It.current();
++It ) {
Run = It.current();
if( N == Run->Name ) {
- // this PAN connection is up
+ // this PAN NetworkSetup is up
return Run;
}
}
return 0;
}
#include <stdarg.h>
static FILE * logf = 0;
diff --git a/noncore/settings/networksettings2/networksettings2/system.h b/noncore/settings/networksettings2/networksettings2/system.h
index ebee0d5..794b868 100644
--- a/noncore/settings/networksettings2/networksettings2/system.h
+++ b/noncore/settings/networksettings2/networksettings2/system.h
@@ -8,17 +8,17 @@
using namespace Opie::Core;
// for hardware types
#include <net/if_arp.h>
#include <qdict.h>
#include <qobject.h>
#include <stdio.h>
-class NodeCollection;
+class NetworkSetup;
class ANetNodeInstance;
class QFile;
class MyProcess : public QObject {
Q_OBJECT
public :
@@ -61,23 +61,23 @@ public :
InterfaceInfo() :
Name(),
MACAddress(),
BCastAddress(),
Netmask(),
DstAddress() {
}
- NodeCollection * assignedConnection()
+ NetworkSetup * assignedToNetworkSetup()
{ return Collection; }
- void assignConnection( NodeCollection * NNI )
+ void assignToNetworkSetup( NetworkSetup * NNI )
{ Collection = NNI; }
- NodeCollection * Collection; // connection taking care of me
+ NetworkSetup * Collection; // networkSetup taking care of me
QString Name; // name of interface
int CardType; // type of card
QString MACAddress; // MAC address
QString Address; // IP Address
QString BCastAddress; // Broadcast Address
QString Netmask; // Netmask
QString DstAddress; // Peer address (if P-t-P)
bool IsUp; // interface is UP
diff --git a/noncore/settings/networksettings2/nsdata.cpp b/noncore/settings/networksettings2/nsdata.cpp
index 39031ed..b4622fc 100644
--- a/noncore/settings/networksettings2/nsdata.cpp
+++ b/noncore/settings/networksettings2/nsdata.cpp
@@ -45,24 +45,24 @@ NetworkSettingsData::NetworkSettingsData( void ) {
for ( QStringList::Iterator it = SL.begin();
it != SL.end();
++it ) {
profilenr = atol( (*it).mid( 8 ).latin1() );
// read the interface store int 'up'
F->setName( D.path() + "/" + (*it) );
if( F->open( IO_ReadOnly ) ) {
- NodeCollection * NC;
+ NetworkSetup * NC;
interfacename = TS.readLine();
F->close();
Log(( "Assign interface %s to Profile nr %d\n",
interfacename.latin1(), profilenr ));
- NC = NSResources->getConnection( profilenr );
+ NC = NSResources->getNetworkSetup( profilenr );
if( NC ) {
NC->assignInterface(
NSResources->system().findInterface( interfacename ) );
Log(( "Assign interface %p\n",
NC->assignedInterface() ));
} else {
Log(( "Profile nr %d no longer defined\n",
profilenr ));
@@ -94,38 +94,38 @@ void NetworkSettingsData::loadSettings( void ) {
/* load the file ->
FORMAT :
[NETNODETYPE]
Entries ...
<EMPTYLINE>
- [connection]
+ [NetworkSetup]
Name=Name
Node=Name
<EMPTYLINE>
*/
while( ! TS.atEnd() ) {
S = Line = TS.readLine();
if ( S.isEmpty() || S[0] != '[' )
continue;
S = S.mid( 1, S.length()-2 );
if( ! NSResources ) {
continue;
}
- if( S == "connection" ) {
- // load connections -> collections of nodes
+ if( S == "NetworkSetup" ) {
+ // load NetworkSetups -> collections of nodes
bool Dangling;
- NodeCollection * NC = new NodeCollection( TS, Dangling );
- NSResources->addConnection( NC, Dangling );
+ NetworkSetup * NC = new NetworkSetup( TS, Dangling );
+ NSResources->addNetworkSetup( NC, Dangling );
} else {
ANetNode * NN = 0;
ANetNodeInstance* NNI = 0;
if( S.startsWith( "nodetype " ) ) {
S = S.mid( 9, S.length()-9 );
S = deQuote(S);
// try to find netnode
NN = NSResources->findNetNode( S );
@@ -246,62 +246,62 @@ QString NetworkSettingsData::saveSettings( void ) {
<< QString(NNI->nodeClass()->name())
<< ']'
<< endl;
NNI->saveAttributes( TS );
TS << endl;
}
}
- // good connections
- { Name2Connection_t & M = NSResources->connections();
+ // good NetworkSetups
+ { Name2NetworkSetup_t & M = NSResources->networkSetups();
- // for all connections
- for( QDictIterator<NodeCollection> it(M);
+ // for all NetworkSetups
+ for( QDictIterator<NetworkSetup> it(M);
it.current();
++it ) {
- TS << "[connection]" << endl;
+ TS << "[NetworkSetup]" << endl;
it.current()->save(TS);
}
}
- // save dangling connections
- { Name2Connection_t & M = NSResources->danglingConnections();
+ // save dangling NetworkSetups
+ { Name2NetworkSetup_t & M = NSResources->danglingNetworkSetups();
- // for all connections
- for( QDictIterator<NodeCollection> it(M);
+ // for all NetworkSetups
+ for( QDictIterator<NetworkSetup> it(M);
it.current();
++it ) {
- TS << "[connection]" << endl;
+ TS << "[NetworkSetup]" << endl;
it.current()->save(TS);
}
}
QDir D(".");
D.rename( CfgFile + ".bup", CfgFile );
//
// proper files AND system files regenerated
//
- for( QDictIterator<NodeCollection> it(NSResources->connections());
+ for( QDictIterator<NetworkSetup> it(NSResources->networkSetups());
it.current();
++it ) {
it.current()->setModified( 0 );
}
return ErrS;
}
QString NetworkSettingsData::generateSettings( void ) {
QString S = "";
Name2SystemFile_t & SFM = NSResources->systemFiles();
- Name2Connection_t & M = NSResources->connections();
- NodeCollection * NC;
+ Name2NetworkSetup_t & M = NSResources->networkSetups();
+ NetworkSetup * NC;
ANetNodeInstance * NNI;
ANetNodeInstance * FirstWithData;
RuntimeInfo * CurDev;
ANetNode * NN, * CurDevNN = 0;
long NoOfDevs;
long DevCtStart;
bool needToGenerate;
@@ -423,17 +423,17 @@ QString NetworkSettingsData::generateSettings( void ) {
for( QDictIterator<ANetNodeInstance> nniit(
NSResources->netNodeInstances() );
nniit.current();
++nniit ) {
nniit.current()->setDone(0);
}
- for( QDictIterator<NodeCollection> ncit(M);
+ for( QDictIterator<NetworkSetup> ncit(M);
ncit.current();
++ncit ) {
ncit.current()->setDone(0);
}
Log( ( "Generating system file %s\n", SF->name().latin1() ));
needToGenerate = 0;
@@ -483,39 +483,39 @@ QString NetworkSettingsData::generateSettings( void ) {
// global presection for this system file
if( ! SF->preSection() ) {
S = qApp->translate( "NetworkSettings",
"<p>Error in section \"Preamble\" for file \"%1\"</p>" ).
arg( SF->name() );
return S;
}
- // find connections that want to write to this file
- for( QDictIterator<NodeCollection> ncit(M);
+ // find NetworkSetups that want to write to this file
+ for( QDictIterator<NetworkSetup> ncit(M);
ncit.current();
++ncit ) {
NC = ncit.current();
if( NC->done() ) {
// already done
continue;
}
if( ! NC->hasDataForFile( *SF ) ) {
// no data
continue;
}
- Log(("Generating %s for connection %s\n",
+ Log(("Generating %s for NetworkSetup %s\n",
SF->name().latin1(), NC->name().latin1() ));
// find highest item that wants to write data to this file
FirstWithData = NC->firstWithDataForFile( *SF );
- // find device on which this connection works
+ // find device on which this NetworkSetup works
CurDev = NC->device();
// class of that node
CurDevNN = CurDev->netNode()->nodeClass();
if( ! FirstWithData->nodeClass()->done() ) {
// generate fixed part
if( ! SF->preDeviceSection( CurDevNN ) ) {
S = qApp->translate( "NetworkSettings",
@@ -566,27 +566,27 @@ QString NetworkSettingsData::generateSettings( void ) {
Log(( "Systemfile %s for Nodeclass %s is done\n",
SF->name().latin1(),
CurDev->netNode()->nodeClass()->name()
));
}
// generate profile specific info
- // for all nodeconnections that work on the same device
- for( QDictIterator<NodeCollection> ncit2(M);
+ // for all nodeNetworkSetups that work on the same device
+ for( QDictIterator<NetworkSetup> ncit2(M);
ncit2.current();
++ncit2 ) {
if( ncit2.current()->device() != CurDev ) {
// different device
continue;
}
- Log(("Connection %s of family %s\n",
+ Log(("NetworkSetup %s of family %s\n",
ncit2.current()->name().latin1(),
CurDev->name() ));
// generate
NNI = ncit2.current()->firstWithDataForFile( *SF );
for( int i = DevCtStart; i < NoOfDevs ; i ++ ) {
if( ! SF->preNodeSection( NNI, i ) ) {
S = qApp->translate( "NetworkSettings",
"<p>Error in \"Pre-Node Part\" for file \"%1\" and node \"%2\"</p>" ).
@@ -640,62 +640,62 @@ QString NetworkSettingsData::generateSettings( void ) {
}
// end of file
SF->close();
}
return S;
}
-QList<NodeCollection> NetworkSettingsData::collectPossible(
+QList<NetworkSetup> NetworkSettingsData::collectPossible(
const QString & Interface ) {
- // collect connections that can work on top of this interface
- NodeCollection * NC;
- QList<NodeCollection> PossibleConnections;
- Name2Connection_t & M = NSResources->connections();
+ // collect NetworkSetups that can work on top of this interface
+ NetworkSetup * NC;
+ QList<NetworkSetup> PossibleNetworkSetups;
+ Name2NetworkSetup_t & M = NSResources->networkSetups();
- // for all connections
- for( QDictIterator<NodeCollection> it(M);
+ // for all NetworkSetups
+ for( QDictIterator<NetworkSetup> it(M);
it.current();
++it ) {
NC = it.current();
// check if this profile handles the requested interface
if( NC->handlesInterface( Interface ) && // if different Intf.
NC->state() != Disabled && // if enabled
NC->state() != IsUp // if already used
) {
Log( ( "Append %s for %s\n",
NC->name().latin1(), Interface.latin1() ));
- PossibleConnections.append( NC );
+ PossibleNetworkSetups.append( NC );
}
}
- return PossibleConnections;
+ return PossibleNetworkSetups;
}
/*
Called by the system to see if interface can be brought UP
if allowed, echo Interface-allowed else Interface-disallowed
*/
bool NetworkSettingsData::canStart( const QString & Interface ) {
// load situation
- NodeCollection * NC = 0;
- QList<NodeCollection> PossibleConnections;
+ NetworkSetup * NC = 0;
+ QList<NetworkSetup> PossibleNetworkSetups;
- PossibleConnections = collectPossible( Interface );
+ PossibleNetworkSetups = collectPossible( Interface );
Log( ( "for %s : Possiblilies %d\n",
- Interface.latin1(), PossibleConnections.count() ));
- switch( PossibleConnections.count() ) {
- case 0 : // no connections
+ Interface.latin1(), PossibleNetworkSetups.count() ));
+ switch( PossibleNetworkSetups.count() ) {
+ case 0 : // no NetworkSetups
break;
- case 1 : // one connection
- NC = PossibleConnections.first();
+ case 1 : // one NetworkSetup
+ NC = PossibleNetworkSetups.first();
break;
default : // need to ask user ?
return 1;
}
if( NC ) {
switch( NC->state() ) {
case Unchecked :
@@ -731,49 +731,49 @@ bool NetworkSettingsData::canStart( const QString & Interface ) {
printf( "D-%s\n", Interface.latin1() );
return 0;
}
bool NetworkSettingsData::isModified( void ) {
if( ForceModified )
return 1;
- for( QDictIterator<NodeCollection> it(NSResources->connections());
+ for( QDictIterator<NetworkSetup> it(NSResources->networkSetups());
it.current();
++it ) {
if( it.current()->isModified() ) {
return 1;
}
}
return 0;
}
bool NetworkSettingsData::couldBeTriggered( const QString & Interface ) {
// load situation
- QList<NodeCollection> PossibleTriggered;
+ QList<NetworkSetup> PossibleTriggered;
PossibleTriggered = collectTriggered( Interface );
Log( ( "for %s : Possiblilies %d\n",
Interface.latin1(), PossibleTriggered.count() ));
return ( PossibleTriggered.count() ) ? 1 : 0;
}
-QList<NodeCollection> NetworkSettingsData::collectTriggered(
+QList<NetworkSetup> NetworkSettingsData::collectTriggered(
const QString & Interface ) {
- // collect connections that could be triggered by this interface
- NodeCollection * NC;
- QList<NodeCollection> PossibleTriggered;
+ // collect NetworkSetups that could be triggered by this interface
+ NetworkSetup * NC;
+ QList<NetworkSetup> PossibleTriggered;
- // for all connections
- Name2Connection_t & M = NSResources->connections();
+ // for all NetworkSetups
+ Name2NetworkSetup_t & M = NSResources->networkSetups();
- for( QDictIterator<NodeCollection> it(M);
+ for( QDictIterator<NetworkSetup> it(M);
it.current();
++it ) {
NC = it.current();
// check if this profile handles the requested interface
if( NC->triggeredBy( Interface ) && // if different Intf.
NC->state() != Disabled && // if enabled
NC->state() != IsUp // if already used
) {
diff --git a/noncore/settings/networksettings2/nsdata.h b/noncore/settings/networksettings2/nsdata.h
index 5791c1e..b9c216d 100644
--- a/noncore/settings/networksettings2/nsdata.h
+++ b/noncore/settings/networksettings2/nsdata.h
@@ -14,25 +14,25 @@ public :
QString saveSettings( void );
QString generateSettings( void );
bool isModified( void );
inline void setModified( bool M )
{ ForceModified = M; }
- QList<NodeCollection> collectPossible( const QString & Interface );
+ QList<NetworkSetup> collectPossible( const QString & Interface );
// return TRUE if we need gui to decide
bool canStart( const QString & Interface );
// return TRUE if there are vpns that could be triggered
// by this interface
bool couldBeTriggered( const QString & Interface );
private :
- QList<NodeCollection> collectTriggered( const QString &Interface );
+ QList<NetworkSetup> collectTriggered( const QString &Interface );
bool ForceModified;
// collect strings in config file nobody wants
QStringList LeftOvers;
};
#endif
diff --git a/noncore/settings/networksettings2/opietooth2/OTDriver.cpp b/noncore/settings/networksettings2/opietooth2/OTDriver.cpp
index a7ee662..cfd0491 100644
--- a/noncore/settings/networksettings2/opietooth2/OTDriver.cpp
+++ b/noncore/settings/networksettings2/opietooth2/OTDriver.cpp
@@ -708,17 +708,17 @@ long OTDriver::getLinkQuality( const OTDeviceAddress & Addr ) {
sizeof(*cr) + sizeof(struct hci_conn_info));
if (!cr)
return 0;
bacpy( &(cr->bdaddr), &(Addr.getBDAddr()) );
cr->type = ACL_LINK;
if (ioctl( fd(), HCIGETCONNINFO, (unsigned long) cr) < 0) {
- odebug << "Get connection info failed" << oendl;
+ odebug << "Get NetworkSetup info failed" << oendl;
free(cr);
return 0;
}
handle = htobs(cr->conn_info->handle);
free(cr);
@@ -726,17 +726,17 @@ long OTDriver::getLinkQuality( const OTDeviceAddress & Addr ) {
rq.ogf = OGF_STATUS_PARAM;
rq.ocf = OCF_READ_RSSI;
rq.cparam = &handle;
rq.clen = 2;
rq.rparam = &rp;
rq.rlen = GET_LINK_QUALITY_RP_SIZE;
if (hci_send_req( fd(), &rq, 100) < 0) {
- odebug << "Get connection info failed" << oendl;
+ odebug << "Get NetworkSetup info failed" << oendl;
return 0;
}
if( rp.status ) {
odebug << QString().sprintf("HCI get_link_quality cmd failed (0x%2.2X)", rp.status) << oendl;
return 0;
}
diff --git a/noncore/settings/networksettings2/opietooth2/OTDriver.h b/noncore/settings/networksettings2/opietooth2/OTDriver.h
index b54ffdf..899fab4 100644
--- a/noncore/settings/networksettings2/opietooth2/OTDriver.h
+++ b/noncore/settings/networksettings2/opietooth2/OTDriver.h
@@ -7,17 +7,17 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef OTDRIVER_H
#define OTDRIVER_H
/*
- * This class handles the connection with the BlueZ libraries, implements
+ * This class handles the networkSetup with the BlueZ libraries, implements
* most of the bluetooth-related functions and owns the KBTDevice class
* that is a single local bluetooth device representation.
* It is used as a Singleton pattern thru the getDefaultConnector() method.
*
*/
#include <qobject.h>
#include <opie2/odebug.h>
#include <bluezlib.h>
@@ -113,17 +113,17 @@ public:
* Returns the string representation of the device id,
* with the same format of the hciconfig tool.
*/
QString devname()
{ return Dev; };
/*
* Returns the file descriptor for the local
- * connection to this device
+ * networkSetup to this device
*/
int fd() const
{ return Fd; };
void setfd(int _fd)
{ Fd = _fd; };
void setType(int _type)
{ Type = _type; };
diff --git a/noncore/settings/networksettings2/opietooth2/OTGateway.cpp b/noncore/settings/networksettings2/opietooth2/OTGateway.cpp
index 1b61a2e..7fc8719 100644
--- a/noncore/settings/networksettings2/opietooth2/OTGateway.cpp
+++ b/noncore/settings/networksettings2/opietooth2/OTGateway.cpp
@@ -57,19 +57,19 @@ OTGateway::OTGateway( void ) : QObject( 0, "OTGateway" ),
}
// load all known devices
updateDrivers();
// load all peers we have ever seen
loadKnownPeers();
- // iterate over drivers and find active connections
+ // iterate over drivers and find active NetworkSetups
// adding/updating peers
- loadActiveConnections();
+ loadActiveNetworkSetups();
// check every 4 seconds the state of BT
timerEvent(0);
RefreshTimer = -1;
setRefreshTimer( 4000 );
// load known link keys
readLinkKeys();
@@ -370,43 +370,43 @@ const char * OTGateway::deviceTypeToName( int cls ) {
return "imaging";
case 0x07:
default :
break;
}
return "unknown";
}
-PANConnectionVector OTGateway::getPANConnections( void ) {
- PANConnectionVector V;
+PANNetworkSetupVector OTGateway::getPANNetworkSetups( void ) {
+ PANNetworkSetupVector V;
struct bnep_connlist_req req;
struct bnep_conninfo ci[48];
V.setAutoDelete(TRUE);
int ctl = socket(PF_BLUETOOTH, SOCK_RAW, BTPROTO_BNEP);
if (ctl < 0) {
odebug << "Failed to open control socket" << oendl;
return V;
}
req.cnum = 48;
req.ci = ci;
if (ioctl(ctl, BNEPGETCONNLIST, &req)) {
- odebug << "Failed to get connection list" << oendl;
+ odebug << "Failed to get NetworkSetup list" << oendl;
::close( ctl );
return V;
}
for ( unsigned i=0; i < req.cnum; i++) {
V.resize( V.size() + 1 );
if( ci[i].role == BNEP_SVC_PANU ) {
// we are the client
- V.insert( V.size()-1, new OTPANConnection(
+ V.insert( V.size()-1, new OTPANNetworkSetup(
ci[i].device,
batostr((bdaddr_t *) ci[i].dst)
) );
}
}
::close( ctl );
return V;
@@ -505,17 +505,17 @@ bool OTGateway::removeLinkKey( unsigned int Index ) {
// remove last element
AllKeys.resize( AllKeys.size()-1 );
return 1;
}
#define MAXCONNECTIONS 10
-void OTGateway::loadActiveConnections( void ) {
+void OTGateway::loadActiveNetworkSetups( void ) {
struct hci_conn_list_req *cl;
struct hci_conn_info *ci;
OTDeviceAddress Addr;
OTPeer * P;
if (!(cl = (struct hci_conn_list_req *)malloc(
MAXCONNECTIONS * sizeof(*ci) + sizeof(*cl)))) {
@@ -527,23 +527,23 @@ void OTGateway::loadActiveConnections( void ) {
for( unsigned int i = 0;
i < AllDrivers.count();
i ++ ) {
if( ! AllDrivers[i]->isUp() ) {
continue;
}
- // driver is up -> check connections
+ // driver is up -> check NetworkSetups
cl->dev_id = AllDrivers[i]->devId();
cl->conn_num = MAXCONNECTIONS;
ci = cl->conn_info;
if (ioctl( getSocket(), HCIGETCONNLIST, (void *) cl)) {
- emit error( tr("Can't get connection list") );
+ emit error( tr("Can't get NetworkSetup list") );
break;
}
for ( int k = 0; k < cl->conn_num; k++, ci++) {
if( ci->state != BT_CONNECTED ) {
// not yet connected
continue;
@@ -748,17 +748,17 @@ int OTGateway::releaseRFCommDevice( int devnr ) {
emit error( tr("Can't get device list") );
::close( s );
return 0;
}
dr = di;
for (i = 0; i < dl->dev_num; i++, dr++) {
if( dr->id == devnr ) {
- // still in connection list
+ // still in NetworkSetup list
struct rfcomm_dev_req req;
int err;
memset(&req, 0, sizeof(req));
req.dev_id = devnr;
if ((err = ioctl(s, RFCOMMRELEASEDEV, &req)) < 0 ) {
return err;
diff --git a/noncore/settings/networksettings2/opietooth2/OTGateway.h b/noncore/settings/networksettings2/opietooth2/OTGateway.h
index 11c6b30..d0e42db 100644
--- a/noncore/settings/networksettings2/opietooth2/OTGateway.h
+++ b/noncore/settings/networksettings2/opietooth2/OTGateway.h
@@ -12,21 +12,21 @@ class QPixmap;
namespace Opietooth2 {
class OTDriverList;
class OTDriver;
class OTDevice;
class OTPeer;
class OTInquiry;
-class OTPANConnection;
+class OTPANNetworkSetup;
class OTLinkKey;
typedef QVector<OTPeer> PeerVector;
-typedef QVector<OTPANConnection> PANConnectionVector;
+typedef QVector<OTPANNetworkSetup> PANNetworkSetupVector;
typedef QArray<OTLinkKey> LinkKeyArray;
class OTLinkKey {
public :
OTLinkKey( const OTDeviceAddress & F,
const OTDeviceAddress & T ) {
@@ -38,21 +38,21 @@ public :
{ return To; }
const OTDeviceAddress & from()
{ return From; }
OTDeviceAddress From;
OTDeviceAddress To;
};
-class OTPANConnection {
+class OTPANNetworkSetup {
public :
- OTPANConnection( const QString & Dev, const QString & CT ) {
+ OTPANNetworkSetup( const QString & Dev, const QString & CT ) {
Device = Dev;
ConnectedTo = CT;
}
QString Device;
QString ConnectedTo;
};
@@ -87,17 +87,17 @@ public :
{ return HciCtl; }
OTDriverList & getDriverList()
{ return AllDrivers; }
OTDriver * driver( int nr )
{ return AllDrivers.count() == 0 ? 0 : AllDrivers[nr]; }
void updateDrivers();
- PANConnectionVector getPANConnections();
+ PANNetworkSetupVector getPANNetworkSetups();
// scan neighbourhood using device
void scanNeighbourhood( OTDriver * D = 0 );
void stopScanOfNeighbourhood(void );
void setScanWith( OTDriver * D = 0 )
{ ScanWith = (D) ? D :
(AllDrivers.count() ) ? AllDrivers[0] : 0; }
OTDriver * scanWith( void )
@@ -168,17 +168,17 @@ protected :
void connectNotify( const char * Signal );
void disconnectNotify( const char * Signal );
void timerEvent( QTimerEvent * );
private :
- void loadActiveConnections( void );
+ void loadActiveNetworkSetups( void );
void loadKnownPeers( void );
void saveKnownPeers( void );
bool isConnectedTo( int devid,
const OTDeviceAddress & Address );
void readLinkKeys();
static OTGateway * SingleGateway;
diff --git a/noncore/settings/networksettings2/opietooth2/OTInquiry.h b/noncore/settings/networksettings2/opietooth2/OTInquiry.h
index f7bdeec..559af7a 100644
--- a/noncore/settings/networksettings2/opietooth2/OTInquiry.h
+++ b/noncore/settings/networksettings2/opietooth2/OTInquiry.h
@@ -33,17 +33,17 @@ class OTHCISocket;
/** Scans for nearby bluetooth devices.
* This class provides an asynchronous interface to the
* inquriy HCI command. To scan for other devices, connect
* to the signals neighbourFound() and finished() and call
* inquiry(). Inquiry results are signalled as soon as they arrive,
* so the information can be displayed before the whole inquiry
* process is finished.
- * Still no connections should be set up before
+ * Still no networkSetups should be set up before
* the finished() signal was sent (hmm, is this always true..?)
*/
class OTInquiry : public QObject {
Q_OBJECT
public:
diff --git a/noncore/settings/networksettings2/ppp/PPPDialingedit.cpp b/noncore/settings/networksettings2/ppp/PPPDialingedit.cpp
index 9264ceb..2b03c73 100644
--- a/noncore/settings/networksettings2/ppp/PPPDialingedit.cpp
+++ b/noncore/settings/networksettings2/ppp/PPPDialingedit.cpp
@@ -11,15 +11,14 @@ PPPDialingEdit::PPPDialingEdit( QWidget * Parent ) :
// populate widget stack
}
QString PPPDialingEdit::acceptable( void ) {
return QString();
}
-bool PPPDialingEdit::commit( PPPData & D ) {
- bool SM;
- return SM;
+bool PPPDialingEdit::commit( PPPData & ) {
+ return true;
}
void PPPDialingEdit::showData( PPPData & D ) {
}
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.cpp b/noncore/settings/networksettings2/ppp/ppp_NN.cpp
index 8c15e9c..884168c 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NN.cpp
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.cpp
@@ -9,24 +9,24 @@
QStringList * PPPNetNode::ProperFiles = 0;
static const char * PPPNeeds[] =
{ "modem",
0
};
static const char * PPPProvides[] =
- { "connection",
+ { "NetworkSetup",
0
};
/**
* Constructor, find all of the possible interfaces
*/
-PPPNetNode::PPPNetNode() : ANetNode(tr("PPP Connection")) {
+PPPNetNode::PPPNetNode() : ANetNode(tr("PPP NetworkSetup")) {
NSResources->addSystemFile(
"pap-secrets", "/etc/ppp/pap-secrets", 0 );
NSResources->addSystemFile(
"chap-secrets", "/etc/ppp/chap-secrets", 0 );
}
/**
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
index 9e3bb64..7286d96 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
+++ b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
@@ -144,65 +144,65 @@ void APPP::commit( void ) {
if( GUI && GUI->commit( Data ) ) {
setModified( 1 );
}
}
bool APPP::openFile( SystemFile & SF ) {
if( SF.name() == "peers" ) {
SF.setPath( removeSpaces(
- QString( "/tmp/ppp/peers/" ) + connection()->name() ) );
+ QString( "/tmp/ppp/peers/" ) + networkSetup()->name() ) );
return 1;
} else if ( SF.name() == "chatscripts" ) {
SF.setPath( removeSpaces(
- QString( "/tmp/chatscripts/" ) + connection()->name() ) );
+ QString( "/tmp/chatscripts/" ) + networkSetup()->name() ) );
return 1;
}
return 0;
}
short APPP::generateFile( SystemFile & SF, long DevNr ) {
short rvl, rvd;
rvl = 1;
rvd = 1;
if( SF.name() == "pap-secrets" ) {
Log(("Generate PPP for %s\n", SF.name().latin1() ));
if( Data.Auth.Mode == 1 && Data.Auth.PCEMode == 0 ) {
SF << "# secrets for "
- << connection()->name().latin1()
+ << networkSetup()->name().latin1()
<< endl;
SF << Data.Auth.Client
<< " "
<< Data.Auth.Server
<< " "
<< Data.Auth.Secret
<< endl;
rvl = 0;
- rvd = connection()->getToplevel()->generateFileEmbedded(
+ rvd = networkSetup()->getToplevel()->generateFileEmbedded(
SF, DevNr );
}
} else if( SF.name() == "chap-secrets" ) {
Log(("Generate PPP for %s\n", SF.name().latin1() ));
if( Data.Auth.Mode == 1 && Data.Auth.PCEMode != 0 ) {
// used for both EAP and Chap
SF << "# secrets for "
- << connection()->name().latin1()
+ << networkSetup()->name().latin1()
<< endl;
SF << Data.Auth.Client
<< " "
<< Data.Auth.Server
<< " "
<< Data.Auth.Secret
<< endl;
rvl = 0;
- rvd = connection()->getToplevel()->generateFileEmbedded(
+ rvd = networkSetup()->getToplevel()->generateFileEmbedded(
SF, DevNr );
}
} else if ( SF.name() == "peers" ) {
QFileInfo FI(SF.path());
Log(("Generate PPP for %s\n", SF.name().latin1() ));
SF << "connect \"/usr/sbin/chat -v -f /etc/chatscripts/"
@@ -216,20 +216,20 @@ short APPP::generateFile( SystemFile & SF, long DevNr ) {
}
SF << "linkname "
<< removeSpaces( SF.name().latin1() )
<< endl;
// insert other data here
rvl = 0;
- rvd = connection()->getToplevel()->generateFileEmbedded(
+ rvd = networkSetup()->getToplevel()->generateFileEmbedded(
SF, DevNr );
} else if ( SF.name() == "chatscripts" ) {
Log(("Generate PPP for %s\n", SF.name().latin1() ));
rvl = 0;
- rvd = connection()->getToplevel()->generateFileEmbedded(
+ rvd = networkSetup()->getToplevel()->generateFileEmbedded(
SF, DevNr );
}
return (rvd == 2 || rvl == 2 ) ? 2 :
(rvd == 0 || rvl == 0 ) ? 0 : 1;
}
diff --git a/noncore/settings/networksettings2/ppp/ppprun.cpp b/noncore/settings/networksettings2/ppp/ppprun.cpp
index 8403e6d..f548483 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.cpp
+++ b/noncore/settings/networksettings2/ppp/ppprun.cpp
@@ -8,17 +8,17 @@ PPPRun::PPPRun( ANetNodeInstance * NNI, PPPData & Data ) :
State_t PPPRun::detectState( void ) {
if( isMyPPPDRunning( ) ) {
return ( isMyPPPUp() ) ? IsUp : Available;
}
return Off;
}
-QString PPPRun::setMyState( NodeCollection * NC, Action_t A, bool ) {
+QString PPPRun::setMyState( NetworkSetup * , Action_t , bool ) {
return QString();
}
bool PPPRun::isMyPPPDRunning( void ) {
return 0;
}
bool PPPRun::isMyPPPUp( void ) {
@@ -29,17 +29,17 @@ bool PPPRun::isMyPPPUp( void ) {
for( QDictIterator<InterfaceInfo> It(S.interfaces());
It.current();
++It ) {
Run = It.current();
if( R.match( Run->Name ) >= 0 &&
Run->IsPointToPoint
) {
// this is a LAN card
- if( Run->assignedConnection() == netNode()->connection() ) {
+ if( Run->assignedToNetworkSetup() == netNode()->networkSetup() ) {
// assigned to us
return 1;
}
}
}
return 0;
}
diff --git a/noncore/settings/networksettings2/ppp/ppprun.h b/noncore/settings/networksettings2/ppp/ppprun.h
index 2990a96..9535382 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.h
+++ b/noncore/settings/networksettings2/ppp/ppprun.h
@@ -18,17 +18,17 @@ public :
State_t detectState( void );
virtual RuntimeInfo * device( void )
{ return this; }
virtual RuntimeInfo * connection( void )
{ return this; }
protected :
- QString setMyState( NodeCollection * , Action_t, bool );
+ QString setMyState( NetworkSetup * , Action_t, bool );
private :
bool isMyPPPDRunning( void );
bool isMyPPPUp( void );
PPPData * D;
QRegExp Pat;
diff --git a/noncore/settings/networksettings2/profile/profile_NN.cpp b/noncore/settings/networksettings2/profile/profile_NN.cpp
index 1e6912e..007f4a5 100644
--- a/noncore/settings/networksettings2/profile/profile_NN.cpp
+++ b/noncore/settings/networksettings2/profile/profile_NN.cpp
@@ -1,43 +1,43 @@
#include <resources.h>
#include "profile_NN.h"
#include "profile_NNI.h"
#include "netnodeinterface.h"
static const char * ProfileNeeds[] =
- { "connection",
+ { "NetworkSetup",
0
};
static const char * ProfileProvides[] =
{ "fullsetup",
0
};
/**
* Constructor, find all of the possible interfaces
*/
-ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular connection profile")) {
+ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular NetworkSetup profile")) {
NSResources->addSystemFile(
"interfaces", "/etc/network/interfaces", 1 );
}
/**
* Delete any interfaces that we own.
*/
ProfileNetNode::~ProfileNetNode(){
}
const QString ProfileNetNode::nodeDescription(){
return tr("\
-<p>Define use of an IP connection.</p>\
-<p>Configure if and when this connection needs to be established</p>\
+<p>Define use of an IP NetworkSetup.</p>\
+<p>Configure if and when this NetworkSetup needs to be established</p>\
"
);
}
ANetNodeInstance * ProfileNetNode::createInstance( void ) {
return new AProfile( this );
}
diff --git a/noncore/settings/networksettings2/profile/profiledata.h b/noncore/settings/networksettings2/profile/profiledata.h
index c9577e5..2f7060d 100644
--- a/noncore/settings/networksettings2/profile/profiledata.h
+++ b/noncore/settings/networksettings2/profile/profiledata.h
@@ -4,14 +4,14 @@
#include <qstring.h>
class ProfileData {
public :
QString Description;
// start up automatically
bool Automatic;
// if started up automatically, ask user for confirmation
bool Confirm;
- // Do not bring this connection up
+ // Do not bring this networkSetup up
bool Disabled;
bool TriggerVPN;
} ;
#endif
diff --git a/noncore/settings/networksettings2/profile/profileedit.cpp b/noncore/settings/networksettings2/profile/profileedit.cpp
index 88aab15..ad943fe 100644
--- a/noncore/settings/networksettings2/profile/profileedit.cpp
+++ b/noncore/settings/networksettings2/profile/profileedit.cpp
@@ -9,19 +9,23 @@
#include <resources.h>
#include "profileedit.h"
ProfileEdit::ProfileEdit( QWidget * Parent, ANetNodeInstance * TNNI ) :
ProfileGUI( Parent ), RefreshTimer(this) {
InterfaceInfo * II;
+ II = TNNI->networkSetup()->assignedInterface();
+ Log(( "Interface %p %p %p: %d\n", II,
+ TNNI, TNNI->networkSetup(), (II) ? II->IsUp : 0 ));
+
NNI = TNNI;
Dev = NNI->runtime()->device();
- if( ( II = NNI->connection()->assignedInterface() ) ) {
+ if( ( II = NNI->networkSetup()->assignedInterface() ) ) {
Refresh_CB->setEnabled( TRUE );
Snd_GB->setEnabled( TRUE );
Rcv_GB->setEnabled( TRUE );
Collisions_FRM->setEnabled( TRUE );
// show current content
SLOT_Refresh();
@@ -72,17 +76,17 @@ bool ProfileEdit::commit( ProfileData & Data ) {
CBM( Data.TriggerVPN, TriggersVPN_CB, SM );
CBM( Data.Disabled, Disabled_CB, SM );
CBM( Data.Confirm, Confirm_CB, SM );
return SM;
}
void ProfileEdit::SLOT_Refresh( void ) {
- InterfaceInfo * II = NNI->connection()->assignedInterface();
+ InterfaceInfo * II = NNI->networkSetup()->assignedInterface();
NSResources->system().refreshStatistics( *II );
RcvBytes_LBL->setText( II->RcvBytes );
SndBytes_LBL->setText( II->SndBytes );
RcvErrors_LBL->setText( II->RcvErrors );
SndErrors_LBL->setText( II->SndErrors );
RcvDropped_LBL->setText( II->RcvDropped );
SndDropped_LBL->setText( II->SndDropped );
Collisions_LBL->setText( II->Collisions );
diff --git a/noncore/settings/networksettings2/profile/profilerun.cpp b/noncore/settings/networksettings2/profile/profilerun.cpp
index acb67bd..48011ea 100644
--- a/noncore/settings/networksettings2/profile/profilerun.cpp
+++ b/noncore/settings/networksettings2/profile/profilerun.cpp
@@ -1,20 +1,24 @@
#include <resources.h>
#include "profilerun.h"
State_t ProfileRun::detectState( void ) {
+ InterfaceInfo * II = networkSetup()->assignedInterface();
+
+ Log(( "Interface %p %p %p: %d\n", II,
+ netNode(), netNode()->networkSetup(), (II) ? II->IsUp : 0 ));
if( Data->Disabled ) {
return Disabled;
}
return Unknown;
}
-QString ProfileRun::setMyState( NodeCollection * NC, Action_t A, bool ) {
+QString ProfileRun::setMyState( NetworkSetup * NC, Action_t A, bool ) {
odebug << "Profile " << Data->Disabled << oendl;
if( A == Disable ) {
if( ! Data->Disabled ) {
Data->Disabled = 1;
NC->setModified( 1 );
}
} else if( A == Enable ) {
if( Data->Disabled ) {
diff --git a/noncore/settings/networksettings2/profile/profilerun.h b/noncore/settings/networksettings2/profile/profilerun.h
index 2d48b15..9470c0f 100644
--- a/noncore/settings/networksettings2/profile/profilerun.h
+++ b/noncore/settings/networksettings2/profile/profilerun.h
@@ -18,16 +18,16 @@ public :
{ return Data->Description; }
virtual bool triggersVPN( void )
{ return Data->TriggerVPN; }
State_t detectState( void );
protected :
- QString setMyState( NodeCollection * , Action_t, bool );
+ QString setMyState( NetworkSetup * , Action_t, bool );
private :
ProfileData * Data;
};
#endif
diff --git a/noncore/settings/networksettings2/usb/usb_NN.cpp b/noncore/settings/networksettings2/usb/usb_NN.cpp
index 6d90ae0..6e2597c 100644
--- a/noncore/settings/networksettings2/usb/usb_NN.cpp
+++ b/noncore/settings/networksettings2/usb/usb_NN.cpp
@@ -25,17 +25,17 @@ USBNetNode::USBNetNode() : ANetNode(tr("USB Cable Connect")) {
* Delete any interfaces that we own.
*/
USBNetNode::~USBNetNode(){
}
const QString USBNetNode::nodeDescription(){
return tr("\
<p>Configure Ethernet over USB.</p>\
-<p>Use this for a computer to computer USB cable connection</p>\
+<p>Use this for a computer to computer USB cable NetworkSetup</p>\
"
);
}
ANetNodeInstance * USBNetNode::createInstance( void ) {
return new AUSB( this );
}
diff --git a/noncore/settings/networksettings2/usb/usbrun.cpp b/noncore/settings/networksettings2/usb/usbrun.cpp
index 763644e..4082f7f 100644
--- a/noncore/settings/networksettings2/usb/usbrun.cpp
+++ b/noncore/settings/networksettings2/usb/usbrun.cpp
@@ -5,17 +5,17 @@
#include "usbrun.h"
State_t USBRun::detectState( void ) {
// unavailable : no card found
// available : card found and assigned to us or free
// up : card found and assigned to us and up
- NodeCollection * NC = nodeCollection();
+ NetworkSetup * NC = networkSetup();
QString S = QString( "/tmp/profile-%1.up" ).arg(NC->number());
System & Sys = NSResources->system();
InterfaceInfo * Run;
QFile F( S );
Log(("Detecting for %s\n", NC->name().latin1() ));
if( F.open( IO_ReadOnly ) ) {
// could open file -> read interface and assign
@@ -56,17 +56,17 @@ State_t USBRun::detectState( void ) {
// usb cables are currently always available when requested
// until we can detect if we are plugged in
return Available;
}
return Unavailable;
}
-QString USBRun::setMyState( NodeCollection * NC, Action_t A, bool ) {
+QString USBRun::setMyState( NetworkSetup * NC, Action_t, bool ) {
InterfaceInfo * I = getInterface();
if( ! I ) {
return QString("No usb device available");
}
Log(( "Grabbed USB interface %s\n", I->Name.latin1() ));
@@ -92,21 +92,21 @@ InterfaceInfo * USBRun::getInterface( void ) {
handlesInterface( Run->Name ),
Run->CardType, ARPHRD_ETHER,
! Run->IsUp ));
if( handlesInterface( Run->Name ) &&
Run->CardType == ARPHRD_ETHER
) {
// this is a USB card
- if( Run->assignedConnection() == netNode()->connection() ) {
+ if( Run->assignedToNetworkSetup() == netNode()->networkSetup() ) {
// assigned to us
return Run;
} else if( ! Run->IsUp &&
- Run->assignedConnection() == 0 ) {
+ Run->assignedToNetworkSetup() == 0 ) {
// free
best = Run;
} // UP or not assigned to us
}
}
return best; // can be 0
}
diff --git a/noncore/settings/networksettings2/usb/usbrun.h b/noncore/settings/networksettings2/usb/usbrun.h
index 6ce4fa2..0872f3d 100644
--- a/noncore/settings/networksettings2/usb/usbrun.h
+++ b/noncore/settings/networksettings2/usb/usbrun.h
@@ -20,17 +20,17 @@ public :
bool handlesInterface( const QString & I );
bool handlesInterface( InterfaceInfo * );
State_t detectState( void );
protected :
- QString setMyState( NodeCollection * , Action_t, bool );
+ QString setMyState( NetworkSetup * , Action_t, bool );
private :
InterfaceInfo * getInterface( void );
QRegExp Pat;
};
#endif
diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.cpp b/noncore/settings/networksettings2/vpn/vpn_NN.cpp
index 96e9df2..7c2e77b 100644
--- a/noncore/settings/networksettings2/vpn/vpn_NN.cpp
+++ b/noncore/settings/networksettings2/vpn/vpn_NN.cpp
@@ -3,34 +3,34 @@
#include "netnodeinterface.h"
static const char * VPNNeeds[] =
{ 0
};
static const char * VPNProvides[] =
- { "connection",
+ { "NetworkSetup",
0
};
/**
* Constructor, find all of the possible interfaces
*/
-VPNNetNode::VPNNetNode() : ANetNode(tr("VPN Connection")) {
+VPNNetNode::VPNNetNode() : ANetNode(tr("VPN NetworkSetup")) {
}
/**
* Delete any interfaces that we own.
*/
VPNNetNode::~VPNNetNode(){
}
const QString VPNNetNode::nodeDescription(){
return tr("\
-<p>Configure private IP connection.</p>\
+<p>Configure private IP NetworkSetup.</p>\
<p>Defines Secure tunnels over non secure IP sessions</p>\
"
);
}
ANetNodeInstance * VPNNetNode::createInstance( void ) {
return new AVPN( this );
}
diff --git a/noncore/settings/networksettings2/vpn/vpnrun.h b/noncore/settings/networksettings2/vpn/vpnrun.h
index 9a55625..e40aa87 100644
--- a/noncore/settings/networksettings2/vpn/vpnrun.h
+++ b/noncore/settings/networksettings2/vpn/vpnrun.h
@@ -15,13 +15,13 @@ public :
virtual RuntimeInfo * connection( void )
{ return this; }
State_t detectState( void )
{ return Unknown; }
protected :
- QString setMyState( NodeCollection * , Action_t, bool )
+ QString setMyState( NetworkSetup * , Action_t, bool )
{ return QString(); }
};
#endif
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
@@ -15,17 +15,17 @@
WLanEdit::WLanEdit( QWidget * Parent, ANetNodeInstance * TNNI ) :
WLanGUI( Parent ), RefreshTimer(this){
InterfaceInfo * II;
NNI = TNNI;
Dev = NNI->runtime()->device();
WE = 0;
- if( ( II = NNI->connection()->assignedInterface() ) ) {
+ if( ( II = NNI->networkSetup()->assignedInterface() ) ) {
// show data
WE = new WExtensions( II->Name );
if( WE->doesHaveWirelessExtensions() ) {
QString S;
Station_LBL->setText( WE->station() );
ESSID_LBL->setText( WE->essid() );
Mode_LBL->setText( WE->mode() );
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
@@ -6,17 +6,17 @@
#include "wlanrun.h"
State_t WLanRun::detectState( void ) {
// unavailable : no card found
// available : card found and assigned to us or free
// up : card found and assigned to us and up
- NodeCollection * NC = nodeCollection();
+ NetworkSetup * NC = networkSetup();
QString S = QString( "/tmp/profile-%1.up" ).arg(NC->number());
System & Sys = NSResources->system();
InterfaceInfo * Run;
QFile F( S );
if( F.open( IO_ReadOnly ) ) {
// could open file -> read interface and assign
@@ -65,17 +65,17 @@ State_t WLanRun::detectState( void ) {
return Off;
}
}
return Unavailable;
}
-QString WLanRun::setMyState( NodeCollection * , Action_t , bool ) {
+QString WLanRun::setMyState( NetworkSetup * , Action_t , bool ) {
// we only handle activate and deactivate
return QString();
}
// get interface that is free or assigned to us
InterfaceInfo * WLanRun::getInterface( void ) {
@@ -89,20 +89,20 @@ InterfaceInfo * WLanRun::getInterface( void ) {
if( handlesInterface( *Run ) &&
( Run->CardType == ARPHRD_ETHER
#ifdef ARPHRD_IEEE1394
|| Run->CardType == ARPHRD_IEEE1394
#endif
)
) {
// this is a LAN card
- if( Run->assignedConnection() == netNode()->connection() ) {
+ if( Run->assignedToNetworkSetup() == netNode()->networkSetup() ) {
// assigned to us
return Run;
- } else if( Run->assignedConnection() == 0 ) {
+ } else if( Run->assignedToNetworkSetup() == 0 ) {
// free
best = Run;
}
}
}
return best; // can be 0
}
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
@@ -19,17 +19,17 @@ public :
bool handlesInterface( const QString & I );
bool handlesInterface( const InterfaceInfo & II );
State_t detectState( void );
protected :
- QString setMyState( NodeCollection * , Action_t, bool );
+ QString setMyState( NetworkSetup * , Action_t, bool );
private :
InterfaceInfo * getInterface( void );
QRegExp Pat;
WLanData * Data;
};