summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp6
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetooth_NN.h6
-rw-r--r--noncore/settings/networksettings2/cable/cable_NN.cpp2
-rw-r--r--noncore/settings/networksettings2/cable/cable_NN.h3
-rw-r--r--noncore/settings/networksettings2/editconnection.cpp12
-rw-r--r--noncore/settings/networksettings2/irda/irda_NN.cpp2
-rw-r--r--noncore/settings/networksettings2/irda/irda_NN.h3
-rw-r--r--noncore/settings/networksettings2/lancard/lancardGUI.ui92
-rw-r--r--noncore/settings/networksettings2/lancard/lancard_NN.cpp11
-rw-r--r--noncore/settings/networksettings2/lancard/lancard_NN.h8
-rw-r--r--noncore/settings/networksettings2/lancard/lancard_NNI.cpp2
-rw-r--r--noncore/settings/networksettings2/lancard/lancardedit.cpp195
-rw-r--r--noncore/settings/networksettings2/lancard/lancardedit.h12
-rw-r--r--noncore/settings/networksettings2/lancard/lancardrun.cpp34
-rw-r--r--noncore/settings/networksettings2/lancard/lancardrun.h6
-rw-r--r--noncore/settings/networksettings2/modem/modem_NN.cpp2
-rw-r--r--noncore/settings/networksettings2/modem/modem_NN.h3
-rw-r--r--noncore/settings/networksettings2/network/networkGUI.ui131
-rw-r--r--noncore/settings/networksettings2/network/network_NN.cpp2
-rw-r--r--noncore/settings/networksettings2/network/network_NN.h3
-rw-r--r--noncore/settings/networksettings2/network/networkedit.cpp66
-rw-r--r--noncore/settings/networksettings2/network/networkedit.h8
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.cpp12
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.h13
-rw-r--r--noncore/settings/networksettings2/networksettings2/resources.cpp8
-rw-r--r--noncore/settings/networksettings2/networksettings2/resources.h2
-rw-r--r--noncore/settings/networksettings2/networksettings2/systemfile.cpp8
-rw-r--r--noncore/settings/networksettings2/nsdata.cpp49
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.cpp2
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.h3
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.cpp2
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.h3
-rw-r--r--noncore/settings/networksettings2/usb/usb_NN.cpp2
-rw-r--r--noncore/settings/networksettings2/usb/usb_NN.h3
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NN.cpp2
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NN.h3
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NN.cpp2
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NN.h3
38 files changed, 554 insertions, 172 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp
index 4579e37..1d0a0f7 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp
+++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp
@@ -16,5 +16,6 @@ static const char * BluetoothBNEPNeeds[] =
* Constructor, find all of the possible interfaces
*/
-BluetoothBNEPNetNode::BluetoothBNEPNetNode() : ANetNode() {
+BluetoothBNEPNetNode::BluetoothBNEPNetNode() :
+ ANetNode(tr("Bluetooth PAN/NAP")) {
InstanceCount = 7; // default
}
@@ -89,5 +90,6 @@ static const char * BluetoothRFCOMMNeeds[] =
};
-BluetoothRFCOMMNetNode::BluetoothRFCOMMNetNode() : ANetNode() {
+BluetoothRFCOMMNetNode::BluetoothRFCOMMNetNode() :
+ ANetNode( tr("Bluetooth serial link") ) {
}
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
index 882d2e3..2e5e1d2 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
@@ -18,7 +18,4 @@ public:
{ return "Devices/bluetooth"; }
- virtual const QString nodeName()
- { return tr("Bluetooth PAN/NAP"); }
-
virtual const QString nodeDescription() ;
@@ -59,7 +56,4 @@ public:
{ return "Devices/bluetooth"; }
- virtual const QString nodeName()
- { return tr("Bluetooth serial link"); }
-
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/cable/cable_NN.cpp b/noncore/settings/networksettings2/cable/cable_NN.cpp
index dd41c1f..e95b4f6 100644
--- a/noncore/settings/networksettings2/cable/cable_NN.cpp
+++ b/noncore/settings/networksettings2/cable/cable_NN.cpp
@@ -9,5 +9,5 @@ static const char * CableNeeds[] =
* Constructor, find all of the possible interfaces
*/
-CableNetNode::CableNetNode() : ANetNode() {
+CableNetNode::CableNetNode() : ANetNode(tr("Cable Connection")) {
}
diff --git a/noncore/settings/networksettings2/cable/cable_NN.h b/noncore/settings/networksettings2/cable/cable_NN.h
index b37f31a..c48037a 100644
--- a/noncore/settings/networksettings2/cable/cable_NN.h
+++ b/noncore/settings/networksettings2/cable/cable_NN.h
@@ -18,7 +18,4 @@ public:
{ return "Devices/cable"; }
- virtual const QString nodeName()
- { return tr("Cable Connection"); }
-
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/editconnection.cpp b/noncore/settings/networksettings2/editconnection.cpp
index 4bbe502..77826d1 100644
--- a/noncore/settings/networksettings2/editconnection.cpp
+++ b/noncore/settings/networksettings2/editconnection.cpp
@@ -134,5 +134,5 @@ NodeCollection * EditConnection::getTmpCollection( void ) {
if( SelectedNodes == 0 ||
NNI == 0 ||
- NNI->nodeClass()->nodeName() != it->text(0) ) {
+ it->text(0) != NNI->nodeClass()->name() ) {
// new item not in previous collection
ANetNodeInstance * NNI = (*Mapping)[it]->createInstance();
@@ -197,5 +197,5 @@ void EditConnection::setConnection( NodeCollection * NC ) {
Found = 0;
while( it ) {
- if( NNI && NNI->nodeClass()->nodeName() == it->text(0) ) {
+ if( NNI && it->text(0) == NNI->nodeClass()->name() ) {
// this radio is part of the collection
((QCheckListItem *)it)->setOn( 1 );
@@ -283,5 +283,5 @@ void EditConnection::buildFullTree( void ) {
MyQCheckListItem * it = new MyQCheckListItem( TheTop,
- NN->nodeName(),
+ NN->name(),
QCheckListItem::RadioButton );
it->setPixmap( 0, NSResources->getPixmap( "Devices/commprofile" ) );
@@ -311,5 +311,5 @@ void EditConnection::buildSubTree( QListViewItem * it, ANetNode *NN ) {
CI = new MyQCheckListItem(
(QCheckListItem *)it,
- NNL[i]->nodeName(), QCheckListItem::RadioButton );
+ NNL[i]->name(), QCheckListItem::RadioButton );
// remember that this node maps to this listitem
CI->setPixmap( 0, NSResources->getPixmap( NNL[i]->pixmapName() ) );
@@ -318,5 +318,5 @@ void EditConnection::buildSubTree( QListViewItem * it, ANetNode *NN ) {
} else {
// Single item
- CI = new MyQListViewItem( it, NNL[i]->nodeName() );
+ CI = new MyQListViewItem( it, NNL[i]->name() );
// remember that this node maps to this listitem
Mapping->insert( CI, NNL[i] );
@@ -445,5 +445,5 @@ void EditConnection::SLOT_AlterTab( const QString & S ) {
Devices_CB->insertItem(
NSResources->getPixmap( NNI->nodeClass()->pixmapName() ),
- NNI->nodeClass()->nodeName()
+ NNI->nodeClass()->name()
);
diff --git a/noncore/settings/networksettings2/irda/irda_NN.cpp b/noncore/settings/networksettings2/irda/irda_NN.cpp
index 49b7707..f2fda5c 100644
--- a/noncore/settings/networksettings2/irda/irda_NN.cpp
+++ b/noncore/settings/networksettings2/irda/irda_NN.cpp
@@ -9,5 +9,5 @@ static const char * IRDANeeds[] =
* Constructor, find all of the possible interfaces
*/
-IRDANetNode::IRDANetNode() : ANetNode() {
+IRDANetNode::IRDANetNode() : ANetNode(tr("Infrared link")) {
}
diff --git a/noncore/settings/networksettings2/irda/irda_NN.h b/noncore/settings/networksettings2/irda/irda_NN.h
index 2dcef74..fa6408d 100644
--- a/noncore/settings/networksettings2/irda/irda_NN.h
+++ b/noncore/settings/networksettings2/irda/irda_NN.h
@@ -18,7 +18,4 @@ public:
{ return "Devices/irda"; }
- virtual const QString nodeName()
- { return tr("Infrared link"); }
-
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/lancard/lancardGUI.ui b/noncore/settings/networksettings2/lancard/lancardGUI.ui
index 8d94816..c407175 100644
--- a/noncore/settings/networksettings2/lancard/lancardGUI.ui
+++ b/noncore/settings/networksettings2/lancard/lancardGUI.ui
@@ -12,5 +12,5 @@
<x>0</x>
<y>0</y>
- <width>362</width>
+ <width>354</width>
<height>359</height>
</rect>
@@ -70,5 +70,5 @@
<property stdset="1">
<name>margin</name>
- <number>11</number>
+ <number>5</number>
</property>
<property stdset="1">
@@ -81,18 +81,4 @@
<property>
<name>text</name>
- <string>Name</string>
- </property>
- <property>
- <name>clickable</name>
- <bool>true</bool>
- </property>
- <property>
- <name>resizeable</name>
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property>
- <name>text</name>
<string>MACAddress</string>
</property>
@@ -115,4 +101,64 @@
</property>
</widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>RemoveUnknown_BUT</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Remove Unknown</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer1</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>RescanCards_BUT</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Rescan</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
</vbox>
</widget>
@@ -126,4 +172,18 @@
<slot>setDisabled(bool)</slot>
</connection>
+ <connection>
+ <sender>RescanCards_BUT</sender>
+ <signal>clicked()</signal>
+ <receiver>Lancard_FRM</receiver>
+ <slot>SLOT_ScanCards()</slot>
+ </connection>
+ <connection>
+ <sender>RemoveUnknown_BUT</sender>
+ <signal>clicked()</signal>
+ <receiver>Lancard_FRM</receiver>
+ <slot>SLOT_RemoveUnknown()</slot>
+ </connection>
+ <slot access="public">SLOT_ScanCards()</slot>
+ <slot access="public">SLOT_RemoveUnknown()</slot>
</connections>
</UI>
diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.cpp b/noncore/settings/networksettings2/lancard/lancard_NN.cpp
index ba1c1f8..a4afab1 100644
--- a/noncore/settings/networksettings2/lancard/lancard_NN.cpp
+++ b/noncore/settings/networksettings2/lancard/lancard_NN.cpp
@@ -8,5 +8,5 @@ static const char * LanCardNeeds[] =
* Constructor, find all of the possible interfaces
*/
-LanCardNetNode::LanCardNetNode() : ANetNode() {
+LanCardNetNode::LanCardNetNode() : ANetNode(tr("LAN card")), NICMACAddresses() {
InstanceCount = 2;
}
@@ -70,4 +70,6 @@ void LanCardNetNode::setSpecificAttribute( QString & A, QString & V ) {
if( A == "interfacecount" ) {
InstanceCount = V.toLong();
+ } else if ( A == "macaddress" ) {
+ NICMACAddresses.append( V );
}
}
@@ -77,4 +79,11 @@ void LanCardNetNode::saveSpecificAttribute( QTextStream & TS) {
<< InstanceCount
<< endl;
+ for( QStringList::Iterator it = NICMACAddresses.begin();
+ it != NICMACAddresses.end();
+ ++it ) {
+ TS << "macaddress="
+ << (*it)
+ << endl;
+ }
}
diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.h b/noncore/settings/networksettings2/lancard/lancard_NN.h
index 5f2b25d..d58823c 100644
--- a/noncore/settings/networksettings2/lancard/lancard_NN.h
+++ b/noncore/settings/networksettings2/lancard/lancard_NN.h
@@ -2,4 +2,5 @@
#define LANCARD_NETNODE_H
+#include <qstringlist.h>
#include "netnode.h"
@@ -18,7 +19,4 @@ public:
{ return "Devices/card"; }
- virtual const QString nodeName()
- { return tr("LAN card"); }
-
virtual const QString nodeDescription() ;
@@ -37,4 +35,6 @@ public:
virtual QString genNic( long );
+ virtual QStringList & addressesOfNIC( void )
+ { return NICMACAddresses; }
private:
@@ -46,4 +46,6 @@ private:
long InstanceCount;
+ QStringList NICMACAddresses;
+
};
diff --git a/noncore/settings/networksettings2/lancard/lancard_NNI.cpp b/noncore/settings/networksettings2/lancard/lancard_NNI.cpp
index 5962d52..99c033e 100644
--- a/noncore/settings/networksettings2/lancard/lancard_NNI.cpp
+++ b/noncore/settings/networksettings2/lancard/lancard_NNI.cpp
@@ -31,5 +31,5 @@ void ALanCard::saveSpecificAttribute( QTextStream & TS) {
QWidget * ALanCard::edit( QWidget * parent ) {
GUI = new LanCardEdit( parent );
- GUI->showData( Data );
+ GUI->showData( this );
return GUI;
}
diff --git a/noncore/settings/networksettings2/lancard/lancardedit.cpp b/noncore/settings/networksettings2/lancard/lancardedit.cpp
index fa7f6dc..ffe9bf6 100644
--- a/noncore/settings/networksettings2/lancard/lancardedit.cpp
+++ b/noncore/settings/networksettings2/lancard/lancardedit.cpp
@@ -1,29 +1,17 @@
#include <GUIUtils.h>
#include <resources.h>
+#include <qarray.h>
#include <qlistview.h>
#include <qcheckbox.h>
#include <qheader.h>
#include <qregexp.h>
+
#include "lancardedit.h"
+#include "lancard_NN.h"
+#include "lancard_NNI.h"
LanCardEdit::LanCardEdit( QWidget * Parent ) : LanCardGUI( Parent ){
- System & S = NSResources->system();
- QRegExp R( "eth[0-9]" );
- QCheckListItem * CLI;
-
LanCards_LV->header()->hide();
- // populate with all lancards in system
- for( QDictIterator<InterfaceInfo> It(S.interfaces());
- It.current();
- ++It ) {
- if( R.match( It.current()->Name ) >= 0 &&
- It.current()->CardType == ARPHRD_ETHER
- ) {
- CLI = new QCheckListItem( LanCards_LV, It.current()->Name,
- QCheckListItem::CheckBox );
- CLI->setText( 1, It.current()->MACAddress );
- }
- }
}
@@ -32,5 +20,4 @@ QString LanCardEdit::acceptable( void ) {
}
-
bool LanCardEdit::commit( LanCardData & Data ) {
bool SM = 0;
@@ -38,13 +25,17 @@ bool LanCardEdit::commit( LanCardData & Data ) {
if( ! Data.AnyLanCard ) {
- // collect set of lancards that match
+ // take copy for orig list
+ QStringList NewList( Data.HWAddresses );
+
+ // update HWAddresses to new state
+ // remove item also from NewList
int idx;
QCheckListItem * CLI = (QCheckListItem *)LanCards_LV->firstChild();
while( CLI ) {
- idx = Data.HWAddresses.findIndex(CLI->text(1));
+ idx = Data.HWAddresses.findIndex(CLI->text(0));
if( CLI->isOn() ) {
if( idx < 0 ) {
// should be in list
- Data.HWAddresses.append( CLI->text(1) );
+ Data.HWAddresses.append( CLI->text(0) );
SM = 1;
}
@@ -52,5 +43,6 @@ bool LanCardEdit::commit( LanCardData & Data ) {
// should not be in list
if( idx >= 0 ) {
- Data.HWAddresses.remove( Data.HWAddresses.at(idx) );
+ NewList.remove( CLI->text(0) );
+ Data.HWAddresses.remove( CLI->text(0) );
SM = 1;
}
@@ -58,38 +50,159 @@ bool LanCardEdit::commit( LanCardData & Data ) {
CLI = (QCheckListItem *)CLI->nextSibling();
}
+
+ // if newlist still contains items. it were items
+ // that were checked but no longer are present in the system
+ SM |= ( NewList.count() > 0 ) ;
}
- return SM || ContainedObsoleteMAC ;
+ return SM;
}
-void LanCardEdit::showData( LanCardData & Data ) {
+void LanCardEdit::showData( ALanCard * LC ) {
+ NNI = LC;
+ LanCardData & Data = *((LanCardData *)LC->data());
+
AnyCard_CB->setChecked( Data.AnyLanCard );
+ // load all cards
+ populateList();
+
+ // set checks
QCheckListItem * CLI = (QCheckListItem *)LanCards_LV->firstChild();
+ while( CLI ) {
+ CLI->setOn( Data.HWAddresses.findIndex(CLI->text(0)) >= 0 );
+ CLI = (QCheckListItem *)CLI->nextSibling();
+ }
+}
- ContainedObsoleteMAC = 0;
- // remove obsolete address
- for( QStringList::Iterator it=Data.HWAddresses.begin();
- it != Data.HWAddresses.end();
- ) {
- CLI = (QCheckListItem *)LanCards_LV->firstChild();
- while( CLI ) {
- if( CLI->text(1) == (*it) )
- // still valid
+// load all known cards in list
+void LanCardEdit::populateList( void ) {
+ LanCardNetNode *NN = (LanCardNetNode *)NNI->nodeClass();
+ QCheckListItem * CLI;
+ bool Found;
+
+ LanCards_LV->clear();
+
+ for( QStringList::Iterator it = NN->addressesOfNIC().begin();
+ it != NN->addressesOfNIC().end();
+ ++it ) {
+ CLI = new QCheckListItem( LanCards_LV, (*it), QCheckListItem::CheckBox );
+
+ // check interfaces and see if this card is present
+ Found = 0;
+ for( QDictIterator<InterfaceInfo> NIt(NSResources->system().interfaces());
+ NIt.current();
+ ++NIt ) {
+ if( NIt.current()->MACAddress == (*it) ) {
+ Found = 1;
break;
- CLI = (QCheckListItem *)CLI->nextSibling();
+ }
}
- if( CLI == 0 ) {
- // address not found -> remove
- ContainedObsoleteMAC = 1;
- Data.HWAddresses.remove( it );
- } else {
- ++ it;
+
+ CLI->setPixmap( 0, NSResources->getPixmap(
+ (Found) ? "add" : "remove" ) );
+ }
+}
+
+// rescan system for new cards
+void LanCardEdit::SLOT_ScanCards( void ) {
+ LanCardNetNode *NN = (LanCardNetNode *)NNI->nodeClass();
+
+ // add any NIC that is new and matches our interfacename
+ System & S = NSResources->system();
+ QRegExp R( "eth[0-9]" );
+ // populate with all lancards in system
+ for( QDictIterator<InterfaceInfo> It(S.interfaces());
+ It.current();
+ ++It ) {
+ fprintf( stderr, "TEST %s %s\n",
+ It.current()->Name.latin1(),
+ It.current()->MACAddress.latin1() );
+ if( R.match( It.current()->Name ) >= 0 &&
+ ( It.current()->CardType == ARPHRD_ETHER
+#ifdef ARPHRD_IEEE1394
+ || It.current()->CardType == ARPHRD_IEEE1394
+#endif
+ )
+ ) {
+ // old item ?
+ QCheckListItem * CLI =
+ (QCheckListItem *)LanCards_LV->firstChild();
+ while( CLI ) {
+ if( CLI->text(0) == It.current()->MACAddress ) {
+ break;
+ }
+ CLI = (QCheckListItem *)CLI->nextSibling();
+ }
+
+ if( ! CLI ) {
+ // new item
+ CLI = new QCheckListItem( LanCards_LV,
+ It.current()->MACAddress,
+ QCheckListItem::CheckBox );
+ }
+
+ // mark present
+ CLI->setPixmap( 0, NSResources->getPixmap(
+ "add" ) );
+
+ if( NN->addressesOfNIC().findIndex( It.current()->MACAddress) < 0 ) {
+ // new
+ NN->addressesOfNIC().append( It.current()->MACAddress );
+ }
}
}
- // set checks
+}
+
+// remove all cards that are not present -> flagged with 'remove'
+// and unchecked
+void LanCardEdit::SLOT_RemoveUnknown( void ) {
+ QArray<QCheckListItem *> AllItems;
+
+ LanCardNetNode *NN = (LanCardNetNode *)NNI->nodeClass();
+
+ QCheckListItem * CLI = (QCheckListItem *)LanCards_LV->firstChild();
while( CLI ) {
- CLI->setOn( Data.HWAddresses.findIndex(CLI->text(1)) >= 0 );
+ AllItems.resize( AllItems.size()+1 );
+ AllItems[ AllItems.size()-1 ] = CLI;
CLI = (QCheckListItem *)CLI->nextSibling();
}
+
+ // force update of system
+ System & S = NSResources->system();
+ S.probeInterfaces();
+
+ // add any NIC that is new and matches our interfacename
+ QRegExp R( "eth[0-9]" );
+
+
+ for( QDictIterator<InterfaceInfo> It(S.interfaces());
+ It.current();
+ ++It ) {
+ if( R.match( It.current()->Name ) >= 0 &&
+ ( It.current()->CardType == ARPHRD_ETHER
+#ifdef ARPHRD_IEEE1394
+ || It.current()->CardType == ARPHRD_IEEE1394
+#endif
+ )
+ ) {
+
+ for ( unsigned i = 0; i< AllItems.size(); i++ ) {
+ if( AllItems[i] &&
+ AllItems[i]->text(0) == It.current()->MACAddress ) {
+ AllItems[i] = 0;
+ break;
+ }
+ }
+ }
+ }
+
+ // AllItems now contains all cards NOT present
+ // remove all items non null and not ON
+ for ( unsigned i = 0; i< AllItems.size(); i++ ) {
+ if( AllItems[i] && ! AllItems[i]->isOn() ) {
+ NN->addressesOfNIC().remove( AllItems[i]->text(0) );
+ delete AllItems[i];
+ }
+ }
}
diff --git a/noncore/settings/networksettings2/lancard/lancardedit.h b/noncore/settings/networksettings2/lancard/lancardedit.h
index 8def789..282db1f 100644
--- a/noncore/settings/networksettings2/lancard/lancardedit.h
+++ b/noncore/settings/networksettings2/lancard/lancardedit.h
@@ -2,4 +2,6 @@
#include "lancardGUI.h"
+class ALanCard;
+
class LanCardEdit : public LanCardGUI {
@@ -9,8 +11,14 @@ public :
QString acceptable( void );
bool commit( LanCardData & Data );
- void showData( LanCardData & Data );
+ void showData( ALanCard * NNI );
+
+public slots :
+
+ void SLOT_ScanCards( void );
+ void SLOT_RemoveUnknown( void );
private :
- bool ContainedObsoleteMAC;
+ void populateList( void );
+ ALanCard * NNI;
};
diff --git a/noncore/settings/networksettings2/lancard/lancardrun.cpp b/noncore/settings/networksettings2/lancard/lancardrun.cpp
index 951756d..2e4fc43 100644
--- a/noncore/settings/networksettings2/lancard/lancardrun.cpp
+++ b/noncore/settings/networksettings2/lancard/lancardrun.cpp
@@ -1,4 +1,5 @@
#include <qfile.h>
#include <qtextstream.h>
+#include <qstringlist.h>
#include <resources.h>
#include "lancardrun.h"
@@ -54,6 +55,10 @@ void LanCardRun::detectState( NodeCollection * NC ) {
++It ) {
Run = It.current();
- if( handlesInterface( Run->Name ) &&
- Run->CardType == ARPHRD_ETHER &&
+ if( handlesInterface( *Run ) &&
+ ( Run->CardType == ARPHRD_ETHER
+#ifdef ARPHRD_IEEE1394
+ || Run->CardType == ARPHRD_IEEE1394
+#endif
+ ) &&
! Run->IsUp
) {
@@ -146,6 +151,10 @@ InterfaceInfo * LanCardRun::getInterface( void ) {
++It ) {
Run = It.current();
- if( handlesInterface( Run->Name ) &&
- Run->CardType == ARPHRD_ETHER
+ if( handlesInterface( *Run ) &&
+ ( Run->CardType == ARPHRD_ETHER
+#ifdef ARPHRD_IEEE1394
+ || Run->CardType == ARPHRD_IEEE1394
+#endif
+ )
) {
// this is a LAN card
@@ -163,4 +172,21 @@ InterfaceInfo * LanCardRun::getInterface( void ) {
bool LanCardRun::handlesInterface( const QString & S ) {
+ InterfaceInfo * II;
+ II = NSResources->system().interface( S );
+ if( ( II = NSResources->system().interface( S ) ) ) {
+ return handlesInterface( *II );
+ }
return Pat.match( S ) >= 0;
}
+
+bool LanCardRun::handlesInterface( const InterfaceInfo & II ) {
+ if( Pat.match( II.Name ) < 0 )
+ return 0;
+
+ if( Data->AnyLanCard ) {
+ return 1;
+ }
+
+ // must also match hardware address
+ return ( Data->HWAddresses.findIndex( II.MACAddress ) >= 0 );
+}
diff --git a/noncore/settings/networksettings2/lancard/lancardrun.h b/noncore/settings/networksettings2/lancard/lancardrun.h
index 499b417..e8a535a 100644
--- a/noncore/settings/networksettings2/lancard/lancardrun.h
+++ b/noncore/settings/networksettings2/lancard/lancardrun.h
@@ -11,7 +11,7 @@ public :
LanCardRun( ANetNodeInstance * NNI,
- LanCardData & Data ) : AsDevice( NNI ),
+ LanCardData & D ) : AsDevice( NNI ),
Pat( "eth[0-9]" )
- { }
+ { Data = &D; }
virtual AsDevice * device( void )
@@ -28,4 +28,5 @@ protected :
bool handlesInterface( const QString & I );
+ bool handlesInterface( const InterfaceInfo & II );
private :
@@ -33,4 +34,5 @@ private :
InterfaceInfo * getInterface( void );
QRegExp Pat;
+ LanCardData * Data;
};
diff --git a/noncore/settings/networksettings2/modem/modem_NN.cpp b/noncore/settings/networksettings2/modem/modem_NN.cpp
index 1cc8524..9d70d7a 100644
--- a/noncore/settings/networksettings2/modem/modem_NN.cpp
+++ b/noncore/settings/networksettings2/modem/modem_NN.cpp
@@ -9,5 +9,5 @@ static const char * ModemNeeds[] =
* Constructor, find all of the possible interfaces
*/
-ModemNetNode::ModemNetNode() : ANetNode() {
+ModemNetNode::ModemNetNode() : ANetNode(tr("Dialup modem")) {
}
diff --git a/noncore/settings/networksettings2/modem/modem_NN.h b/noncore/settings/networksettings2/modem/modem_NN.h
index 849f928..2f496dd 100644
--- a/noncore/settings/networksettings2/modem/modem_NN.h
+++ b/noncore/settings/networksettings2/modem/modem_NN.h
@@ -18,7 +18,4 @@ public:
{ return "Devices/modem"; }
- virtual const QString nodeName()
- { return tr("Dialup modem"); }
-
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/network/networkGUI.ui b/noncore/settings/networksettings2/network/networkGUI.ui
index 9115ec0..5f71f82 100644
--- a/noncore/settings/networksettings2/network/networkGUI.ui
+++ b/noncore/settings/networksettings2/network/networkGUI.ui
@@ -12,5 +12,5 @@
<x>0</x>
<y>0</y>
- <width>293</width>
+ <width>289</width>
<height>254</height>
</rect>
@@ -39,5 +39,5 @@
<property stdset="1">
<name>name</name>
- <cstring>TabWidget11</cstring>
+ <cstring>MainTab_TAB</cstring>
</property>
<property>
@@ -484,5 +484,5 @@
<property stdset="1">
<name>name</name>
- <cstring>Tab_TB</cstring>
+ <cstring>Tab_TAB</cstring>
</property>
<property>
@@ -1059,5 +1059,130 @@
<slot>setEnabled(bool)</slot>
</connection>
+ <connection>
+ <sender>AddPreUp_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Add()</slot>
+ </connection>
+ <connection>
+ <sender>DeletePreUp_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Remove()</slot>
+ </connection>
+ <connection>
+ <sender>UpPreUp_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Up()</slot>
+ </connection>
+ <connection>
+ <sender>DownPreUp_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Down()</slot>
+ </connection>
+ <connection>
+ <sender>AddPostUp_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Add()</slot>
+ </connection>
+ <connection>
+ <sender>DeletePostUp_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Remove()</slot>
+ </connection>
+ <connection>
+ <sender>UpPostUp_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Up()</slot>
+ </connection>
+ <connection>
+ <sender>DownPostUp_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Down()</slot>
+ </connection>
+ <connection>
+ <sender>AddPreDown_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Add()</slot>
+ </connection>
+ <connection>
+ <sender>DeletePreDown_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Remove()</slot>
+ </connection>
+ <connection>
+ <sender>UpPreDown_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Up()</slot>
+ </connection>
+ <connection>
+ <sender>DownPreDown_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Down()</slot>
+ </connection>
+ <connection>
+ <sender>AddPostDown_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Add()</slot>
+ </connection>
+ <connection>
+ <sender>DeletePostDown_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Remove()</slot>
+ </connection>
+ <connection>
+ <sender>UpPostDown_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Up()</slot>
+ </connection>
+ <connection>
+ <sender>DownPostDown_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_Down()</slot>
+ </connection>
+ <connection>
+ <sender>PreUp_LB</sender>
+ <signal>doubleClicked(QListBoxItem*)</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_ShowCommand( QListBoxItem *)</slot>
+ </connection>
+ <connection>
+ <sender>PreDown_LB</sender>
+ <signal>doubleClicked(QListBoxItem*)</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_ShowCommand( QListBoxItem *)</slot>
+ </connection>
+ <connection>
+ <sender>PostDown_LB</sender>
+ <signal>doubleClicked(QListBoxItem*)</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_ShowCommand( QListBoxItem *)</slot>
+ </connection>
+ <connection>
+ <sender>PostUp_LB</sender>
+ <signal>doubleClicked(QListBoxItem*)</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_ShowCommand( QListBoxItem *)</slot>
+ </connection>
+ <slot access="public">SLOT_Add()</slot>
+ <slot access="public">SLOT_Down()</slot>
<slot access="public">SLOT_NetmaskModified( const QString &amp; )</slot>
+ <slot access="public">SLOT_Remove()</slot>
+ <slot access="public">SLOT_Up()</slot>
+ <slot access="public">SLOT_ShowCommand( QListBoxItem *)</slot>
</connections>
<tabstops>
diff --git a/noncore/settings/networksettings2/network/network_NN.cpp b/noncore/settings/networksettings2/network/network_NN.cpp
index d27d54a..b5989df 100644
--- a/noncore/settings/networksettings2/network/network_NN.cpp
+++ b/noncore/settings/networksettings2/network/network_NN.cpp
@@ -10,5 +10,5 @@ static const char * NetworkNeeds[] =
* Constructor, find all of the possible interfaces
*/
-NetworkNetNode::NetworkNetNode() : ANetNode() {
+NetworkNetNode::NetworkNetNode() : ANetNode(tr("IP Configuration")) {
}
diff --git a/noncore/settings/networksettings2/network/network_NN.h b/noncore/settings/networksettings2/network/network_NN.h
index 0f87e1b..6548c32 100644
--- a/noncore/settings/networksettings2/network/network_NN.h
+++ b/noncore/settings/networksettings2/network/network_NN.h
@@ -18,7 +18,4 @@ public:
{ return "Devices/tcpip"; }
- virtual const QString nodeName()
- { return tr("IP Configuration"); }
-
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/network/networkedit.cpp b/noncore/settings/networksettings2/network/networkedit.cpp
index 182213b..05110d9 100644
--- a/noncore/settings/networksettings2/network/networkedit.cpp
+++ b/noncore/settings/networksettings2/network/networkedit.cpp
@@ -1,4 +1,5 @@
#include <qtoolbutton.h>
#include <qcheckbox.h>
+#include <qtabwidget.h>
#include <qlineedit.h>
#include <qlistbox.h>
@@ -111,5 +112,11 @@ bool NetworkEdit::updateList( QStringList & SL, QListBox * LB ) {
}
- // check if at least ONE item in new list is NEW
+ if( NewSL.count() != SL.count() ) {
+ // less or more items
+ SL= NewSL;
+ return 1;
+ }
+
+ // Same size -> same content ?
Changed = 0;
for ( QStringList::Iterator it = NewSL.begin();
@@ -159,2 +166,59 @@ void NetworkEdit::SLOT_NetmaskModified( const QString & ) {
}
}
+
+QListBox * NetworkEdit::getActiveLB( void ) {
+ switch( Tab_TAB->currentPageIndex() ) {
+ case 0 :
+ return PreUp_LB;
+ case 1 :
+ return PostUp_LB;
+ case 2 :
+ return PreDown_LB;
+ }
+ return PostDown_LB;
+}
+
+void NetworkEdit::SLOT_Add( void ) {
+ if( Command_LE->text().isEmpty() )
+ return;
+ QListBox * LB = getActiveLB();
+
+ LB->insertItem( Command_LE->text() );
+}
+
+void NetworkEdit::SLOT_Remove( void ) {
+ QListBox * LB = getActiveLB();
+ int i;
+
+ if( ( i = LB->currentItem() ) >= 0 ) {
+ LB->removeItem( i );
+ }
+}
+
+void NetworkEdit::SLOT_Up( void ) {
+ QListBox * LB = getActiveLB();
+ int i;
+
+ if( ( i = LB->currentItem() ) > 0 ) {
+ QListBoxItem * LBI = LB->item(i);
+ LB->takeItem( LBI );
+ LB->insertItem( LBI, --i );
+ LB->setCurrentItem( i );
+ }
+}
+
+void NetworkEdit::SLOT_Down( void ) {
+ QListBox * LB = getActiveLB();
+ int i;
+
+ if( ( i = LB->currentItem() ) >= 0 && (unsigned)(i+1) != LB->count() ) {
+ QListBoxItem * LBI = LB->item(i);
+ LB->takeItem( LBI );
+ LB->insertItem( LBI, ++i );
+ LB->setCurrentItem( i );
+ }
+}
+
+void NetworkEdit::SLOT_ShowCommand( QListBoxItem * It ) {
+ Command_LE->setText( It->text() );
+}
diff --git a/noncore/settings/networksettings2/network/networkedit.h b/noncore/settings/networksettings2/network/networkedit.h
index 9ed4e84..adc20e0 100644
--- a/noncore/settings/networksettings2/network/networkedit.h
+++ b/noncore/settings/networksettings2/network/networkedit.h
@@ -2,4 +2,6 @@
#include "networkGUI.h"
+class QListBox;
+
class NetworkEdit : public NetworkGUI {
@@ -14,7 +16,13 @@ public slots :
void SLOT_NetmaskModified( const QString & S );
+ void SLOT_ShowCommand( QListBoxItem * LBI );
+ void SLOT_Add( void );
+ void SLOT_Remove( void );
+ void SLOT_Up( void );
+ void SLOT_Down( void );
private :
+ QListBox * getActiveLB( void );
bool updateList( QStringList &SL, QListBox * LB );
void populateList( QStringList &SL, QListBox * LB );
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.cpp b/noncore/settings/networksettings2/networksettings2/netnode.cpp
index 3691e5a..417fba8 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.cpp
+++ b/noncore/settings/networksettings2/networksettings2/netnode.cpp
@@ -75,11 +75,11 @@ void ANetNodeInstance::initialize( void ) {
QString N;
N.sprintf( "-%ld", InstanceCounter++ );
- N.prepend( NodeType->nodeName() );
- setNodeName( N );
+ N.prepend( NodeType->name() );
+ setName( N.latin1() );
}
void ANetNodeInstance::setAttribute( QString & Attr, QString & Value ){
if( Attr == "name" ) {
- NodeName = Value;
+ setName( Value.latin1() );
} else {
setSpecificAttribute( Attr, Value );
@@ -88,5 +88,5 @@ void ANetNodeInstance::setAttribute( QString & Attr, QString & Value ){
void ANetNodeInstance::saveAttributes( QTextStream & TS ) {
- TS << "name=" << quote( NodeName ) << endl;
+ TS << "name=" << name() << endl;
saveSpecificAttribute( TS );
}
@@ -181,5 +181,5 @@ void NodeCollection::save( QTextStream & TS ) {
++it ) {
NNI = it.current();
- TS << "node=" << quote( NNI->nodeName() ) << endl;
+ TS << "node=" << NNI->name() << endl;
}
TS << endl;
@@ -234,5 +234,5 @@ int NodeCollection::compareItems( QCollection::Item I1,
NNI1 = (ANetNodeInstance *)I1;
NNI2 = (ANetNodeInstance *)I2;
- return NNI1->nodeName().compare( NNI2->nodeName() );
+ return strcmp( NNI1->name(), NNI2->name() );
}
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.h b/noncore/settings/networksettings2/networksettings2/netnode.h
index 6ec9ef6..27d54f8 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.h
+++ b/noncore/settings/networksettings2/networksettings2/netnode.h
@@ -73,5 +73,5 @@ public:
typedef QArray<ANetNode *> NetNodeList;
- ANetNode(){};
+ ANetNode( const char * Name ) : QObject( 0, Name ) {}
virtual ~ANetNode(){};
@@ -79,7 +79,4 @@ public:
virtual const QString pixmapName() = 0;
- // name of this NetNode
- virtual const QString nodeName() = 0;
-
// description for this NetNode
virtual const QString nodeDescription() = 0;
@@ -185,9 +182,4 @@ public:
{ return IsNew; }
- // return logical name of this instance
- QString & nodeName( void )
- { return NodeName; }
- void setNodeName( const QString & S )
- { NodeName = S; }
// return description for this instance
QString & description( void )
@@ -226,5 +218,4 @@ protected :
// connection to which this node belongs to
NodeCollection * Connection;
- QString NodeName;
QString Description;
bool IsModified;
@@ -257,4 +248,6 @@ public :
virtual bool handlesInterface( const QString & )
{ return 0; }
+ virtual bool handlesInterface( const InterfaceInfo & )
+ { return 0; }
virtual InterfaceInfo * assignedInterface( void );
virtual AsDevice * device( void );
diff --git a/noncore/settings/networksettings2/networksettings2/resources.cpp b/noncore/settings/networksettings2/networksettings2/resources.cpp
index e6ce2b7..4b7a62f 100644
--- a/noncore/settings/networksettings2/networksettings2/resources.cpp
+++ b/noncore/settings/networksettings2/networksettings2/resources.cpp
@@ -168,5 +168,6 @@ bool TheNSResources::loadNetNode(
// store mapping
- AllNodeTypes.insert( NN->NetNode->nodeName(), NN );
+ printf( "Store %s\n", NN->NetNode->name() );
+ AllNodeTypes.insert( NN->NetNode->name(), NN );
}
@@ -177,5 +178,4 @@ QPixmap TheNSResources::getPixmap( const QString & QS ) {
QString S("networksettings2/");
S += QS;
- printf( " pixmap %s\n", S.latin1() );
return Resource::loadPixmap( QString("networksettings2/")+QS );
}
@@ -201,5 +201,5 @@ void TheNSResources::addConnection( NodeCollection * NC ) {
++it ) {
NNI = it.current();
- if( findNodeInstance( NNI->nodeName() ) == 0 ) {
+ if( findNodeInstance( NNI->name() ) == 0 ) {
// new item
addNodeInstance( NNI );
@@ -216,5 +216,5 @@ void TheNSResources::removeConnection( const QString & N ) {
ANetNodeInstance * NNI;
for( NNI = NC->first(); NNI != 0; NNI = NC->next() ) {
- removeNodeInstance( NNI->nodeName() );
+ removeNodeInstance( NNI->name() );
}
ConnectionsMap.remove( N );
diff --git a/noncore/settings/networksettings2/networksettings2/resources.h b/noncore/settings/networksettings2/networksettings2/resources.h
index 7050f10..3d6a44f 100644
--- a/noncore/settings/networksettings2/networksettings2/resources.h
+++ b/noncore/settings/networksettings2/networksettings2/resources.h
@@ -80,5 +80,5 @@ public :
{ return AllNodes; }
void addNodeInstance( ANetNodeInstance * I )
- { AllNodes.insert( I->nodeName(), I ); }
+ { AllNodes.insert( I->name(), I ); }
void removeNodeInstance( const QString & N )
{ AllNodes.remove( N );}
diff --git a/noncore/settings/networksettings2/networksettings2/systemfile.cpp b/noncore/settings/networksettings2/networksettings2/systemfile.cpp
index 62bb6af..b3fc1a5 100644
--- a/noncore/settings/networksettings2/networksettings2/systemfile.cpp
+++ b/noncore/settings/networksettings2/networksettings2/systemfile.cpp
@@ -125,5 +125,5 @@ bool SystemFile::preNodeSection( ANetNodeInstance * NNI, long ) {
while( ! TX.eof() ) {
Out = S.
- arg(NNI->nodeClass()->nodeName());
+ arg(NNI->nodeClass()->name());
(*this) << Out << endl;
S = TX.readLine();
@@ -143,5 +143,5 @@ bool SystemFile::postNodeSection( ANetNodeInstance * NNI, long ) {
while( ! TX.eof() ) {
Out = S.
- arg(NNI->nodeName());
+ arg(NNI->name());
(*this) << Out << endl;
S = TX.readLine();
@@ -160,5 +160,5 @@ bool SystemFile::preDeviceSection( ANetNode * NN ) {
QString S = TX.readLine();
while( ! TX.eof() ) {
- Out = S.arg(NN->nodeName());
+ Out = S.arg(NN->name());
(*this) << Out << endl;
S = TX.readLine();
@@ -177,5 +177,5 @@ bool SystemFile::postDeviceSection( ANetNode * NN ) {
QString S = TX.readLine();
while( ! TX.eof() ) {
- Out = S.arg(NN->nodeName());
+ Out = S.arg(NN->name());
(*this) << Out << endl;
S = TX.readLine();
diff --git a/noncore/settings/networksettings2/nsdata.cpp b/noncore/settings/networksettings2/nsdata.cpp
index 13979ce..64b83f7 100644
--- a/noncore/settings/networksettings2/nsdata.cpp
+++ b/noncore/settings/networksettings2/nsdata.cpp
@@ -16,5 +16,5 @@ NetworkSettingsData::NetworkSettingsData( void ) {
new TheNSResources();
- CfgFile.sprintf( "%s/NETCONFIG",
+ CfgFile.sprintf( "%s/Settings/NS2.conf",
NSResources->currentUser().HomeDir.latin1() );
fprintf( stderr, "Cfg from %s\n", CfgFile.latin1() );
@@ -76,15 +76,21 @@ void NetworkSettingsData::loadSettings( void ) {
ANetNodeInstance* NNI = 0;
if( S.startsWith( "nodetype " ) ) {
- S = S.mid( 9, S.length()-9-1 );
- fprintf( stderr, "Node %s\n", S.latin1() );
+ S = S.mid( 9, S.length()-9 );
+ S = deQuote(S);
// try to find netnode
NN = NSResources->findNetNode( S );
+ fprintf( stderr, "Node %s : %p\n", S.latin1(), NN );
} else {
// try to find instance
NNI = NSResources->createNodeInstance( S );
+ fprintf( stderr, "NodeInstance %s : %p\n", S.latin1(), NNI );
+ }
+
+ if( NN == 0 && NNI == 0 ) {
+ LeftOvers.append( Line );
}
do {
- S = TS.readLine();
+ S = Line = TS.readLine();
if( NN || NNI ) {
@@ -110,5 +116,5 @@ void NetworkSettingsData::loadSettings( void ) {
if( NN ) {
// set the attribute
- NNI->setAttribute( Attr, Value );
+ NN->setAttribute( Attr, Value );
} else {
// set the attribute
@@ -124,4 +130,5 @@ void NetworkSettingsData::loadSettings( void ) {
}
} while( 1 );
+
if( NNI ) {
// loading from file -> exists
@@ -167,9 +174,10 @@ QString NetworkSettingsData::saveSettings( void ) {
++it ) {
TS << "[nodetype "
- << it.current()->NetNode->name()
+ << quote( QString( it.current()->NetNode->name() ) )
<< "]"
<< endl;
it.current()->NetNode->saveAttributes( TS );
+ TS << endl;
}
@@ -187,5 +195,8 @@ QString NetworkSettingsData::saveSettings( void ) {
// header
NNI = nit.current();
- TS << '[' <<NNI->nodeClass()->nodeName() << ']' << endl;
+ TS << '['
+ << QString(NNI->nodeClass()->name())
+ << ']'
+ << endl;
NNI->saveAttributes( TS );
TS << endl;
@@ -296,5 +307,5 @@ QString NetworkSettingsData::generateSettings( bool ForceReq ) {
S = qApp->translate( "NetworkSettings",
"<p>Cannot generate files proper to \"%1\"</p>" ).
- arg(NNI->nodeClass()->nodeName()) ;
+ arg(NNI->nodeClass()->name()) ;
return S;
}
@@ -391,10 +402,9 @@ QList<NodeCollection> NetworkSettingsData::collectPossible( const char * Interfa
NC = it.current();
// check if this profile handles the requested interface
- fprintf( stderr, "check %s\n", NC->name().latin1() );
if( NC->handlesInterface( Interface ) && // if different Intf.
NC->state() != Disabled && // if not enabled
NC->state() != IsUp // if already used
) {
- fprintf( stderr, "Append %s\n", NC->name().latin1() );
+ fprintf( stderr, "Append %s for %s\n", NC->name().latin1(), Interface);
PossibleConnections.append( NC );
}
@@ -487,5 +497,5 @@ QString NetworkSettingsData::generateSystemFileNode(
"<p>Error in preDeviceSection for file \"%1\" and nodetype \"%2\"</p>" ).
arg( SF.name() ).
- arg( CurDevNN->nodeName() );
+ arg( CurDevNN->name() );
return S;
}
@@ -496,14 +506,9 @@ QString NetworkSettingsData::generateSystemFileNode(
"<p>Error in node Device part for file \"%1\" and node \"%2\"</p>" ).
arg( SF.name() ).
- arg( CurDevNN->nodeName() );
+ arg( CurDevNN->name() );
return S;
}
}
- if( CurDev )
- fprintf( stderr, "Cur %s\n", CurDevNN->nodeName().latin1() );
- else
- fprintf( stderr, "Cur NO\n" );
-
// now generate profile specific data for all
// connections working on a device of the current
@@ -518,9 +523,7 @@ QString NetworkSettingsData::generateSystemFileNode(
AsDevice * Dev = NC->device();
- fprintf( stderr, "%s\n", Dev->netNode()->nodeName().latin1() );
if( CurDev ) {
if( CurDevNN != Dev->netNode()->nodeClass() ) {
// other device type -> later
- fprintf( stderr, "Other Dev type\n" );
continue;
}
@@ -537,5 +540,5 @@ QString NetworkSettingsData::generateSystemFileNode(
"<p>Error in preNodeSection for file \"%1\" and node \"%2\"</p>" ).
arg( SF.name() ).
- arg( CurDevNN->nodeName() );
+ arg( CurDevNN->name() );
return S;
}
@@ -552,5 +555,5 @@ QString NetworkSettingsData::generateSystemFileNode(
"<p>Error in node part for file \"%1\" and node \"%2\"</p>" ).
arg( SF.name() ).
- arg( NNI->nodeClass()->nodeName() );
+ arg( NNI->nodeClass()->name() );
return S;
}
@@ -562,5 +565,5 @@ QString NetworkSettingsData::generateSystemFileNode(
"<p>Error in postNodeSection for file \"%1\" and node \"%2\"</p>" ).
arg( SF.name() ).
- arg( CurDevNN->nodeName() );
+ arg( CurDevNN->name() );
return S;
}
@@ -572,5 +575,5 @@ QString NetworkSettingsData::generateSystemFileNode(
"<p>Error in postDeviceSection for file \"%1\" and node \"%2\"</p>" ).
arg( SF.name() ).
- arg( CurDevNN->nodeName() );
+ arg( CurDevNN->name() );
return S;
}
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.cpp b/noncore/settings/networksettings2/ppp/ppp_NN.cpp
index 0bf415b..208c7c2 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NN.cpp
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.cpp
@@ -11,5 +11,5 @@ static const char * PPPNeeds[] =
* Constructor, find all of the possible interfaces
*/
-PPPNetNode::PPPNetNode() : ANetNode() {
+PPPNetNode::PPPNetNode() : ANetNode(tr("PPP Connection")) {
}
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.h b/noncore/settings/networksettings2/ppp/ppp_NN.h
index fbbbbe1..b1483c4 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NN.h
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.h
@@ -18,7 +18,4 @@ public:
{ return "Devices/ppp"; }
- virtual const QString nodeName()
- { return tr("PPP Connection"); }
-
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/profile/profile_NN.cpp b/noncore/settings/networksettings2/profile/profile_NN.cpp
index 0f71dc7..d06b7ef 100644
--- a/noncore/settings/networksettings2/profile/profile_NN.cpp
+++ b/noncore/settings/networksettings2/profile/profile_NN.cpp
@@ -10,5 +10,5 @@ static const char * ProfileNeeds[] =
* Constructor, find all of the possible interfaces
*/
-ProfileNetNode::ProfileNetNode() : ANetNode() {
+ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular profile")) {
}
diff --git a/noncore/settings/networksettings2/profile/profile_NN.h b/noncore/settings/networksettings2/profile/profile_NN.h
index 1313ab2..e602bd7 100644
--- a/noncore/settings/networksettings2/profile/profile_NN.h
+++ b/noncore/settings/networksettings2/profile/profile_NN.h
@@ -18,7 +18,4 @@ public:
{ return "Devices/commprofile"; }
- virtual const QString nodeName()
- { return tr("Regular profile"); }
-
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/usb/usb_NN.cpp b/noncore/settings/networksettings2/usb/usb_NN.cpp
index d5971cf..9101490 100644
--- a/noncore/settings/networksettings2/usb/usb_NN.cpp
+++ b/noncore/settings/networksettings2/usb/usb_NN.cpp
@@ -9,5 +9,5 @@ static const char * USBNeeds[] =
* Constructor, find all of the possible interfaces
*/
-USBNetNode::USBNetNode() : ANetNode() {
+USBNetNode::USBNetNode() : ANetNode(tr("USB Cable Connect")) {
}
diff --git a/noncore/settings/networksettings2/usb/usb_NN.h b/noncore/settings/networksettings2/usb/usb_NN.h
index 0b83ea6..fea89f0 100644
--- a/noncore/settings/networksettings2/usb/usb_NN.h
+++ b/noncore/settings/networksettings2/usb/usb_NN.h
@@ -18,7 +18,4 @@ public:
{ return "Devices/usb"; }
- virtual const QString nodeName()
- { return tr("USB Cable Connect"); }
-
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.cpp b/noncore/settings/networksettings2/vpn/vpn_NN.cpp
index 307e9dd..bfc30f9 100644
--- a/noncore/settings/networksettings2/vpn/vpn_NN.cpp
+++ b/noncore/settings/networksettings2/vpn/vpn_NN.cpp
@@ -10,5 +10,5 @@ static const char * VPNNeeds[] =
* Constructor, find all of the possible interfaces
*/
-VPNNetNode::VPNNetNode() : ANetNode() {
+VPNNetNode::VPNNetNode() : ANetNode(tr("VPN Connection")) {
}
diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.h b/noncore/settings/networksettings2/vpn/vpn_NN.h
index 1cd3fcc..5b6632e 100644
--- a/noncore/settings/networksettings2/vpn/vpn_NN.h
+++ b/noncore/settings/networksettings2/vpn/vpn_NN.h
@@ -18,7 +18,4 @@ public:
{ return "Devices/vpn"; }
- virtual const QString nodeName()
- { return tr("VPN Connection"); }
-
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.cpp b/noncore/settings/networksettings2/wlan/wlan_NN.cpp
index e0c4db2..7a2c1a7 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NN.cpp
+++ b/noncore/settings/networksettings2/wlan/wlan_NN.cpp
@@ -9,5 +9,5 @@ static const char * WLanNeeds[] =
* Constructor, find all of the possible interfaces
*/
-WLanNetNode::WLanNetNode() : ANetNode() {
+WLanNetNode::WLanNetNode() : ANetNode(tr("WLan Device")) {
InstanceCount = 2;
}
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.h b/noncore/settings/networksettings2/wlan/wlan_NN.h
index e93a89a..b5ff3fd 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NN.h
+++ b/noncore/settings/networksettings2/wlan/wlan_NN.h
@@ -18,7 +18,4 @@ public:
{ return "Devices/wlan"; }
- virtual const QString nodeName()
- { return tr("WLan Device"); }
-
virtual const QString nodeDescription() ;