summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/config.in22
-rw-r--r--noncore/settings/networksettings2/editconnection.cpp582
-rw-r--r--noncore/settings/networksettings2/editconnection.h49
-rw-r--r--noncore/settings/networksettings2/editconnectionGUI.ui406
-rw-r--r--noncore/settings/networksettings2/main.cpp96
-rw-r--r--noncore/settings/networksettings2/network/config.in4
-rw-r--r--noncore/settings/networksettings2/network/network.pro18
-rw-r--r--noncore/settings/networksettings2/network/networkGUI.ui1071
-rw-r--r--noncore/settings/networksettings2/network/network_NN.cpp64
-rw-r--r--noncore/settings/networksettings2/network/network_NN.h44
-rw-r--r--noncore/settings/networksettings2/network/network_NNI.cpp170
-rw-r--r--noncore/settings/networksettings2/network/network_NNI.h45
-rw-r--r--noncore/settings/networksettings2/network/networkdata.h22
-rw-r--r--noncore/settings/networksettings2/network/networkedit.cpp160
-rw-r--r--noncore/settings/networksettings2/network/networkedit.h21
-rw-r--r--noncore/settings/networksettings2/network/networkrun.cpp63
-rw-r--r--noncore/settings/networksettings2/network/networkrun.h20
-rw-r--r--noncore/settings/networksettings2/networksettings.cpp820
-rw-r--r--noncore/settings/networksettings2/networksettings.h77
-rw-r--r--noncore/settings/networksettings2/networksettings.pro16
-rw-r--r--noncore/settings/networksettings2/networksettings2/GUIUtils.cpp27
-rw-r--r--noncore/settings/networksettings2/networksettings2/GUIUtils.h36
-rw-r--r--noncore/settings/networksettings2/networksettings2/asconnection.h18
-rw-r--r--noncore/settings/networksettings2/networksettings2/asdevice.h37
-rw-r--r--noncore/settings/networksettings2/networksettings2/asfullsetup.h20
-rw-r--r--noncore/settings/networksettings2/networksettings2/asline.h18
-rw-r--r--noncore/settings/networksettings2/networksettings2/config.in4
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.cpp278
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.h361
-rw-r--r--noncore/settings/networksettings2/networksettings2/networksettings2.pro26
-rw-r--r--noncore/settings/networksettings2/networksettings2/resources.cpp236
-rw-r--r--noncore/settings/networksettings2/networksettings2/resources.h105
-rw-r--r--noncore/settings/networksettings2/networksettings2/system.cpp318
-rw-r--r--noncore/settings/networksettings2/networksettings2/system.h76
-rw-r--r--noncore/settings/networksettings2/networksettings2/systemfile.cpp144
-rw-r--r--noncore/settings/networksettings2/networksettings2/systemfile.h39
-rw-r--r--noncore/settings/networksettings2/networksettingsGUI.ui598
-rw-r--r--noncore/settings/networksettings2/networktemplates/interfaces/presection5
-rw-r--r--noncore/settings/networksettings2/opie-networksettings.control10
-rw-r--r--noncore/settings/networksettings2/ppp/PPPAuthGUI.ui432
-rw-r--r--noncore/settings/networksettings2/ppp/PPPAuthedit.cpp85
-rw-r--r--noncore/settings/networksettings2/ppp/PPPAuthedit.h15
-rw-r--r--noncore/settings/networksettings2/ppp/PPPDNSGUI.ui340
-rw-r--r--noncore/settings/networksettings2/ppp/PPPDNSedit.cpp108
-rw-r--r--noncore/settings/networksettings2/ppp/PPPDNSedit.h20
-rw-r--r--noncore/settings/networksettings2/ppp/PPPGUI.ui103
-rw-r--r--noncore/settings/networksettings2/ppp/PPPIPGUI.ui444
-rw-r--r--noncore/settings/networksettings2/ppp/PPPIPedit.cpp57
-rw-r--r--noncore/settings/networksettings2/ppp/PPPIPedit.h15
-rw-r--r--noncore/settings/networksettings2/ppp/PPPedit.cpp48
-rw-r--r--noncore/settings/networksettings2/ppp/PPPedit.h27
-rw-r--r--noncore/settings/networksettings2/ppp/config.in4
-rw-r--r--noncore/settings/networksettings2/ppp/ppp.pro24
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.cpp62
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.h44
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NNI.cpp115
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NNI.h43
-rw-r--r--noncore/settings/networksettings2/ppp/pppdata.h38
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.cpp77
-rw-r--r--noncore/settings/networksettings2/profile/config.in4
-rw-r--r--noncore/settings/networksettings2/profile/profile.pro18
-rw-r--r--noncore/settings/networksettings2/profile/profileGUI.ui1715
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.cpp61
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.h44
-rw-r--r--noncore/settings/networksettings2/profile/profile_NNI.cpp48
-rw-r--r--noncore/settings/networksettings2/profile/profile_NNI.h45
-rw-r--r--noncore/settings/networksettings2/profile/profiledata.h15
-rw-r--r--noncore/settings/networksettings2/profile/profileedit.cpp93
-rw-r--r--noncore/settings/networksettings2/profile/profileedit.h29
-rw-r--r--noncore/settings/networksettings2/profile/profilerun.cpp67
-rw-r--r--noncore/settings/networksettings2/profile/profilerun.h28
-rwxr-xr-xnoncore/settings/networksettings2/setmacaddress.sh4
-rw-r--r--noncore/settings/networksettings2/usb/config.in4
-rw-r--r--noncore/settings/networksettings2/usb/usb.pro18
-rw-r--r--noncore/settings/networksettings2/usb/usbGUI.ui57
-rw-r--r--noncore/settings/networksettings2/usb/usb_NN.cpp60
-rw-r--r--noncore/settings/networksettings2/usb/usb_NN.h44
-rw-r--r--noncore/settings/networksettings2/usb/usb_NNI.cpp46
-rw-r--r--noncore/settings/networksettings2/usb/usb_NNI.h44
-rw-r--r--noncore/settings/networksettings2/usb/usbdata.h8
-rw-r--r--noncore/settings/networksettings2/usb/usbedit.cpp17
-rw-r--r--noncore/settings/networksettings2/usb/usbedit.h12
-rw-r--r--noncore/settings/networksettings2/usb/usbrun.cpp171
-rw-r--r--noncore/settings/networksettings2/usb/usbrun.h38
-rw-r--r--noncore/settings/networksettings2/vpn/config.in4
-rw-r--r--noncore/settings/networksettings2/vpn/vpn.pro18
-rw-r--r--noncore/settings/networksettings2/vpn/vpnGUI.cpp76
-rw-r--r--noncore/settings/networksettings2/vpn/vpnGUI.h43
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NN.cpp61
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NN.h44
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NNI.cpp30
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NNI.h43
-rw-r--r--noncore/settings/networksettings2/vpn/vpndata.h16
-rw-r--r--noncore/settings/networksettings2/vpn/vpnedit.cpp18
-rw-r--r--noncore/settings/networksettings2/vpn/vpnedit.h12
-rw-r--r--noncore/settings/networksettings2/vpn/vpnrun.cpp6
-rw-r--r--noncore/settings/networksettings2/vpn/vpnrun.h30
-rw-r--r--noncore/settings/networksettings2/wlan/wlan.pro18
-rw-r--r--noncore/settings/networksettings2/wlan/wlanGUI.cpp360
-rw-r--r--noncore/settings/networksettings2/wlan/wlanGUI.h96
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NN.cpp60
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NN.h44
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NNI.cpp30
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NNI.h43
-rw-r--r--noncore/settings/networksettings2/wlan/wlandata.h17
-rw-r--r--noncore/settings/networksettings2/wlan/wlanedit.cpp16
-rw-r--r--noncore/settings/networksettings2/wlan/wlanedit.h12
-rw-r--r--noncore/settings/networksettings2/wlan/wlanrun.cpp5
-rw-r--r--noncore/settings/networksettings2/wlan/wlanrun.h42
109 files changed, 12061 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/config.in b/noncore/settings/networksettings2/config.in
new file mode 100644
index 0000000..37ce9cf
--- a/dev/null
+++ b/noncore/settings/networksettings2/config.in
@@ -0,0 +1,22 @@
+config NS2
+ boolean "opie-networksettings-2 (TCP/IP network settings)"
+ default "y"
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE
+
+config NS2CORE
+ boolean
+ default "y" if NS2
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2
+
+ source noncore/settings/networksettings2/profile/config.in
+ source noncore/settings/networksettings2/network/config.in
+ source noncore/settings/networksettings2/lancard/config.in
+ source noncore/settings/networksettings2/ppp/config.in
+ source noncore/settings/networksettings2/wlan/config.in
+ source noncore/settings/networksettings2/usb/config.in
+ source noncore/settings/networksettings2/irda/config.in
+ source noncore/settings/networksettings2/vpn/config.in
+ source noncore/settings/networksettings2/bluetooth/config.in
+ source noncore/settings/networksettings2/cable/config.in
+ source noncore/settings/networksettings2/modem/config.in
+ source noncore/settings/networksettings2/networksettings2/config.in
diff --git a/noncore/settings/networksettings2/editconnection.cpp b/noncore/settings/networksettings2/editconnection.cpp
new file mode 100644
index 0000000..d4b2bb3
--- a/dev/null
+++ b/noncore/settings/networksettings2/editconnection.cpp
@@ -0,0 +1,582 @@
+#include <qlistview.h>
+#include <qwidgetstack.h>
+#include <qframe.h>
+#include <qcombobox.h>
+#include <qtabwidget.h>
+#include <qmessagebox.h>
+#include <qpushbutton.h>
+#include <qlineedit.h>
+#include <qheader.h>
+#include <qpainter.h>
+#include <qcheckbox.h>
+#include <qlabel.h>
+
+#include "editconnection.h"
+#include "resources.h"
+#include "netnode.h"
+
+//
+//
+// THESE TO GIVE BETTER FEEDBACK ABOUT DISABLED ITEMS
+//
+//
+
+class MyQCheckListItem : public QCheckListItem
+{
+public:
+ MyQCheckListItem( QListView *parent, const QString & S, Type T ) :
+ QCheckListItem( parent, S, T ) { }
+ MyQCheckListItem( QCheckListItem *parent, const QString & S, Type T ) :
+ QCheckListItem( parent, S, T ) { }
+ MyQCheckListItem( QListViewItem *parent, const QString & S, Type T ) :
+ QCheckListItem( parent, S, T ) { }
+
+ virtual void paintCell( QPainter *p, const QColorGroup &cg,
+ int column, int width, int alignment );
+
+};
+
+void MyQCheckListItem::paintCell( QPainter *p, const QColorGroup &cg,
+ int column, int width, int alignment )
+{
+ QColorGroup _cg( cg );
+ QColor c = _cg.text();
+ if ( ! isSelectable() )
+ _cg.setColor( QColorGroup::Text, Qt::lightGray );
+ QCheckListItem::paintCell( p, _cg, column, width, alignment );
+ _cg.setColor( QColorGroup::Text, c );
+}
+
+class MyQListViewItem : public QListViewItem
+{
+public:
+ MyQListViewItem( QListView *parent, const QString & S ) :
+ QListViewItem( parent, S ) { }
+ MyQListViewItem( QListViewItem *parent, const QString & S ) :
+ QListViewItem( parent, S ) { }
+
+ virtual void paintCell( QPainter *p, const QColorGroup &cg,
+ int column, int width, int alignment );
+
+};
+
+void MyQListViewItem::paintCell( QPainter *p, const QColorGroup &cg,
+ int column, int width, int alignment )
+{
+ QColorGroup _cg( cg );
+ QColor c = _cg.text();
+ if ( ! isSelectable() )
+ _cg.setColor( QColorGroup::Text, Qt::lightGray );
+ QListViewItem::paintCell( p, _cg, column, width, alignment );
+ _cg.setColor( QColorGroup::Text, c );
+}
+
+//
+//
+// REAL GUI
+//
+//
+
+bool EditConnection::AutoCollapse = 1;
+
+EditConnection::EditConnection( QWidget* parent ) :
+ EditConnectionGUI( 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 ) {
+
+ if( TmpIsValid )
+ // content is stil OK
+ return &(TmpCollection);
+
+ // reset collection -> delete all NEW NetNodes
+ { ANetNodeInstance * NNI;
+ for( QListIterator<ANetNodeInstance> it(TmpCollection);
+ it.current();
+ ++it ) {
+ if( it.current()->isNew() ) {
+ delete it.current();
+ }
+ }
+ TmpCollection.clear();
+ }
+
+ // update content
+ QListViewItem * it = Nodes_LV->firstChild();
+ ANetNode * NN;
+ // start iter
+ ANetNodeInstance * NNI =
+ (SelectedNodes) ? SelectedNodes->first() : 0 ;
+
+ TmpCollection.setModified( 0 );
+
+ while ( it ) {
+ NN = (*Mapping)[it];
+ if( NN == 0 ) {
+ // child is controller -> has sub radio
+ // check if one radio is selected
+ it = it->firstChild();
+ while( it ) {
+ if( ((QCheckListItem *)it)->isOn() ) {
+ // this radio is selected -> go deeper
+ if( SelectedNodes == 0 ||
+ NNI == 0 ||
+ NNI->netNode()->nodeName() != it->text(0) ) {
+ // new item not in previous collection
+ ANetNodeInstance * NNI = (*Mapping)[it]->createInstance();
+ NNI->initialize();
+ // this node type not in collection
+ TmpCollection.append( NNI );
+ // master collection changed because new item in it
+ TmpCollection.setModified( 1 );
+ // no more valid items in old list
+ NNI = 0;
+ } else {
+ // already in list -> copy pointer
+ TmpCollection.append( NNI );
+ NNI = SelectedNodes->next();
+ }
+ it = it->firstChild();
+ // do not bother to check other items
+ break;
+ }
+ it = it->nextSibling();
+ }
+ } else {
+ // check children
+ it = it->firstChild();
+ }
+ }
+
+ TmpIsValid = 1;
+ return &(TmpCollection);
+}
+
+// pass a connection NodeCollection to be edited
+void EditConnection::setConnection( NodeCollection * NC ) {
+ ANetNodeInstance * NNI;
+ ANetNode * NN;
+
+ SelectedNodes = NC;
+ Name_LE->setText( NC->name() );
+ NNI = NC->first();
+
+ // show configure tabl
+ Tab_TB->setCurrentPage( 1 );
+
+ // valid colledction
+ Tab_TB->setTabEnabled( Setup_FRM, FALSE );
+ Setup_FRM->setEnabled( FALSE );
+
+ // select items in collection
+ QListViewItem * it = Nodes_LV->firstChild();
+ bool Found;
+
+ TmpIsValid = 0;
+
+ while ( it ) {
+ // listitem corresponds to netnode
+ NN = (*Mapping)[it];
+ if( NN == 0 ) {
+ // child is controller -> has sub radio
+ QString Ctr = it->text(0);
+ // check if one radio is selected
+ it = it->firstChild();
+ Found = 0;
+ while( it ) {
+ if( NNI && NNI->netNode()->nodeName() == it->text(0) ) {
+ // this radio is part of the collection
+ ((QCheckListItem *)it)->setOn( 1 );
+ updateGUI( it, NNI->netNode() );
+ // check its children
+ Found = 1;
+ it = it->firstChild();
+ NNI = SelectedNodes->next();
+ // do not bother to check other items
+ break;
+ }
+ 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>" ).
+ arg(Ctr) );
+ return;
+ }
+ } else {
+ // automatic item -> check children
+ it = it->firstChild();
+ }
+ }
+}
+
+// get result of editing (either new OR updated collection
+NodeCollection * EditConnection::connection( void ) {
+
+ if( SelectedNodes == 0 ) {
+ // new collection
+ SelectedNodes = new NodeCollection;
+ }
+
+ // clean out old entries
+ SelectedNodes->clear();
+
+ // transfer
+ { ANetNodeInstance * NNI;
+
+ for( QListIterator<ANetNodeInstance> it(TmpCollection);
+ it.current();
+ ++it ) {
+ SelectedNodes->append( it.current() );
+ }
+ }
+
+ if( TmpCollection.isModified() )
+ SelectedNodes->setModified( 1 );
+
+ if( SelectedNodes->name() != Name_LE->text() ) {
+ SelectedNodes->setName( Name_LE->text() );
+ SelectedNodes->setModified( 1 );
+ }
+
+ return SelectedNodes;
+}
+
+// Build device tree -> start
+void EditConnection::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 care toplevel nodes -> ie provide
+ // TCP/IP Connection
+ for( QDictIterator<NetNode_t> Iter(NSResources->netNodes());
+ Iter.current();
+ ++Iter ) {
+
+ NN = Iter.current()->NetNode;
+
+ if( ! NN->isToplevel() ) {
+ continue;
+ }
+
+ MyQCheckListItem * it = new MyQCheckListItem( TheTop,
+ NN->nodeName(),
+ QCheckListItem::RadioButton );
+ it->setPixmap( 0, NSResources->getPixmap( "commprofile" ) );
+ // 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 ) {
+ ANetNode::NetNodeList & NNL = NN->alternatives();
+
+ if( NNL.size() > 1 ) {
+ // this node has alternatives -> needs radio buttons
+ it = new MyQCheckListItem(
+ it,
+ NSResources->netNode2Name(NNL[0]->provides()),
+ QCheckListItem::Controller );
+ it->setSelectable( FALSE );
+ }
+
+ for ( unsigned int i=0; i < NNL.size(); i++ ) {
+ QListViewItem * CI;
+ if( NNL.size() > 1 ) {
+ // generate radio buttons
+ CI = new MyQCheckListItem(
+ (QCheckListItem *)it,
+ NNL[i]->nodeName(), QCheckListItem::RadioButton );
+ // remember that this node maps to this listitem
+ CI->setPixmap( 0, NSResources->getPixmap( NNL[i]->pixmapName() ) );
+ Mapping->insert( CI, NNL[i] );
+ CI->setSelectable( FALSE );
+ } else {
+ // Single item
+ CI = new MyQListViewItem( it, NNL[i]->nodeName() );
+ // remember that this node maps to this listitem
+ Mapping->insert( CI, NNL[i] );
+ CI->setSelectable( FALSE );
+ CI->setPixmap( 0, NSResources->getPixmap( NNL[i]->pixmapName() ) );
+ }
+ buildSubTree( CI, NNL[i] );
+ }
+}
+
+// Clicked ok OK button
+void EditConnection::accept( void ) {
+ if( ! haveCompleteConfig( 0 ) || Name_LE->text().isEmpty() ) {
+ QMessageBox::warning(
+ 0,
+ tr( "Closing Connection Setup" ),
+ tr( "Definition not complete or no name" ) );
+ return;
+ }
+
+ // check if all devices have acceptable input
+ getTmpCollection();
+ { ANetNodeInstance * NNI;
+ QString S;
+
+ for( QListIterator<ANetNodeInstance> it(TmpCollection);
+ it.current();
+ ++it ) {
+ NNI = it.current();
+ // widget must show its own problems
+ S = NNI->acceptable();
+ if( ! S.isEmpty() ) {
+ QMessageBox::warning(
+ 0,
+ tr( "Cannot save" ),
+ S );
+ return;
+ }
+ NNI->commit();
+
+ if( NNI->isModified() ) {
+ TmpCollection.setModified( 1 );
+ // commit the data
+ }
+ }
+ }
+
+ QDialog::accept();
+}
+
+// triggered by CB
+void EditConnection::SLOT_AutoCollapse( bool b ) {
+ AutoCollapse = b;
+}
+
+// clicked on node in tree -> update GUI
+void EditConnection::SLOT_SelectNode( QListViewItem * it ) {
+ ANetNode * NN;
+ if( it == 0 || it->depth() == 0 ) {
+ Description_LBL->setText(
+ NSResources->netNode2Description( "fullsetup" ) );
+ // topevel or no selection
+ return;
+ }
+
+ // store conversion from lvitem to node
+ NN = (*Mapping)[ it ];
+
+ if( ! NN ) {
+ // intermediate node
+ NN = (*Mapping)[ it->firstChild() ];
+ if( NN ) {
+ // figure out type of this node -> produce mesage
+ Description_LBL->setText( NSResources->netNode2Description(NN->provides()) );
+ } else {
+ Description_LBL->setText( "" );
+ }
+ return;
+ }
+
+ Description_LBL->setText( NN->nodeDescription() );
+
+ if( ! it->isSelectable() ) {
+ return;
+ }
+
+ if( ! ((QCheckListItem *)it)->isOn() ) {
+ // clicked on line but NOT on Check or Radio item
+ return;
+ }
+
+ // item has really changed -> update
+ TmpIsValid = 0;
+ updateGUI( it, NN );
+}
+
+// cliecked on TAB to go to setup
+void EditConnection::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
+ { QWidget * W;
+ int i = 0;
+
+ Devices_CB->clear();
+ while( ( W = Setup_WS->widget( i ) ) ) {
+ Setup_WS->removeWidget( W );
+ i ++;
+ }
+ }
+
+ // update CB
+ // and populate WidgetStack
+ { ANetNodeInstance * NNI;
+ QListIterator<ANetNodeInstance> it(TmpCollection);
+ int i = 0;
+ QWidget * W;
+
+ for ( ; it.current(); ++it ) {
+ NNI = it.current();
+ Devices_CB->insertItem(
+ NSResources->getPixmap( NNI->netNode()->pixmapName() ),
+ NNI->netNode()->nodeName()
+ );
+
+ // add edit widget
+ W = NNI->edit( Setup_WS );
+ if( ! W) {
+ W = new QLabel( Setup_WS,
+ tr("No configuration required"));
+ }
+ Setup_WS->addWidget( W , i );
+ i ++;
+ }
+ }
+ Setup_WS->raiseWidget( 0 );
+ } // still valid
+ }
+}
+
+// update visual feedback of selection state
+void EditConnection::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 ) {
+ if ( Sbl != it ) {
+ disableTree( Sbl->firstChild(), FALSE );
+ Sbl->setSelectable( TRUE );
+ if( AutoCollapse )
+ Sbl->setOpen( FALSE );
+ }
+ Sbl = Sbl->nextSibling();
+ }
+
+ // 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 ) {
+ 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 ) {
+ 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 );
+ if( AutoCollapse && ! doOn )
+ it->setOpen( doOn );
+ if( doOn ) {
+ // selected alternative
+ enablePath( it->firstChild(),
+ NN->alternatives().size() > 1);
+ } else {
+ // non-selected alternative
+ disableTree( it->firstChild(), FALSE);
+ }
+ } else {
+ // we are single subitem
+ it->setSelectable( TRUE );
+ it->setOpen( TRUE );
+ enablePath( it->firstChild(),
+ NN->alternatives().size() > 1);
+ }
+ } else {
+ // controller node
+ it->setSelectable( TRUE );
+ 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 ) {
+ if( it == 0 || ((QCheckListItem *)it)->isOn() ) {
+ // check children
+ it = (it) ? it->firstChild() : Nodes_LV->firstChild() ;
+ while ( it ) {
+ if( ((QCheckListItem *)it)->type() ==
+ QCheckListItem::Controller ) {
+ // child is controller -> has sub radio
+ // check if one radio is selected
+ it = it->firstChild();
+ while( it ) {
+ if( ((QCheckListItem *)it)->isOn() ) {
+ // this radio is selected -> go deeper
+ it = it->firstChild();
+ if( ! it ) {
+ // was deepest level
+ return 1;
+ }
+ // do not bother to check other items
+ break;
+ }
+ it = it->nextSibling();
+ }
+ if( ! it ) {
+ // no radio selected
+ return 0;
+ }
+ } else {
+ // check children
+ it = it->firstChild();
+ }
+ }
+ // deepest level -> all is still OK
+ return 1;
+ } // was not ON
+ return 0;
+}
diff --git a/noncore/settings/networksettings2/editconnection.h b/noncore/settings/networksettings2/editconnection.h
new file mode 100644
index 0000000..e8d7a2c
--- a/dev/null
+++ b/noncore/settings/networksettings2/editconnection.h
@@ -0,0 +1,49 @@
+#include "editconnectionGUI.h"
+
+#include <qptrdict.h>
+#include <qvector.h>
+#include "netnode.h"
+
+class ANetNodeInstance;
+class ANetNode;
+class QListViewItem;
+class NetNodeLVI;
+class QCloseEvent;
+
+class EditConnection : public EditConnectionGUI {
+
+ Q_OBJECT
+
+public :
+
+ EditConnection( QWidget * P );
+
+ ANetNodeInstance * netNodeInstance( void );
+ void setConnection( NodeCollection * NC );
+ NodeCollection * connection( 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 );
+ 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;
+ bool TmpIsValid;
+ NodeCollection TmpCollection;
+
+ static bool AutoCollapse;
+
+};
diff --git a/noncore/settings/networksettings2/editconnectionGUI.ui b/noncore/settings/networksettings2/editconnectionGUI.ui
new file mode 100644
index 0000000..dfb2596
--- a/dev/null
+++ b/noncore/settings/networksettings2/editconnectionGUI.ui
@@ -0,0 +1,406 @@
+<!DOCTYPE UI><UI>
+<class>EditConnectionGUI</class>
+<widget>
+ <class>QDialog</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>EditConnectionGUI</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>427</width>
+ <height>523</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>minimumSize</name>
+ <size>
+ <width>0</width>
+ <height>70</height>
+ </size>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>Edit profile</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QTabWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Tab_TB</cstring>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Device Tree</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <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>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Header_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>MShape</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>MShadow</enum>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Connection profile</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignVCenter|AlignLeft</set>
+ </property>
+ <property>
+ <name>vAlign</name>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Name_LE</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QListView</class>
+ <column>
+ <property>
+ <name>text</name>
+ <string>Column 1</string>
+ </property>
+ <property>
+ <name>clickable</name>
+ <bool>true</bool>
+ </property>
+ <property>
+ <name>resizeable</name>
+ <bool>true</bool>
+ </property>
+ </column>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Nodes_LV</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>minimumSize</name>
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property stdset="1">
+ <name>maximumSize</name>
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property stdset="1">
+ <name>rootIsDecorated</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <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>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>AutoCollapse_CB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Auto collapse</string>
+ </property>
+ <property stdset="1">
+ <name>checked</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Description_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Box</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string></string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignTop|AlignLeft</set>
+ </property>
+ <property>
+ <name>vAlign</name>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Setup</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Setup_FRM</cstring>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Plain</enum>
+ </property>
+ <property stdset="1">
+ <name>lineWidth</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>midLineWidth</name>
+ <number>0</number>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>4</number>
+ </property>
+ <widget>
+ <class>QComboBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Devices_CB</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QWidgetStack</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Setup_WS</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>QWidgetStack</class>
+ <header location="global">qwidgetstack.h</header>
+ <sizehint>
+ <width>-1</width>
+ <height>-1</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>7</hordata>
+ <verdata>7</verdata>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ <slot access="public">raiseWidget( int )</slot>
+ </customwidget>
+</customwidgets>
+<images>
+ <image>
+ <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>
+ <slot>SLOT_SelectNode( QListViewItem *)</slot>
+ </connection>
+ <connection>
+ <sender>AutoCollapse_CB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>EditConnectionGUI</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>
+ <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/main.cpp b/noncore/settings/networksettings2/main.cpp
new file mode 100644
index 0000000..bcef631
--- a/dev/null
+++ b/noncore/settings/networksettings2/main.cpp
@@ -0,0 +1,96 @@
+#include "networksettings.h"
+#include <qpe/qpeapplication.h>
+
+#include <opie/oapplicationfactory.h>
+
+#ifdef GONE
+
+OPIE_EXPORT_APP( OApplicationFactory<NetworkSettings> )
+
+#else
+
+#define ACT_GUI 0
+#define ACT_REQUEST 1
+#define ACT_REGEN 2
+
+int main( int argc, char * argv[] ) {
+ int rv = 0;
+ int Action = ACT_GUI;
+ // could be overruled by -qws
+ QApplication::Type GuiType = QApplication::GuiClient;
+
+#ifdef _WS_QWS_
+ QPEApplication * TheApp;
+#else
+ QApplication * TheApp;
+#endif
+
+ for ( int i = 1; i < argc; i ++ ) {
+ int rmv;
+ rmv = 0;
+ if( strcmp( argv[i], "--regen" ) == 0 ) {
+ Action = ACT_REGEN;
+ GuiType = QApplication::Tty;
+ rmv = 1;
+ }
+ if( rmv ) {
+ memmove( argv+i, argv+i+rmv,
+ sizeof( char * ) * (argc-i-rmv) );
+ i --;
+ argc -= rmv;
+ }
+ }
+
+ if( strstr( argv[0], "-request" ) ) {
+ // called from system to request something
+ GuiType = QApplication::Tty;
+ Action = ACT_REQUEST;
+ }
+
+ // Start Qt
+#ifdef _WS_QWS_
+ // because QPEApplication does not handle GuiType well
+ if( GuiType == QApplication::Tty ) {
+ // this cast is NOT correct but we do not use
+ // TheApp anymore ...
+ TheApp = (QPEApplication *)new QApplication( argc, argv, GuiType );
+ } else {
+ TheApp = new QPEApplication( argc, argv, GuiType );
+ }
+#else
+ TheApp = new QApplication( argc, argv, GuiType );
+#endif
+
+ // init qt with app widget
+ if( GuiType != QApplication::Tty ) {
+ QWidget * W = 0;
+ W = new NetworkSettings(0);
+ TheApp->setMainWidget( W );
+ W->show();
+#ifdef _WS_QWS_
+ W->showMaximized();
+#else
+ W->resize( W->sizeHint() );
+#endif
+ rv = TheApp->exec();
+ delete W;
+ } else {
+ switch( Action ) {
+ case ACT_REQUEST :
+ NetworkSettings::canStart( argv[1] );
+ break;
+ case ACT_REGEN :
+ // regen returns 0 if OK
+ rv = (NetworkSettings::regenerate()) ? 1 : 0;
+ break;
+ }
+ }
+
+ return rv;
+}
+
+#endif
+
+
+// main.cpp
+
diff --git a/noncore/settings/networksettings2/network/config.in b/noncore/settings/networksettings2/network/config.in
new file mode 100644
index 0000000..9dab059
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/config.in
@@ -0,0 +1,4 @@
+ config NS2NS2WORK
+ boolean "opie-networksettings2plugin-ipsetup (set up TCP/IP)"
+ default "n" if NS2
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE
diff --git a/noncore/settings/networksettings2/network/network.pro b/noncore/settings/networksettings2/network/network.pro
new file mode 100644
index 0000000..f9b2b7f
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/network.pro
@@ -0,0 +1,18 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release
+DESTDIR = $(OPIEDIR)/plugins/networksettings2
+HEADERS = network_NN.h \
+ network_NNI.h \
+ networkedit.h
+SOURCES = network_NN.cpp \
+ network_NNI.cpp \
+ networkedit.cpp \
+ networkrun.cpp
+INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2
+DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2
+LIBS += -lqpe
+INTERFACES = networkGUI.ui
+TARGET = network
+VERSION = 1.0.0
+
+include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/networksettings2/network/networkGUI.ui b/noncore/settings/networksettings2/network/networkGUI.ui
new file mode 100644
index 0000000..9115ec0
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/networkGUI.ui
@@ -0,0 +1,1071 @@
+<!DOCTYPE UI><UI>
+<class>NetworkGUI</class>
+<widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>NetworkGUI</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>293</width>
+ <height>254</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>Interface Configuration</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QTabWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TabWidget11</cstring>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Setup</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DHCP_CB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Address from server</string>
+ </property>
+ <property stdset="1">
+ <name>checked</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer6</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Fixed</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>StaticIP_GB</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget row="0" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>IP Address</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="1" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Subnet Mask</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="4" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>First DNS</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="3" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Gateway</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="2" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Broadcast</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="5" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Second DNS</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="0" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>IPAddress_LE</cstring>
+ </property>
+ </widget>
+ <widget row="1" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>SubnetMask_LE</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>255.255.255.0</string>
+ </property>
+ </widget>
+ <widget row="2" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Broadcast_LE</cstring>
+ </property>
+ </widget>
+ <widget row="3" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Gateway_LE</cstring>
+ </property>
+ </widget>
+ <widget row="4" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DNS1_LE</cstring>
+ </property>
+ </widget>
+ <widget row="5" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DNS2_LE</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>DHCP Settings</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer26</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Fixed</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame27</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>SendHostname_CB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Send hostname</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Hostname_LE</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer38</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</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>
+ </vbox>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Extra commands</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Command_LE</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QTabWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Tab_TB</cstring>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Pre-Up</string>
+ </attribute>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QListBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PreUp_LB</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame5_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>StyledPanel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>AddPreUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DeletePreUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>UpPreUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DownPreUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer5_2_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</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>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Post-Up</string>
+ </attribute>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QListBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PostUp_LB</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame5</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>StyledPanel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>AddPostUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DeletePostUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>UpPostUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DownPostUp_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer5_5</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</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>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Pre-Down</string>
+ </attribute>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QListBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PreDown_LB</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame5_3</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>3</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>StyledPanel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>AddPreDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DeletePreDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>UpPreDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DownPreDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer5_3_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</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>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Post-Down</string>
+ </attribute>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QListBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PostDown_LB</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame5_4</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>StyledPanel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>AddPostDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DeletePostDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>UpPostDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DownPostDown_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer5_4</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</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>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>DHCP_CB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>StaticIP_GB</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>SubnetMask_LE</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_NetmaskModified( const QString &amp; )</slot>
+ </connection>
+ <connection>
+ <sender>IPAddress_LE</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>NetworkGUI</receiver>
+ <slot>SLOT_NetmaskModified( const QString &amp; )</slot>
+ </connection>
+ <connection>
+ <sender>DHCP_CB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Frame27</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>DHCP_CB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel2_2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>SendHostname_CB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Hostname_LE</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <slot access="public">SLOT_NetmaskModified( const QString &amp; )</slot>
+</connections>
+<tabstops>
+ <tabstop>DHCP_CB</tabstop>
+ <tabstop>IPAddress_LE</tabstop>
+ <tabstop>SubnetMask_LE</tabstop>
+ <tabstop>Gateway_LE</tabstop>
+ <tabstop>DNS1_LE</tabstop>
+ <tabstop>DNS2_LE</tabstop>
+</tabstops>
+</UI>
diff --git a/noncore/settings/networksettings2/network/network_NN.cpp b/noncore/settings/networksettings2/network/network_NN.cpp
new file mode 100644
index 0000000..bb371ad
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/network_NN.cpp
@@ -0,0 +1,64 @@
+#include "network_NN.h"
+#include "network_NNI.h"
+
+static const char * NetworkNeeds[] =
+ { "device",
+ 0
+ };
+
+/**
+ * Constructor, find all of the possible interfaces
+ */
+NetworkNetNode::NetworkNetNode() : ANetNode() {
+}
+
+/**
+ * Delete any interfaces that we own.
+ */
+NetworkNetNode::~NetworkNetNode(){
+}
+
+const QString NetworkNetNode::nodeDescription(){
+ return tr("\
+<p>Sets up TCP/IP options.</p>\
+<p>Use this to configure the TCP/IP protocol</p>\
+"
+);
+}
+
+ANetNodeInstance * NetworkNetNode::createInstance( void ) {
+ return new ANetwork( this );
+}
+
+const char ** NetworkNetNode::needs( void ) {
+ return NetworkNeeds;
+}
+
+const char * NetworkNetNode::provides( void ) {
+ return "connection";
+}
+
+bool NetworkNetNode::generateProperFilesFor(
+ ANetNodeInstance * ) {
+ return 1;
+}
+
+bool NetworkNetNode::hasDataFor( const QString & S ) {
+ if( S == "interfaces" ) {
+ return 1;
+ }
+ return 0;
+}
+
+bool NetworkNetNode::generateDataForCommonFile(
+ SystemFile & S,
+ long DevNr,
+ ANetNodeInstance * NNI ) {
+ return ((ANetwork *)NNI)->generateDataForCommonFile(S, DevNr);
+}
+
+extern "C" {
+void create_plugin( QList<ANetNode> & PNN ) {
+ PNN.append( new NetworkNetNode() );
+}
+}
diff --git a/noncore/settings/networksettings2/network/network_NN.h b/noncore/settings/networksettings2/network/network_NN.h
new file mode 100644
index 0000000..3b0cd64
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/network_NN.h
@@ -0,0 +1,44 @@
+#ifndef NETWORK_NETNODE_H
+#define NETWORK_NETNODE_H
+
+#include "netnode.h"
+
+class ANetwork;
+
+class NetworkNetNode : public ANetNode{
+
+ Q_OBJECT
+
+public:
+
+ NetworkNetNode();
+ virtual ~NetworkNetNode();
+
+ virtual const QString pixmapName()
+ { return "tcpip"; }
+
+ virtual const QString nodeName()
+ { return tr("IP Configuration"); }
+
+ virtual const QString nodeDescription() ;
+
+ virtual ANetNodeInstance * createInstance( void );
+
+ virtual const char ** needs( void );
+ virtual const char * provides( void );
+
+ virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
+ virtual bool hasDataFor( const QString & S );
+ virtual bool generateDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+
+private:
+
+};
+
+extern "C"
+{
+ void create_plugin( QList<ANetNode> & PNN );
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/network/network_NNI.cpp b/noncore/settings/networksettings2/network/network_NNI.cpp
new file mode 100644
index 0000000..7130764
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/network_NNI.cpp
@@ -0,0 +1,170 @@
+#include <system.h>
+#include <asdevice.h>
+#include "networkedit.h"
+#include "network_NNI.h"
+#include "network_NN.h"
+
+ANetwork::ANetwork( NetworkNetNode * PNN ) : ANetNodeInstance( PNN ) {
+ Data.UseDHCP = 1;
+ Data.IPAddress = "";
+ Data.NetMask = "";
+ Data.Broadcast = "";
+ Data.Gateway = "";
+ Data.DNS1 = "";
+ Data.DNS2 = "";
+ Data.SendHostname = 0;
+ Data.Hostname = "";
+ Data.PreUp_SL.clear();
+ Data.PreDown_SL.clear();
+ Data.PostUp_SL.clear();
+ Data.PostDown_SL.clear();
+ GUI = 0;
+ RT = 0;
+}
+
+void ANetwork::setSpecificAttribute( QString & A, QString & V ) {
+ if( A == "usedhcp" ) {
+ Data.UseDHCP = (V == "yes");
+ } else if( A == "sendhostname" ) {
+ Data.SendHostname = (V=="yes");
+ } else if( A == "hostname" ) {
+ Data.Hostname = V;
+ } else if( A == "ipaddress" ) {
+ Data.IPAddress = V;
+ } else if( A == "netmask" ) {
+ Data.NetMask = V;
+ } else if( A == "broadcast" ) {
+ Data.Broadcast = V;
+ } else if( A == "gateway" ) {
+ Data.Gateway = V;
+ } else if( A == "dns1" ) {
+ Data.DNS1 = V;
+ } else if( A == "dns2" ) {
+ Data.DNS2 = V;
+ } else if( A == "preup" ) {
+ Data.PreUp_SL.append( V );
+ } else if( A == "predown" ) {
+ Data.PreDown_SL.append( V );
+ } else if( A == "postup" ) {
+ Data.PostUp_SL.append( V );
+ } else if( A == "postdown" ) {
+ Data.PostDown_SL.append( V );
+ }
+}
+
+void ANetwork::saveSpecificAttribute( QTextStream & TS ) {
+ TS << "usedhcp=" << ((Data.UseDHCP) ? "yes" : "no") << endl;
+ TS << "sendhostname=" << ((Data.SendHostname) ? "yes" : "no") << endl;
+ TS << "hostname=" << Data.Hostname << endl;
+ TS << "ipaddress=" << Data.IPAddress << endl;
+ TS << "netmask=" << Data.NetMask << endl;
+ TS << "broadcast=" << Data.Broadcast << endl;
+ TS << "gateway=" << Data.Gateway << endl;
+ TS << "dns1=" << Data.DNS1 << endl;
+ TS << "dns2=" << Data.DNS2 << endl;
+ for ( QStringList::Iterator it = Data.PreUp_SL.begin();
+ it != Data.PreUp_SL.end();
+ ++it ) {
+ TS << "preup=" << quote(*it) << endl;
+ }
+ for ( QStringList::Iterator it = Data.PreDown_SL.begin();
+ it != Data.PreDown_SL.end();
+ ++it ) {
+ TS << "predown=" << quote(*it) << endl;
+ }
+ for ( QStringList::Iterator it = Data.PostUp_SL.begin();
+ it != Data.PostUp_SL.end();
+ ++it ) {
+ TS << "postup=" << quote(*it) << endl;
+ }
+ for ( QStringList::Iterator it = Data.PostDown_SL.begin();
+ it != Data.PostDown_SL.end();
+ ++it ) {
+ TS << "postdown=" << quote(*it) << endl;
+ }
+}
+
+QWidget * ANetwork::edit( QWidget * parent ) {
+ GUI = new NetworkEdit( parent );
+ GUI->showData( Data );
+ return GUI;
+}
+
+QString ANetwork::acceptable( void ) {
+ return ( GUI ) ? GUI->acceptable( ) : QString();
+}
+
+void ANetwork::commit( void ) {
+ if( GUI && GUI->commit( Data ) )
+ setModified( 1 );
+}
+
+bool ANetwork::generateDataForCommonFile( SystemFile & S, long DevNr ) {
+ AsDevice * Dev = runtime()->device();
+ QString NIC = Dev->genNic( DevNr );
+
+ if( S.name() == "interfaces" ) {
+ // generate mapping stanza for this interface
+ S << "# check if " << NIC << " can be brought UP" << endl;
+ S << "mapping " << NIC << endl;
+ S << " script networksettings2-request" << endl << endl;
+
+ // we can safely call from here since device item is deeper
+ if( Data.UseDHCP ) {
+ S << "iface " << NIC << "-c" << connection()->number() <<
+ "-allowed inet dhcp" << endl;
+ S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() <<
+ ".up" << Data.IPAddress << endl;
+ if( Data.SendHostname ) {
+ S << " hostname "<< Data.Hostname << endl;
+ }
+
+ S << " down rm -f /tmp/profile-" << connection()->number() <<
+ ".up" << Data.IPAddress << endl;
+ } else {
+ S << "iface " << NIC << "-c" << connection()->number() <<
+ "-allowed inet static" << endl;
+ S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() <<
+ ".up" << Data.IPAddress << endl;
+ S << " down rm -f /tmp/profile-" << connection()->number() <<
+ ".up" << Data.IPAddress << endl;
+ S << " address " << Data.IPAddress << endl;
+ S << " broadcast " << Data.Broadcast << endl;
+ S << " netmask " << Data.NetMask << endl;
+
+ // derive network address = IPAddress & netmask
+ { QString NW;
+ QStringList ipal = QStringList::split( '.', Data.IPAddress );
+ QStringList nmal = QStringList::split( '.', Data.NetMask );
+
+ NW = QString( "%1.%2.%3.%4" ).
+ arg( ipal[0].toShort() & nmal[0].toShort() ).
+ arg( ipal[1].toShort() & nmal[1].toShort() ).
+ arg( ipal[2].toShort() & nmal[2].toShort() ).
+ arg( ipal[3].toShort() & nmal[3].toShort() );
+ S << " network " << NW << endl;
+ }
+ }
+ for ( QStringList::Iterator it = Data.PreUp_SL.begin();
+ it != Data.PreUp_SL.end();
+ ++it ) {
+ S << " pre-up " << (*it) << endl;
+ }
+ for ( QStringList::Iterator it = Data.PostUp_SL.begin();
+ it != Data.PostUp_SL.end();
+ ++it ) {
+ S << " up " << (*it) << endl;
+ }
+ for ( QStringList::Iterator it = Data.PreDown_SL.begin();
+ it != Data.PreDown_SL.end();
+ ++it ) {
+ S << " down " << (*it) << endl;
+ }
+ for ( QStringList::Iterator it = Data.PostDown_SL.begin();
+ it != Data.PostDown_SL.end();
+ ++it ) {
+ S << " post-down " << (*it) << endl;
+ }
+ }
+ return 0;
+}
diff --git a/noncore/settings/networksettings2/network/network_NNI.h b/noncore/settings/networksettings2/network/network_NNI.h
new file mode 100644
index 0000000..b98ff6e
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/network_NNI.h
@@ -0,0 +1,45 @@
+#ifndef NETWORK_H
+#define NETWORK_H
+
+#include <netnode.h>
+#include "networkdata.h"
+#include "networkrun.h"
+
+class NetworkNetNode;
+class NetworkEdit;
+class SystemFile;
+
+class ANetwork : public ANetNodeInstance{
+
+public :
+
+ ANetwork( NetworkNetNode * PNN );
+
+ QWidget * edit( QWidget * parent );
+ QString acceptable( void );
+ void commit( void );
+
+ RuntimeInfo * runtime( void )
+ { if( RT == 0 )
+ RT = new NetworkRun( this, Data );
+ return RT;
+ }
+
+ virtual void * data( void )
+ { return (void *)&Data; }
+
+ bool generateDataForCommonFile( SystemFile & S, long DevNr );
+
+protected :
+
+ virtual void setSpecificAttribute( QString & Attr, QString & Value );
+ virtual void saveSpecificAttribute( QTextStream & TS );
+
+private :
+
+ NetworkEdit * GUI;
+ NetworkData_t Data;
+ NetworkRun * RT;
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/network/networkdata.h b/noncore/settings/networksettings2/network/networkdata.h
new file mode 100644
index 0000000..2c5da37
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/networkdata.h
@@ -0,0 +1,22 @@
+#ifndef NETWORK_DATA_H
+#define NETWORK_DATA_H
+
+#include <qstring.h>
+#include <qstringlist.h>
+typedef struct NetworkData {
+ bool UseDHCP;
+ QString Hostname;
+ bool SendHostname;
+ QString IPAddress;
+ QString NetMask;
+ QString Gateway;
+ QString Broadcast;
+ QString DNS1;
+ QString DNS2;
+ QStringList PreUp_SL;
+ QStringList PostUp_SL;
+ QStringList PreDown_SL;
+ QStringList PostDown_SL;
+} NetworkData_t;
+
+#endif
diff --git a/noncore/settings/networksettings2/network/networkedit.cpp b/noncore/settings/networksettings2/network/networkedit.cpp
new file mode 100644
index 0000000..b17d745
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/networkedit.cpp
@@ -0,0 +1,160 @@
+#include <qtoolbutton.h>
+#include <qcheckbox.h>
+#include <qlineedit.h>
+#include <qlistbox.h>
+#include <GUIUtils.h>
+#include <resources.h>
+#include "networkedit.h"
+
+NetworkEdit::NetworkEdit( QWidget * Parent ) : NetworkGUI( Parent ){
+
+ AddPreDown_TB->setPixmap( NSResources->getPixmap( "add" ) );
+ AddPreUp_TB->setPixmap( NSResources->getPixmap( "add" ) );
+ AddPostDown_TB->setPixmap( NSResources->getPixmap( "add" ) );
+ AddPostUp_TB->setPixmap( NSResources->getPixmap( "add" ) );
+
+ DeletePreDown_TB->setPixmap( NSResources->getPixmap( "remove" ) );
+ DeletePreUp_TB->setPixmap( NSResources->getPixmap( "remove" ) );
+ DeletePostDown_TB->setPixmap( NSResources->getPixmap( "remove" ) );
+ DeletePostUp_TB->setPixmap( NSResources->getPixmap( "remove" ) );
+
+ UpPreDown_TB->setPixmap( NSResources->getPixmap( "up" ) );
+ UpPreUp_TB->setPixmap( NSResources->getPixmap( "up" ) );
+ UpPostDown_TB->setPixmap( NSResources->getPixmap( "up" ) );
+ UpPostUp_TB->setPixmap( NSResources->getPixmap( "up" ) );
+
+ DownPreDown_TB->setPixmap( NSResources->getPixmap( "down" ) );
+ DownPreUp_TB->setPixmap( NSResources->getPixmap( "down" ) );
+ DownPostDown_TB->setPixmap( NSResources->getPixmap( "down" ) );
+ DownPostUp_TB->setPixmap( NSResources->getPixmap( "down" ) );
+
+}
+
+QString NetworkEdit::acceptable( void ) {
+ if( DHCP_CB->isChecked() ) {
+ if( SendHostname_CB->isChecked() )
+ if( Hostname_LE->text().isEmpty() )
+ return tr("Hostname needed");
+ return QString();
+ }
+
+ if( IPAddress_LE->text().isEmpty() )
+ return tr("IPAddress needed");
+ if( Broadcast_LE->text().isEmpty() )
+ return tr("Broadcast needed");
+ if( SubnetMask_LE->text().isEmpty() )
+ return tr("Subnet mask needed");
+
+ // valid IP ?
+ if( ! validIP( IPAddress_LE->text() ) )
+ return tr("IPAddress not valid");
+ if( ! validIP( SubnetMask_LE->text() ) )
+ return tr("Subnet mask not valid");
+ if( ! validIP( Broadcast_LE->text() ) )
+ return tr("Broadcast address not valid");
+ if( Gateway_LE->text().isEmpty() &&
+ ! validIP( Gateway_LE->text() ) )
+ return tr("Gateway address not valid");
+ if( DNS1_LE->text().isEmpty() &&
+ ! validIP( DNS1_LE->text() ) )
+ return tr("DNS1 address not valid");
+ if( DNS2_LE->text().isEmpty() &&
+ ! validIP( DNS2_LE->text() ) )
+ return tr("DNS2 address not valid");
+ return QString();
+}
+
+bool NetworkEdit::commit( NetworkData_t & Data ) {
+ bool SM = 0;
+ CBM( Data.UseDHCP, DHCP_CB, SM );
+ TXTM( Data.IPAddress, IPAddress_LE, SM );
+ CBM( Data.SendHostname, SendHostname_CB, SM );
+ TXTM( Data.Hostname, Hostname_LE, SM );
+ TXTM( Data.Gateway, Gateway_LE, SM );
+ TXTM( Data.Broadcast, Broadcast_LE, SM );
+ TXTM( Data.NetMask, SubnetMask_LE, SM );
+ TXTM( Data.DNS1, DNS1_LE, SM );
+ TXTM( Data.DNS2, DNS2_LE, SM );
+
+ SM |= updateList( Data.PreUp_SL, PreUp_LB );
+ SM |= updateList( Data.PostUp_SL, PostUp_LB );
+ SM |= updateList( Data.PreDown_SL, PreDown_LB );
+ SM |= updateList( Data.PostDown_SL, PostDown_LB );
+
+ return SM;
+}
+
+void NetworkEdit::showData( NetworkData_t & Data ) {
+ DHCP_CB->setChecked( Data.UseDHCP );
+ SendHostname_CB->setChecked( Data.SendHostname );
+ Hostname_LE->setText( Data.Hostname );
+ IPAddress_LE->setText( Data.IPAddress );
+ Gateway_LE->setText( Data.Gateway );
+ SubnetMask_LE->setText( Data.NetMask );
+ Broadcast_LE->setText( Data.Broadcast );
+ DNS1_LE->setText( Data.DNS1 );
+ DNS2_LE->setText( Data.DNS2 );
+
+ populateList( Data.PreUp_SL, PreUp_LB );
+ populateList( Data.PostUp_SL, PostUp_LB );
+ populateList( Data.PreDown_SL, PreDown_LB );
+ populateList( Data.PostDown_SL, PostDown_LB );
+}
+
+bool NetworkEdit::updateList( QStringList & SL, QListBox * LB ) {
+ bool Changed;
+ QStringList NewSL;
+
+ // collect new list
+ for( unsigned int i = 0; i < LB->count() ; i ++ ) {
+ NewSL.append( LB->text(i) );
+ }
+
+ // check if at least ONE item in new list is NEW
+ Changed = 0;
+ for ( QStringList::Iterator it = NewSL.begin();
+ it != NewSL.end();
+ ++it ) {
+ if( SL.findIndex( (*it) ) < 0 ) {
+ // new or modified item
+ Changed = 1;
+ SL = NewSL;
+ break;
+ }
+ }
+ return Changed;
+}
+
+void NetworkEdit::populateList( QStringList & SL, QListBox * LB ) {
+ LB->clear();
+ for ( QStringList::Iterator it = SL.begin();
+ it != SL.end();
+ ++it ) {
+ LB->insertItem( (*it) );
+ }
+}
+
+void NetworkEdit::SLOT_NetmaskModified( const QString & ) {
+ QString IP, SN;
+ IP = IPAddress_LE->text();
+ SN = SubnetMask_LE->text();
+ if( IP.isEmpty() || SN.isEmpty() )
+ return;
+
+ if( ! validIP(IP) || ! validIP( SN ) )
+ return;
+
+ // if all ones
+ // broadcast = (IPAddress | ~netmask )
+ { QString NW;
+ QStringList ipal = QStringList::split( '.', IP );
+ QStringList nmal = QStringList::split( '.', SN );
+
+ NW = QString( "%1.%2.%3.%4" ).
+ arg( ipal[0].toShort() | ( ~ nmal[0].toShort() & 0x00ff) ).
+ arg( ipal[1].toShort() | ( ~ nmal[1].toShort() & 0x00ff) ).
+ arg( ipal[2].toShort() | ( ~ nmal[2].toShort() & 0x00ff) ).
+ arg( ipal[3].toShort() | ( ~ nmal[3].toShort() & 0x00ff) );
+ Broadcast_LE->setText( NW );
+ }
+}
diff --git a/noncore/settings/networksettings2/network/networkedit.h b/noncore/settings/networksettings2/network/networkedit.h
new file mode 100644
index 0000000..9ed4e84
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/networkedit.h
@@ -0,0 +1,21 @@
+#include "networkdata.h"
+#include "networkGUI.h"
+
+class NetworkEdit : public NetworkGUI {
+
+public :
+
+ NetworkEdit( QWidget * parent );
+ QString acceptable( void );
+ bool commit( NetworkData_t & Data );
+ void showData( NetworkData_t & Data );
+
+public slots :
+
+ void SLOT_NetmaskModified( const QString & S );
+
+private :
+
+ bool updateList( QStringList &SL, QListBox * LB );
+ void populateList( QStringList &SL, QListBox * LB );
+};
diff --git a/noncore/settings/networksettings2/network/networkrun.cpp b/noncore/settings/networksettings2/network/networkrun.cpp
new file mode 100644
index 0000000..e732bfa
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/networkrun.cpp
@@ -0,0 +1,63 @@
+#include <system.h>
+#include <asdevice.h>
+#include "networkrun.h"
+
+void NetworkRun::detectState( NodeCollection * NC ) {
+ RuntimeInfo * RI = netNode()->nextNode()->runtime();
+ AsDevice * Next = RI->asDevice();
+ InterfaceInfo * II = Next->assignedInterface();
+
+ if( II ) {
+ // device has assigned interface
+ NC->setCurrentState( (( II->IsUp ) ? IsUp : Available) );
+ }
+
+ // has no interface -> delegate
+ RI->detectState( NC );
+}
+
+bool NetworkRun::setState( NodeCollection * NC, Action_t A ) {
+ // we handle UP and DOWN
+ RuntimeInfo * RI = netNode()->nextNode()->runtime();
+ AsDevice * Next = RI->asDevice();
+ InterfaceInfo * II = Next->assignedInterface();
+
+ if( A == Up ) {
+ // we can bring UP if lower level is available
+ if( NC->currentState() == Available ) {
+ QString S;
+ S.sprintf( "ifup %s=manual", II->Name.latin1() );
+ NSResources->system().execute( S );
+ NC->setCurrentState( IsUp );
+ }
+ return 1;
+ } else if( A == Down ) {
+ if( NC->currentState() == IsUp ) {
+ QString S;
+ S.sprintf( "ifdown %s", II->Name.latin1() );
+ NSResources->system().execute( S );
+ NC->setCurrentState( Available );
+ }
+ return 1;
+ }
+ // delegate
+ return RI->setState( NC, A );
+}
+
+bool NetworkRun::canSetState( State_t Curr, Action_t A ) {
+ // we handle UP and DOWN
+ RuntimeInfo * RI = netNode()->nextNode()->runtime();
+
+ if( A == Up ) {
+ return ( Curr == Available );
+ } else if( A == Down ) {
+ return ( Curr == IsUp );
+ }
+ // delegate
+ return RI->canSetState( Curr, A );
+}
+
+bool NetworkRun::handlesInterface( const QString & S ) {
+ // donno -> pass deeper
+ return netNode()->nextNode()->runtime()->handlesInterface(S);
+}
diff --git a/noncore/settings/networksettings2/network/networkrun.h b/noncore/settings/networksettings2/network/networkrun.h
new file mode 100644
index 0000000..f3d840e
--- a/dev/null
+++ b/noncore/settings/networksettings2/network/networkrun.h
@@ -0,0 +1,20 @@
+#include <asconnection.h>
+#include "networkdata.h"
+
+class NetworkRun : public AsConnection {
+
+public :
+
+ NetworkRun( ANetNodeInstance * NNI,
+ NetworkData & Data ) : AsConnection( NNI )
+ { }
+
+protected :
+
+ void detectState( NodeCollection * );
+ bool setState( NodeCollection * ,Action_t A );
+ bool canSetState( State_t , Action_t A );
+
+ bool handlesInterface( const QString & I );
+
+};
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp
new file mode 100644
index 0000000..ffe130c
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings.cpp
@@ -0,0 +1,820 @@
+#include <stdio.h>
+
+#include <qpe/qpeapplication.h>
+#include <qiconset.h>
+#include <qgroupbox.h>
+#include <qtimer.h>
+#include <qlistbox.h>
+#include <qmessagebox.h>
+#include <qlabel.h>
+#include <qiconview.h>
+#include <qtextstream.h>
+#include <qdir.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qtimer.h>
+#include <qpe/qpeapplication.h>
+#include <qtoolbutton.h>
+
+#include <asdevice.h>
+#include "networksettings.h"
+#include "netnode.h"
+#include "editconnection.h"
+
+static QString CfgFile;
+
+NetworkSettingsData::NetworkSettingsData( void ) {
+ // init global resources structure
+ new TheNSResources();
+
+ CfgFile.sprintf( "%s/NETCONFIG", getenv("HOME") );
+
+ // load settings
+ Force = 0;
+ loadSettings();
+}
+
+// saving is done by caller
+NetworkSettingsData::~NetworkSettingsData( void ) {
+ delete NSResources;
+}
+
+void NetworkSettingsData::loadSettings( void ) {
+ QString S;
+ ANetNodeInstance* NNI;
+ QString Attr, Value;
+ long idx;
+
+ QFile F( CfgFile );
+ QTextStream TS( &F );
+
+ do {
+
+ if( ! F.open(IO_ReadOnly) )
+ break;
+
+ /* load the file ->
+
+ FORMAT :
+
+ [NETNODETYPE]
+ Entries ...
+ <EMPTYLINE>
+ [connection]
+ Name=Name
+ Node=Name
+ <EMPTYLINE>
+ */
+ while( ! TS.atEnd() ) {
+ S = 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
+ NodeCollection * NC = new NodeCollection( TS );
+ if ( NC->count() == 0 ) {
+ if( QMessageBox::warning(
+ 0,
+ qApp->translate( "NetworkSettings2", "Invalid connection" ),
+ qApp->translate( "NetworkSettings2",
+ "<p>Connection %1 contains unrecognized nodes and cannot be loaded</p>" ).arg(NC->name()),
+ qApp->translate( "NetworkSettings2",
+ "Remove node"),
+ qApp->translate( "NetworkSettings2",
+ "Exit program") ) == 1 ) {
+ exit( 0 );
+ }
+ delete NC;
+ } else
+ NSResources->addConnection( NC );
+ } else {
+ // load nodes
+ NNI = NSResources->createNodeInstance( S );
+ if( ! NNI ) {
+ printf( "SKIPPING %s\n", S.latin1() );
+ }
+
+ do {
+ S = TS.readLine();
+ if( S.isEmpty() ) {
+ // empty line
+ break;
+ }
+ // node found ?
+ if( NNI ) {
+ idx = S.find( '=' );
+ if( idx > 0 ) {
+ Attr = S.left( idx );
+ Value = S.mid( idx+1, S.length() );
+ } else {
+ Value="";
+ Attr = S;
+ }
+
+ Value.stripWhiteSpace();
+ Attr.stripWhiteSpace();
+ Attr.lower();
+ // dequote Attr
+ Value = deQuote(Value);
+
+ // set the attribute
+ NNI->setAttribute( Attr, Value );
+ }
+
+ } while( 1 );
+ if( NNI ) {
+ // loading from file -> exists
+ NNI->setNew( FALSE );
+ NSResources->addNodeInstance( NNI );
+ }
+ }
+ }
+
+ } while( 0 );
+
+}
+
+QString NetworkSettingsData::saveSettings( void ) {
+ QString ErrS = "";
+
+ if( ! isModified() )
+ return ErrS;
+
+ QString S;
+ QFile F( CfgFile + ".bup" );
+
+ printf( "Saving settings to %s\n", CfgFile.latin1() );
+ if( ! F.open( IO_WriteOnly | IO_Truncate ) ) {
+ ErrS = qApp->translate( "NetworkSettings",
+ "<p>Could not save setup to %1 !</p>" ).
+ arg(CfgFile);
+ // problem
+ return ErrS;
+ }
+
+ QTextStream TS( &F );
+ { Name2Connection_t & M = NSResources->connections();
+ ANetNodeInstance * NNI;
+
+ // for all connections
+ for( QDictIterator<NodeCollection> it(M);
+ it.current();
+ ++it ) {
+ // all nodes in those connections
+ for( QListIterator<ANetNodeInstance> nit(*(it.current()));
+ nit.current();
+ ++nit ) {
+ // header
+ NNI = nit.current();
+ TS << '[' <<NNI->netNode()->nodeName() << ']' << endl;
+ NNI->saveAttributes( TS );
+ TS << endl;
+ }
+
+ TS << "[connection]" << endl;
+ it.current()->save(TS);
+ }
+ }
+
+ QDir D(".");
+ D.rename( CfgFile + ".bup", CfgFile );
+
+ //
+ // proper files AND system files regenerated
+ //
+
+ setModified( 0 );
+ return ErrS;
+}
+
+QString NetworkSettingsData::generateSettings( bool ForceReq ) {
+ bool ForceIt;
+ QString S = "";
+
+ // include own force flag
+ ForceIt = (Force) ? 1 : ForceReq;
+
+ if( ! ForceIt && ! isModified() )
+ return S;
+
+ // regenerate system files
+ printf( "Generating settings from %s\n", CfgFile.latin1() );
+
+ { Name2SystemFile_t & SFM = NSResources->systemFiles();
+ Name2Connection_t & M = NSResources->connections();
+ NodeCollection * NC;
+ ANetNodeInstance * NNI;
+ SystemFile * SF;
+ bool needToRegenerate = ForceIt;
+
+ //
+ // check if we need to generate at least one of the system files
+ //
+ if( ! ForceIt ) {
+ for( QDictIterator<SystemFile> sfit(SFM);
+ sfit.current();
+ ++sfit ) {
+ SF = sfit.current();
+
+ // check if there are nodes that are modified and require
+ // data for this system file
+
+ // for all connections
+ for( QDictIterator<NodeCollection> ncit(M);
+ ncit.current();
+ ++ncit ) {
+ NC = ncit.current();
+
+ if( NC->isModified() ) {
+ // does this connection 'touch' this system file ?
+ for( QListIterator<ANetNodeInstance> cncit(*NC);
+ cncit.current();
+ ++cncit ) {
+ NNI = cncit.current();
+ if( NNI->netNode()->hasDataFor( SF->name() ) &&
+ NNI->isModified() ) {
+ needToRegenerate = 1;
+ break;
+ }
+ }
+ }
+ if( needToRegenerate )
+ break;
+ }
+ if( needToRegenerate )
+ break;
+ }
+ }
+
+ // we cannot renumber with a FORCE request since
+ // we probably are NOT going to save the config
+ // e.g. when using --regen option
+ if( ! ForceReq && needToRegenerate ) {
+ NSResources->renumberConnections();
+ setModified(1);
+ }
+
+ //
+ // generate files proper to each netnodeinstance
+ //
+ { Name2Instance_t & NNIs = NSResources->netNodeInstances();
+ ANetNodeInstance * NNI;
+
+ for( QDictIterator<ANetNodeInstance> NNIIt(NNIs);
+ NNIIt.current();
+ ++NNIIt
+ ){
+ // for all nodes find those that are modified
+ NNI = NNIIt.current();
+
+ if( ForceIt || NNI->isModified() ) {
+ if( ! NNI->netNode()->generateProperFilesFor( NNI ) ) {
+ // problem generating
+ S = qApp->translate( "NetworkSettings",
+ "<p>Cannot generate files proper to %1</p>" ).
+ arg(NNI->netNode()->nodeName()) ;
+ return S;
+ }
+ }
+ }
+ }
+
+ //
+ // generate system files
+ //
+ for( QDictIterator<SystemFile> sfit(SFM);
+ sfit.current();
+ ++sfit ) {
+ SF = sfit.current();
+
+ //
+ // regenerate current file
+ //
+ printf( "Generating %s\n", SF->name().latin1() );
+ SF->open();
+
+ do { // so we can break;
+
+ if( SF->preSection() ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in preSection for file %1</p>" ).
+ arg( SF->name() );
+ return S;
+ }
+
+ for( QDictIterator<NodeCollection> ncit(M);
+ ncit.current();
+ ++ncit ) {
+ NC = ncit.current();
+
+ // get the netnode that serves as the device for this
+ // connection
+ AsDevice * Dev = NC->device();
+
+ // generate 'entry' for every possible device this profile handles
+
+ for( QListIterator<ANetNodeInstance> cncit(*NC);
+ cncit.current();
+ ++cncit ) {
+ NNI = cncit.current();
+ for( int i = 0; i < Dev->count(); i ++ ) {
+ if( NNI->netNode()->hasDataFor( SF->name() ) ) {
+ if( SF->preNodeSection( NNI, i ) ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in preNodeSection for file %1 and node %2</p>" ).
+ arg( SF->name() ).
+ arg( NNI->netNode()->nodeName() );
+ return S;
+ }
+
+ if( NNI->netNode()->generateDataForCommonFile(*SF,i,NNI) ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in node part for file %1 and node %2</p>" ).
+ arg( SF->name() ).
+ arg( NNI->netNode()->nodeName() );
+ return S;
+ }
+
+ if( SF->postNodeSection( NNI, i ) ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in postNodeSection for file %1 and node %2</p>" ).
+ arg( SF->name() ).
+ arg( NNI->netNode()->nodeName() );
+ return S;
+ }
+ }
+ }
+ }
+ *SF << endl;
+ }
+
+ if( SF->postSection() ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in postSection for file %1</p>" ).
+ arg( SF->name() );
+ return S;
+ }
+ } while( 0 );
+ SF->close();
+ }
+ }
+ Force = 0;
+ return S;
+}
+
+//
+// GUI part
+//
+
+NetworkSettings::NetworkSettings( QWidget *parent,
+ const char *name,
+ WFlags fl ) : NetworkSettingsGUI(parent,name,fl),
+ NSD() {
+
+ UpdateTimer = new QTimer( this );
+ // set pixmaps
+ Add_TB->setPixmap( NSResources->getPixmap( "add" ) );
+ Delete_TB->setPixmap( NSResources->getPixmap( "remove" ) );
+ CheckState_TB->setPixmap( NSResources->getPixmap( "check" ) );
+ Enable_TB->setPixmap( NSResources->getPixmap( "disabled" ) );
+ GenConfig_TB->setPixmap( NSResources->getPixmap( "configure" ) );
+
+ Connect_TB->setPixmap( NSResources->getPixmap( "connected" ) );
+
+ On_TB->setPixmap( NSResources->getPixmap( "off" ) );
+
+ // populate main Listbox
+ Profiles_IV->clear();
+ { Name2Connection_t & M = NSResources->connections();
+ NodeCollection * NC;
+ QIconViewItem * IVI;
+
+ // for all connections
+ for( QDictIterator<NodeCollection> it(M);
+ it.current();
+ ++it ) {
+ NC = it.current();
+ IVI = new QIconViewItem( Profiles_IV,
+ NC->name(),
+ NC->devicePixmap() );
+ }
+ }
+
+ if( Profiles_IV->count() ) {
+ Profiles_IV->setSelected( Profiles_IV->firstItem(), TRUE );
+ }
+
+ // if no profiles -> auto popup editing
+ if( NSResources->connections().count() == 0 ) {
+ QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) );
+ }
+
+ UpdateTimer->start( 5000 );
+ connect( UpdateTimer, SIGNAL( timeout() ),
+ this, SLOT( SLOT_RefreshStates() ) );
+}
+
+NetworkSettings::~NetworkSettings() {
+ QString S;
+
+ S = NSD.generateSettings();
+ if( ! S.isEmpty() ) {
+ QMessageBox::warning(
+ 0,
+ tr( "Generating system configuration" ),
+ S
+ );
+ }
+
+ S = NSD.saveSettings();
+ if( ! S.isEmpty() ) {
+ // problem saving
+ QMessageBox::warning(
+ 0,
+ tr( "Saving setup" ), S );
+ }
+}
+
+void NetworkSettings::SLOT_RefreshStates( void ) {
+ QIconViewItem * IVI = Profiles_IV->currentItem(); // remeber
+
+ if( IVI ) {
+ NodeCollection * NC;
+ NSResources->system().probeInterfaces();
+ // update current selection only
+ NC = NSResources->findConnection( IVI->text() );
+ if( NC ) {
+ State_t OldS = NC->state();
+ State_t NewS = NC->state(1);
+ if( OldS != NewS ) {
+ updateProfileState( IVI );
+ }
+ }
+ }
+
+
+ /* -> LATER !!
+ bool is;
+ NodeCollection * NC;
+
+ for( unsigned int i = 0; i < Profiles_LB->count() ; i ++ ) {
+ NC = NSResources->findConnection( 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 );
+ if( is ) {
+ Profiles_LB->setSelected( i, TRUE );
+ }
+ }
+ }
+ }
+ if( ci >= 0 )
+ Profiles_LB->setCurrentItem( ci );
+ */
+}
+
+void NetworkSettings::SLOT_AddNode( void ) {
+ SLOT_EditNode( 0 );
+}
+
+void NetworkSettings::SLOT_DeleteNode( void ) {
+ QIconViewItem * IVI = Profiles_IV->currentItem();
+
+ if ( ! IVI )
+ return;
+
+ if( QMessageBox::warning(
+ 0,
+ tr( "Removing profile" ),
+ tr( "Remove selected profile ?" ),
+ 1, 0 ) == 1 ) {
+ NSResources->removeConnection( IVI->text() );
+ delete IVI;
+ setModified( 1 );
+ NSD.forceGeneration(1);
+ }
+}
+
+void NetworkSettings::SLOT_EditNode( QIconViewItem * IVI ) {
+ QString OldName = "";
+ EditConnection EC( this );
+
+ if( IVI ) {
+ NodeCollection * NC = NSResources->findConnection( IVI->text() );
+ if( ! NC ) {
+ return;
+ }
+ OldName = NC->name();
+ EC.setConnection( NC );
+ }
+
+ EC.showMaximized();
+ // disable refresh timer
+ UpdateTimer->stop();
+ if( EC.exec() == QDialog::Accepted ) {
+ // toplevel item -> store
+ NodeCollection * NC = EC.connection();
+ if( NC->isModified() ) {
+ setModified( 1 );
+ if( IVI ) {
+ // new name -> remove item
+ NSResources->removeConnection( OldName );
+ // must add it here since change will trigger event
+ NSResources->addConnection( NC );
+ IVI->setText( NC->name() );
+ IVI->setPixmap( NC->devicePixmap() );
+ } else {
+ // new item
+ NSResources->addConnection( NC );
+ NC->setNumber( NC->maxConnectionNumber()+1 );
+ IVI = new QIconViewItem( Profiles_IV,
+ NC->name(),
+ NC->devicePixmap()
+ );
+ Profiles_IV->setSelected( IVI, TRUE );
+ }
+ updateProfileState( IVI );
+ }
+ } else {
+ // cancelled : reset connection
+ if( IVI ) {
+ NodeCollection * NC = NSResources->findConnection( IVI->text() );
+ NC->reassign();
+ }
+ }
+ // reenable
+ UpdateTimer->start( 5000 );
+}
+
+void NetworkSettings::SLOT_ShowNode( QIconViewItem * IVI ) {
+ if( IVI == 0 )
+ return;
+
+ NodeCollection * NC = NSResources->findConnection( IVI->text() );
+
+ // is button possible
+ bool EnabledPossible, OnPossible, ConnectPossible;
+ // is button On or Off
+ bool DisabledOn, OnOn, ConnectOn;
+
+ EnabledPossible = OnPossible = ConnectPossible = 1;
+ DisabledOn = 1;
+ OnOn = ConnectOn = 0;
+
+ switch( NC->state() ) {
+ case Unknown :
+ // cannot occur here
+ break;
+ case Unchecked :
+ case Unavailable :
+ // cannot do anything but recheck
+ EnabledPossible = OnPossible = ConnectPossible = 0;
+ break;
+ case Disabled :
+ OnPossible = ConnectPossible = 0;
+ break;
+ case Off :
+ DisabledOn = 0;
+ break;
+ case Available :
+ OnOn = 1;
+ DisabledOn = 0;
+ break;
+ case IsUp :
+ OnOn = ConnectOn = 1;
+ DisabledOn = 0;
+ break;
+ }
+
+ // set button state
+ Enable_TB->setEnabled( EnabledPossible );
+ On_TB->setEnabled( OnPossible );
+ Connect_TB->setEnabled( ConnectPossible );
+
+ Enable_TB->setOn( DisabledOn );
+ On_TB->setOn( OnOn );
+ Connect_TB->setOn( ConnectOn );
+
+ if( NC->description().isEmpty() ) {
+ Description_LBL->setText( tr( "No description" ) );
+ } else {
+ Description_LBL->setText( NC->description() );
+ }
+
+ CurProfile_GB->setTitle( IVI->text() );
+ State_LBL->setText( NC->stateName() );
+}
+
+void NetworkSettings::SLOT_CheckState( void ) {
+ QIconViewItem * IVI = Profiles_IV->currentItem();
+ if ( ! IVI )
+ return;
+ updateProfileState( IVI );
+}
+
+void NetworkSettings::updateProfileState( QIconViewItem * IVI ) {
+ if( IVI == Profiles_IV->currentItem() ) {
+ SLOT_ShowNode( IVI );
+ }
+}
+
+void NetworkSettings::SLOT_GenerateConfig( void ) {
+ QString S = NSD.generateSettings( TRUE );
+
+ if( ! S.isEmpty() ) {
+ QMessageBox::warning(
+ 0,
+ tr( "Generating system configuration" ),
+ S
+ );
+ }
+}
+
+void NetworkSettings::SLOT_Enable( void ) {
+ QIconViewItem * IVI = Profiles_IV->currentItem();
+ QString Msg;
+ if ( ! IVI )
+ return;
+
+ NodeCollection * NC =
+ NSResources->findConnection( IVI->text() );
+
+ bool rv;
+ switch( NC->state() ) {
+ case Disabled :
+ Msg = tr( "Cannot enable profile" );
+ rv = NC->setState( Enable );
+ break;
+ default :
+ Msg = tr( "Cannot disable profile" );
+ rv = NC->setState( Disable );
+ break;
+ }
+
+ if( ! rv ) {
+ QMessageBox::warning(
+ 0,
+ tr( "Activating profile" ),
+ Msg );
+ return;
+ }
+ updateProfileState( IVI );
+}
+
+void NetworkSettings::SLOT_On( void ) {
+ QIconViewItem * IVI = Profiles_IV->currentItem();
+
+ if ( ! IVI )
+ return;
+
+ NodeCollection * NC =
+ NSResources->findConnection( IVI->text() );
+
+ bool rv;
+ switch( NC->state() ) {
+ case Off :
+ // activate interface
+ rv = NC->setState( Activate );
+ break;
+ case Available :
+ // deactivate
+ rv = NC->setState( Deactivate );
+ break;
+ case IsUp :
+ // bring down and deactivate
+ rv = ( NC->setState( Down ) &&
+ NC->setState( Deactivate ) );
+ break;
+ default :
+ // others no change
+ return;
+ }
+
+ if( ! rv ) {
+ QMessageBox::warning(
+ 0,
+ tr( "Activating profile" ),
+ tr( "Cannot enable profile" ) );
+ return;
+ }
+ updateProfileState( IVI );
+}
+
+void NetworkSettings::SLOT_Connect( void ) {
+ QIconViewItem * IVI = Profiles_IV->currentItem();
+
+ if ( ! IVI )
+ return;
+
+ NodeCollection * NC =
+ NSResources->findConnection( IVI->text() );
+
+ bool rv;
+ switch( NC->state() ) {
+ case IsUp :
+ // down interface
+ rv = NC->setState( Down );
+ break;
+ case Available :
+ // up interface
+ rv = NC->setState( Up );
+ break;
+ case Off :
+ // activate and bring up
+ rv = ( NC->setState( Activate ) &&
+ NC->setState( Up ) );
+ break;
+ default :
+ // others no change
+ return;
+ }
+
+ if( ! rv ) {
+ QMessageBox::warning(
+ 0,
+ tr( "Activating profile" ),
+ tr( "Cannot enable profile" ) );
+ return;
+ }
+
+ // we do not update the GUI but wait for the REAL upping of the device
+}
+
+/*
+ Called by the system to see if interface can be brought UP
+
+ if allowed, echo Interface-allowed else Interface-disallowed
+*/
+
+void NetworkSettings::canStart( const char * Interface ) {
+ // load situation
+ NetworkSettingsData NSD;
+
+ { Name2Connection_t & M = NSResources->connections();
+ NodeCollection * NC;
+
+ // for all connections
+ for( QDictIterator<NodeCollection> it(M);
+ it.current();
+ ++it ) {
+ NC = it.current();
+ // check if this profile handles the requested interface
+ if( NC->handlesInterface( Interface ) ) {
+ switch( NC->state() ) {
+ case Unchecked :
+ case Unknown :
+ case Unavailable :
+ case Disabled :
+ // this profile does not allow interface to be UP
+ // -> try others
+ break;
+ case Off :
+ // try to UP the device
+ if( ! NC->setState( Activate ) ) {
+ // cannot bring device Online -> try other alters
+ break;
+ }
+ // FT
+ case Available :
+ case IsUp : // also called for 'down'
+ // device is ready -> done
+ printf( "%s-c%d-allowed\n",
+ Interface, NC->number() );
+ return;
+ }
+ }
+ }
+ }
+ // if we come here no alternatives are possible
+ printf( "%s-cnn-disallowed\n", Interface );
+}
+
+/*
+ Called by the system to regenerate config files
+*/
+
+bool NetworkSettings::regenerate( void ) {
+ QString S;
+ // load situation
+ NetworkSettingsData NSD;
+
+ S = NSD.generateSettings( TRUE );
+ if( ! S.isEmpty() ) {
+ fprintf( stdout, "%s\n", S.latin1() );
+ return 1;
+ }
+ return 0;
+}
diff --git a/noncore/settings/networksettings2/networksettings.h b/noncore/settings/networksettings2/networksettings.h
new file mode 100644
index 0000000..eb475a3
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings.h
@@ -0,0 +1,77 @@
+#include "networksettingsGUI.h"
+#include "resources.h"
+
+class ANetNode;
+class ANetNodeInstance;
+class QTimer;
+class QIconViewItem;
+
+class NetworkSettingsData {
+
+public :
+
+ NetworkSettingsData( void );
+ ~NetworkSettingsData( void );
+
+ void loadSettings( void );
+ QString saveSettings( void );
+
+ QString generateSettings( bool Force = FALSE );
+
+ bool isModified( void )
+ { return IsModified; }
+ void setModified( bool m )
+ { IsModified = m; }
+
+ void forceGeneration( bool m )
+ { Force = m; }
+
+private :
+
+ bool IsModified;
+ bool Force;
+
+};
+
+class NetworkSettings : public NetworkSettingsGUI {
+
+ Q_OBJECT
+
+public :
+
+ NetworkSettings( QWidget *parent=0,
+ const char *name=0,
+ WFlags fl = 0 );
+ ~NetworkSettings( void );
+
+ static QString appName( void )
+ { return QString::fromLatin1("networksettings"); }
+
+ static void canStart( const char * Interface );
+ static bool regenerate( void );
+
+ bool isModified( void )
+ { return NSD.isModified(); }
+ void setModified( bool m )
+ { NSD.setModified( m ); }
+
+public slots :
+
+ void SLOT_AddNode( void );
+ void SLOT_DeleteNode( void );
+ void SLOT_ShowNode( QIconViewItem * );
+ void SLOT_EditNode( QIconViewItem * );
+ void SLOT_CheckState( void );
+ void SLOT_Enable( void );
+ void SLOT_On( void );
+ void SLOT_Connect( void );
+ void SLOT_GenerateConfig( void );
+ void SLOT_RefreshStates( void );
+
+private :
+
+ void updateProfileState( QIconViewItem * it );
+ QTimer * UpdateTimer;
+ NetworkSettingsData NSD;
+
+};
diff --git a/noncore/settings/networksettings2/networksettings.pro b/noncore/settings/networksettings2/networksettings.pro
new file mode 100644
index 0000000..fb1f2cf
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings.pro
@@ -0,0 +1,16 @@
+#
+CONFIG = qt warn_on debug quick-app
+#CONFIG = qt warn_on release
+HEADERS = networksettings.h \
+ editconnection.h
+SOURCES = main.cpp \
+ networksettings.cpp \
+ editconnection.cpp
+INCLUDEPATH += $(OPIEDIR)/include networksettings2/
+DEPENDPATH += $(OPIEDIR)/include networksettings2/
+LIBS += -lqpe -L$(OPIEDIR)/plugins/networksettings2 -lnetworksettings2 -lopie
+INTERFACES = networksettingsGUI.ui editconnectionGUI.ui
+TARGET = networksettings2
+
+
+include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/networksettings2/networksettings2/GUIUtils.cpp b/noncore/settings/networksettings2/networksettings2/GUIUtils.cpp
new file mode 100644
index 0000000..a98c303
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/GUIUtils.cpp
@@ -0,0 +1,27 @@
+#include <qstringlist.h>
+#include "GUIUtils.h"
+
+bool validIP( const QString & S ) {
+
+ QStringList SL = QStringList::split( '.', S, TRUE );
+ if( SL.count() != 4 )
+ return 0;
+
+ for( int i = 0; i < 4 ; i ++ ) {
+ if( SL[i].isEmpty() )
+ return 0;
+ }
+
+ short x = SL[0].toShort();
+
+ if( x < 1 || x > 255 )
+ return 0;
+
+ for( int i = 1; i < 4 ; i ++ ) {
+ x = SL[i].toShort();
+ if( x < 0 || x > 255 )
+ return 0;
+ }
+ return 1;
+
+}
diff --git a/noncore/settings/networksettings2/networksettings2/GUIUtils.h b/noncore/settings/networksettings2/networksettings2/GUIUtils.h
new file mode 100644
index 0000000..23290a9
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/GUIUtils.h
@@ -0,0 +1,36 @@
+#ifndef __GUIUTILS_H
+#define __GUIUTILS_H
+
+#include <qstring.h>
+
+// if TEXT capable widget has changed
+#define TXTM( Data, Wdg, FL ) \
+ if( Wdg->text() != Data ) { \
+ FL = 1; \
+ Data = Wdg->text(); \
+ }
+
+// if IsChecked capable widget has changed
+#define CBM(Data,Wdg,FL) \
+ if( Wdg->isChecked() != Data) { \
+ FL = 1; \
+ Data = Wdg->isChecked(); \
+ }
+
+// if Value capable widget has changed
+#define SBM(Data,Wdg,FL) \
+ if( Wdg->value() != Data) { \
+ FL = 1; \
+ Data = Wdg->value(); \
+ }
+
+// if currentItem capable widget has changed
+#define CIM(Data,Wdg,FL) \
+ if( Wdg->currentItem() != Data) { \
+ FL = 1; \
+ Data = Wdg->currentItem(); \
+ }
+
+extern bool validIP( const QString & S );
+
+#endif
diff --git a/noncore/settings/networksettings2/networksettings2/asconnection.h b/noncore/settings/networksettings2/networksettings2/asconnection.h
new file mode 100644
index 0000000..1ed7e74
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/asconnection.h
@@ -0,0 +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 {
+
+public :
+
+ AsConnection( ANetNodeInstance * NNI ) :
+ RuntimeInfo( NNI ) {
+ }
+
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/networksettings2/asdevice.h b/noncore/settings/networksettings2/networksettings2/asdevice.h
new file mode 100644
index 0000000..058fc4c
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/asdevice.h
@@ -0,0 +1,37 @@
+#ifndef ASDEVICE_H
+#define ASDEVICE_H
+
+#include "system.h"
+#include "netnode.h"
+
+// pure virtual (component oriented) interface of any
+// plugin that offers a device
+class AsDevice : public RuntimeInfo {
+
+public :
+
+ AsDevice( ANetNodeInstance * NNI ) :
+ RuntimeInfo( NNI ) {
+ AssignedInterface = 0;
+ }
+
+ // return the interface assigned to this device
+ // e.g eth0, wlan, ...
+ InterfaceInfo * assignedInterface( void )
+ { return AssignedInterface; }
+ virtual void assignInterface( InterfaceInfo * NI )
+ { AssignedInterface = NI; }
+
+ // number of device to configure for this Device type
+ virtual long count( void )
+ { return 1; }
+ // generate NIC name of device number ...
+ virtual QString genNic( long NicNr ) = 0;
+
+private :
+
+ InterfaceInfo * AssignedInterface;
+
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/networksettings2/asfullsetup.h b/noncore/settings/networksettings2/networksettings2/asfullsetup.h
new file mode 100644
index 0000000..e358a83
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/asfullsetup.h
@@ -0,0 +1,20 @@
+#ifndef ASFULLSETUP_H
+#define ASFULLSETUP_H
+
+#include <netnode.h>
+
+// pure virtual (component oriented) interface of any
+// plugin that offers a full setup
+class AsFullSetup : public RuntimeInfo {
+
+public :
+
+ AsFullSetup( ANetNodeInstance * NNI ) :
+ RuntimeInfo( NNI ) {
+ }
+
+ virtual const QString & description( void ) = 0;
+
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/networksettings2/asline.h b/noncore/settings/networksettings2/networksettings2/asline.h
new file mode 100644
index 0000000..6bd93ec
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/asline.h
@@ -0,0 +1,18 @@
+#ifndef ASLINE_H
+#define ASLINE_H
+
+#include <netnode.h>
+
+// pure virtual (component oriented) interface of any
+// plugin that offers a line
+class AsLine : public RuntimeInfo {
+
+public :
+
+ AsLine( ANetNodeInstance * NNI ) :
+ RuntimeInfo( NNI ) {
+ }
+
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/networksettings2/config.in b/noncore/settings/networksettings2/networksettings2/config.in
new file mode 100644
index 0000000..4f1dd5b
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/config.in
@@ -0,0 +1,4 @@
+ config NS2MAIN
+ boolean
+ default "y" if NS2
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.cpp b/noncore/settings/networksettings2/networksettings2/netnode.cpp
new file mode 100644
index 0000000..a5b572b
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/netnode.cpp
@@ -0,0 +1,278 @@
+#include <qpe/qpeapplication.h>
+#include <time.h>
+#include <qtextstream.h>
+#include <qpixmap.h>
+
+#include "resources.h"
+#include "netnode.h"
+
+#include "asdevice.h"
+#include "asline.h"
+#include "asconnection.h"
+#include "asfullsetup.h"
+
+QString & deQuote( QString & X ) {
+ if( X[0] == '"' ) {
+ // remove end and trailing "" and \x -> x
+ QChar R;
+ long idx;
+ idx = X.length()-1;
+ X = X.mid( 1, idx );
+
+ idx = 0;
+ while( ( idx = X.find( '\\', idx ) ) >= 0 ) {
+ R = X[idx+1];
+ X.replace( idx, 2, &R, 1 );
+ }
+ X = X.left( X.length()-1 );
+ }
+ return X;
+}
+
+QString quote( QString X ) {
+ if( X.find( QRegExp( "[ \n\"\\\t]" ) ) >= 0 ) {
+ // need to quote this
+ QString OutString = "\"";
+
+ X.replace( QRegExp("\""), "\\\"" );
+ X.replace( QRegExp("\\"), "\\\\" );
+ X.replace( QRegExp(" "), "\\ " );
+
+ OutString += X;
+ OutString += "\"";
+ X = OutString;
+ }
+ return X;
+}
+
+//
+//
+//
+//
+//
+
+long ANetNodeInstance::InstanceCounter = -1;
+
+void ANetNodeInstance::initialize( void ) {
+ if( InstanceCounter == -1 )
+ InstanceCounter = time(0);
+ // set name
+ QString N;
+ N.sprintf( "-%ld", InstanceCounter++ );
+ N.prepend( NodeType->nodeName() );
+ setNodeName( N );
+}
+
+void ANetNodeInstance::setAttribute( QString & Attr, QString & Value ){
+ if( Attr == "name" ) {
+ NodeName = Value;
+ } else {
+ setSpecificAttribute( Attr, Value );
+ }
+}
+
+void ANetNodeInstance::saveAttributes( QTextStream & TS ) {
+ TS << "name=" << quote( NodeName ) << endl;
+ saveSpecificAttribute( TS );
+}
+
+ANetNodeInstance * ANetNodeInstance::nextNode( void ) {
+ return connection()->findNext( this );
+}
+
+//
+//
+//
+//
+//
+
+long NodeCollection::MaxNr = -1;
+
+NodeCollection::NodeCollection( void ) : QList<ANetNodeInstance>() {
+ IsModified = 0;
+ Index = -1;
+ Name="";
+ IsNew = 1;
+ CurrentState = Unchecked;
+}
+
+NodeCollection::NodeCollection( QTextStream & TS ) :
+ QList<ANetNodeInstance>() {
+ long idx;
+ bool InError = 0;
+ QString S, A, N;
+ IsModified = 0;
+ Index = -1;
+ Name="";
+ IsNew = 0;
+ CurrentState = Unchecked;
+
+ do {
+ S = TS.readLine();
+ if( S.isEmpty() ) {
+ if( InError ) {
+ // remove all nodes
+ clear();
+ }
+ // empty line
+ break;
+ }
+
+ idx = S.find('=');
+ S.stripWhiteSpace();
+ A = S.left( idx );
+ A.lower();
+ N = S.mid( idx+1, S.length() );
+ N.stripWhiteSpace();
+ N = deQuote( N );
+
+ if( A == "name" ) {
+ Name = N;
+ } else if( A == "number" ) {
+ setNumber( N.toLong() );
+ } else if( A == "node" ) {
+ ANetNodeInstance * NNI = NSResources->findNodeInstance( N );
+ if( NNI && ! InError ) {
+ append( NSResources->findNodeInstance( N ) );
+ } else {
+ // could not find a node type -> collection invalid
+ InError = 1;
+ }
+ }
+ } while( 1 );
+}
+
+
+NodeCollection::~NodeCollection( void ) {
+}
+
+const QString & NodeCollection::description( void ) {
+ ANetNodeInstance * NNI = getToplevel();
+ return (NNI) ? NNI->runtime()->asFullSetup()->description() : Name;
+}
+
+void NodeCollection::append( ANetNodeInstance * NNI ) {
+ NNI->setConnection( this );
+ QList<ANetNodeInstance>::append( NNI );
+}
+
+void NodeCollection::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=" << quote( NNI->nodeName() ) << endl;
+ }
+ TS << endl;
+ IsNew = 0;
+}
+
+ANetNodeInstance * NodeCollection::getToplevel( void ) {
+ ANetNodeInstance * NNI = 0;
+ for( QListIterator<ANetNodeInstance> it(*this);
+ it.current();
+ ++it ) {
+ NNI = it.current();
+ if( NNI->netNode()->isToplevel() )
+ break;
+ }
+ return NNI;
+}
+
+ANetNodeInstance * NodeCollection::findByName( const QString & S ) {
+ ANetNodeInstance * NNI = 0;
+ for( QListIterator<ANetNodeInstance> it(*this);
+ it.current();
+ ++it ) {
+ NNI = it.current();
+ if( NNI->name() == S )
+ break;
+ }
+ return NNI;
+}
+
+ANetNodeInstance * NodeCollection::findNext( ANetNodeInstance * NNI ) {
+ ANetNodeInstance * NNNI;
+
+ if( ! NNI )
+ getToplevel();
+
+ for( QListIterator<ANetNodeInstance> it(*this);
+ it.current();
+ ++it ) {
+ NNNI = it.current();
+ if( NNNI == NNI ) {
+ ++it;
+ return it.current();
+ }
+ }
+ return 0; // no more next
+}
+
+int NodeCollection::compareItems( QCollection::Item I1,
+ QCollection::Item I2 ) {
+ ANetNodeInstance * NNI1, * NNI2;
+ NNI1 = (ANetNodeInstance *)I1;
+ NNI2 = (ANetNodeInstance *)I2;
+ return NNI1->nodeName().compare( NNI2->nodeName() );
+}
+
+static char * State2PixmapTbl[] = {
+ "NULL", // Unchecked : no pixmap
+ "check", // Unknown
+ "delete", // unavailable
+ "disabled", // disabled
+ "off", // off
+ "disconnected", // available
+ "connected" // up
+};
+
+QPixmap NodeCollection::devicePixmap( void ) {
+ return NSResources->getPixmap(
+ device()->netNode()->pixmapName()+"-large" );
+}
+
+QPixmap NodeCollection::statePixmap( State_t S) {
+ return NSResources->getPixmap( State2PixmapTbl[S] );
+}
+
+QString NodeCollection::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 :
+ return qApp->translate( "networksettings2", "Off");
+ case Available :
+ return qApp->translate( "networksettings2", "Available");
+ case IsUp :
+ return qApp->translate( "networksettings2", "IsUp");
+ case Unchecked : /* FT */
+ default :
+ break;
+ }
+ return QString("");
+}
+
+void NodeCollection::reassign( void ) {
+ for( QListIterator<ANetNodeInstance> it(*this);
+ it.current();
+ ++it ) {
+ it.current()->setConnection( this );
+ }
+}
+
+InterfaceInfo * RuntimeInfo::assignedInterface( void ) {
+ return netNode()->nextNode()->runtime()->assignedInterface();
+}
+
+AsDevice * RuntimeInfo::device( void ) {
+ return netNode()->nextNode()->runtime()->device();
+}
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.h b/noncore/settings/networksettings2/networksettings2/netnode.h
new file mode 100644
index 0000000..0ecd64e
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/netnode.h
@@ -0,0 +1,361 @@
+#ifndef NETNODE_H
+#define NETNODE_H
+
+#include <qtextstream.h>
+#include <qlist.h>
+#include <qpixmap.h>
+#include <qobject.h>
+#include <time.h>
+
+// difference feature interfaces
+class AsDevice;
+class AsLine;
+class AsConnection;
+class AsFullSetup;
+
+// needed for plugin creation function
+#include <qlist.h>
+
+class ANetNode;
+class ANetNodeInstance;
+class NodeCollection;
+class QTextStream;
+class RuntimeInfo;
+class InterfaceInfo;
+
+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
+ // the hardware is not available
+ Unavailable = 2,
+ // if the connection 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
+ // i.e. the corresponding hardware is not activated
+ Off = 4,
+ // if connection is available to be used (i.e. the
+ // devices if fully ready to be used
+ Available = 5,
+ // if connection is being used
+ IsUp = 6
+} State_t;
+
+typedef enum Action {
+ // to make the device unavailable functionally
+ Disable = 0,
+ // to make the device available functionally
+ Enable = 1,
+ // bring the hardware up
+ Activate = 2,
+ // bring the hardware down
+ Deactivate = 3,
+ // bring the connection up
+ Up = 4,
+ // bring the connection down
+ Down = 5
+} Action_t;
+
+class ANetNode : public QObject{
+
+public:
+
+ typedef QArray<ANetNode *> NetNodeList;
+
+ ANetNode(){};
+ virtual ~ANetNode(){};
+
+ // pixmap needed for this NetNode
+ virtual const QString pixmapName() = 0;
+
+ // name of this NetNode
+ virtual const QString nodeName() = 0;
+
+ // description for this NetNode
+ virtual const QString nodeDescription() = 0;
+
+ // create a blank instance of a net node
+ virtual ANetNodeInstance * createInstance( void ) = 0;
+
+ // return feature this NetNode provides
+ virtual const char * provides( void ) = 0;
+ virtual const char ** needs( void ) = 0;
+
+ // generate files specific for this node (if any)
+ virtual bool generateProperFilesFor( ANetNodeInstance * NNI ) = 0;
+ // return TRUE if this node has data to be inserted in systemfile
+ // with name S
+ virtual bool hasDataFor( const QString & S ) = 0;
+ // generate data specific for the system file S
+ // called only IF data was needed
+ virtual bool generateDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI ) = 0;
+
+ // does this Node provide a Connection
+ bool isToplevel( void )
+ { return strcmp( provides(), "fullsetup") == 0 ; }
+
+ // compiled references to 'needed' NetNodes -> needs list
+ void setAlternatives( NetNodeList * Alt )
+ { Alternatives = Alt; }
+ NetNodeList & alternatives( void )
+ { return *Alternatives; }
+
+protected :
+
+ NetNodeList * Alternatives;
+
+private :
+};
+
+class ANetNodeInstance : public QObject {
+
+public:
+
+ ANetNodeInstance( ANetNode * NN ) : QObject()
+ { IsModified=0; NodeType = NN; IsNew = TRUE; }
+ virtual ~ANetNodeInstance( void ) { }
+
+ virtual RuntimeInfo * runtime( void ) = 0;
+
+ void setConnection( NodeCollection * NC )
+ { Connection = NC; }
+ NodeCollection * connection( void )
+ { return Connection; }
+
+ // create edit widget under parent
+ virtual QWidget * edit( QWidget * parent ) = 0;
+ // is given data acceptable
+ virtual QString acceptable( void ) = 0;
+
+ // return data was modified
+ void setModified( bool M )
+ { IsModified = M; }
+ bool isModified( void )
+ { return IsModified; }
+
+ // get data from GUI and store in node
+ virtual void commit( void ) = 0;
+
+ // get next node
+ ANetNodeInstance * nextNode();
+ // return NetNode this is an instance of
+ ANetNode * netNode( void )
+ { return NodeType; }
+
+ // intialize am instance of a net node
+ void initialize( void );
+
+ // set the value of an attribute
+ void setAttribute( QString & Attr, QString & Value ) ;
+ void saveAttributes( QTextStream & TS ) ;
+
+ // return true if node isntance is NEW and not loaded
+ void setNew( bool IsN )
+ { IsNew = IsN; }
+ bool isNew( void )
+ { 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 )
+ { return Description; }
+ void setDescription( const QString & S )
+ { Description = S; }
+
+ // pixmap for this instance -> from NetNode
+ const QString pixmapName( void )
+ { return NodeType->pixmapName(); }
+
+ const char * provides( void )
+ { return NodeType->provides(); }
+
+ const char ** needs( void )
+ { return NodeType->needs(); }
+
+ // returns node specific data -> only useful for 'buddy'
+ 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;
+ QString NodeName;
+ QString Description;
+ bool IsModified;
+ bool IsNew;
+
+ static long InstanceCounter;
+};
+
+class RuntimeInfo : public QObject {
+
+ Q_OBJECT
+
+public :
+
+ RuntimeInfo( ANetNodeInstance * TheNNI )
+ { NNI = TheNNI; }
+
+ // downcast
+ AsDevice * asDevice( void )
+ { return (AsDevice *)this; }
+ AsConnection * asConnection( void )
+ { return (AsConnection *)this; }
+ AsLine * asLine( void )
+ { return (AsLine *)this; }
+ AsFullSetup * asFullSetup( void )
+ { return (AsFullSetup *)this; }
+
+ // does this node handles this interface e.g.eth0
+ // recurse deeper if this node cannot answer that question
+ virtual bool handlesInterface( const QString & )
+ { return 0; }
+ virtual InterfaceInfo * assignedInterface( void );
+ virtual AsDevice * device( void );
+
+ ANetNodeInstance * netNode()
+ { return NNI; }
+ NodeCollection * connection()
+ { return NNI->connection(); }
+
+ virtual void detectState( NodeCollection * NC ) = 0;
+ virtual bool setState( NodeCollection * NC, Action_t A ) = 0;
+ virtual bool canSetState( State_t Curr, Action_t A ) = 0;
+
+signals :
+
+ // sent by device if state changes
+ void stateChanged( State_t S, ANetNodeInstance * NNI );
+
+protected :
+
+ // connection this runtime info belongs to
+ ANetNodeInstance * NNI;
+};
+
+class NodeCollection : public QList<ANetNodeInstance> {
+
+public :
+
+ NodeCollection( void );
+ NodeCollection( QTextStream & TS );
+ ~NodeCollection( void );
+
+ int number( void )
+ { return Number; }
+ void setNumber( int i )
+ { Number = i; if( MaxNr < i ) MaxNr = i; }
+ bool isNew( void )
+ { return IsNew; }
+ void setNew( bool N )
+ { IsNew = N ; }
+ bool isModified( void )
+ { return IsModified; }
+ void setModified( bool N )
+ { IsModified = N ; }
+
+ bool handlesInterface( const QString & S ) {
+ return getToplevel()->runtime()->handlesInterface( S );
+ }
+
+ InterfaceInfo * assignedInterface( void ) {
+ return getToplevel()->runtime()->assignedInterface();
+ }
+
+ AsDevice * device() {
+ return getToplevel()->runtime()->device();
+ }
+
+ State_t state( bool Update = 0 )
+ { if( CurrentState == Unchecked || Update ) {
+ // need to get current state
+ getToplevel()->runtime()->detectState( this );
+ }
+ return CurrentState;
+ }
+
+ // get the ixmap for this device
+ QPixmap devicePixmap( void );
+ QPixmap statePixmap( State_t S );
+ QPixmap statePixmap( bool Update = 0 )
+ { return statePixmap( state(Update) ); }
+ QString stateName( State_t );
+ QString stateName( bool Update = 0 )
+ { return stateName( state(Update) ); }
+
+ bool setState( Action_t A )
+ { return getToplevel()->runtime()->setState( this, A ); }
+ bool canSetState( Action_t A )
+ { return getToplevel()->runtime()->canSetState( CurrentState, A ); }
+
+ void save( QTextStream & TS );
+
+ void append( ANetNodeInstance * NNI );
+
+ // makes sure that all items in the connection point to
+ // that connectoin
+ void reassign( void );
+
+ ANetNodeInstance * getToplevel( void );
+ ANetNodeInstance * findNext( ANetNodeInstance * NNI );
+ ANetNodeInstance * findByName( const QString & S );
+
+ const QString & name()
+ { return Name; }
+
+ const QString & description( void );
+
+ void setName( const QString & N)
+ { Name = N; }
+
+ State_t currentState( void )
+ { return CurrentState; }
+ void setCurrentState( State_t S )
+ { CurrentState = S; }
+
+ long maxConnectionNumber( void )
+ { return MaxNr; }
+
+ static void resetMaxNr( void )
+ { MaxNr = -1; }
+
+private :
+
+ int compareItems ( QCollection::Item item1,
+ QCollection::Item item2 );
+
+ static long MaxNr;
+ long Number;
+
+ // state of this connection
+ State_t CurrentState;
+
+ QString Name;
+ // true if this collection was just created (and not
+ // loaded from file
+ bool IsNew;
+ // index in listbox
+ int Index;
+ bool IsModified;
+
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/networksettings2/networksettings2.pro b/noncore/settings/networksettings2/networksettings2/networksettings2.pro
new file mode 100644
index 0000000..c9945ff
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/networksettings2.pro
@@ -0,0 +1,26 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release
+#CONFIG += qt warn_on debug
+DESTDIR = $(OPIEDIR)/lib$(PROJMAK)
+HEADERS = netnode.h \
+ resources.h \
+ system.h \
+ asline.h \
+ GUIUtils.h \
+ asconnection.h \
+ asfullsetup.h \
+ systemfile.h \
+ asdevice.h
+SOURCES = netnode.cpp \
+ GUIUtils.cpp \
+ system.cpp \
+ systemfile.cpp \
+ resources.cpp
+INCLUDEPATH += $(OPIEDIR)/include ../networksettings2
+DEPENDPATH += $(OPIEDIR)/include
+LIBS += -lqpe -lopie
+INTERFACES =
+TARGET = networksettings2
+VERSION = 1.0.0
+
+include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/networksettings2/networksettings2/resources.cpp b/noncore/settings/networksettings2/networksettings2/resources.cpp
new file mode 100644
index 0000000..ff6e457
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/resources.cpp
@@ -0,0 +1,236 @@
+#include <qpixmap.h>
+#include <qpe/qlibrary.h>
+#include <qpe/qpeapplication.h>
+#include <qdir.h>
+#include <qtopia/resource.h>
+
+#include "netnode.h"
+#include "resources.h"
+
+#define PLUGINDIR "plugins/networksettings2"
+#define ICONDIR "/pics/networksettings2/"
+
+// single resources instance
+TheNSResources * _NSResources = 0;
+
+TheNSResources::TheNSResources( void ) : NodeTypeNameMap(),
+ ConnectionsMap() {
+
+ _NSResources = this;
+
+ // load available netnodes
+ findAvailableNetNodes(QPEApplication::qpeDir() + PLUGINDIR );
+
+ // compile provides and needs lists
+ { const char ** NeedsRun;
+ QDictIterator<NetNode_t> OuterIt( AllNodeTypes );
+ bool Done;
+
+ for ( ; OuterIt.current(); ++OuterIt ) {
+ // find needs list
+ ANetNode::NetNodeList * NNLP = new ANetNode::NetNodeList;
+ ANetNode::NetNodeList & NNL = *(NNLP);
+
+ // must iterate this way to avoid duplication pointers
+ for ( QDictIterator<NetNode_t> InnerIt( AllNodeTypes );
+ InnerIt.current(); ++InnerIt ) {
+ if( InnerIt.current() == OuterIt.current() )
+ // avoid recursive
+ continue;
+
+ const char * Provides = InnerIt.current()->NetNode->provides();
+ NeedsRun = OuterIt.current()->NetNode->needs();
+ for( ; *NeedsRun; NeedsRun ++ ) {
+ if( strcmp( Provides, *NeedsRun ) == 0 ) {
+ // inner provides what outer needs
+ NNL.resize( NNL.size() + 1 );
+ NNL[NNL.size()-1] = InnerIt.current()->NetNode;
+ Done = 1; // break from 2 loops
+ break;
+ }
+ }
+ }
+ OuterIt.current()->NetNode->setAlternatives( NNLP );
+ }
+ }
+
+ // define Node types to Description map
+ NodeTypeNameMap.insert( "device", tr( "Network Device" ) );
+ NodeTypeNameMap.insert( "line", tr( "Character device" ) );
+ NodeTypeNameMap.insert( "connection", tr( "IP Connection" ) );
+ NodeTypeNameMap.insert( "fullsetup", tr( "Connection Profile" ) );
+
+ NodeTypeDescriptionMap.insert( "device",
+ tr( "<p>Devices that can handle IP packets</p>" ) );
+ NodeTypeDescriptionMap.insert( "line",
+ tr( "<p>Devices that can handle single bytes</p>" ) );
+ NodeTypeDescriptionMap.insert( "connection",
+ tr( "<p>Nodes that provide working IP connections</p>" ) );
+ NodeTypeDescriptionMap.insert( "fullsetup",
+ tr( "<p>Fully configured connection profile</p>" ) );
+
+ // define system files
+ addSystemFile( new SystemFile( "interfaces", "./interfaces" ) );
+
+ // get access to the system
+ TheSystem = new System();
+}
+
+TheNSResources::~TheNSResources( void ) {
+ delete TheSystem;
+}
+
+/**
+ * Load all modules that are found in the path
+ * @param path a directory that is scaned for any plugins that can be loaded
+ * and attempts to load them
+ */
+void TheNSResources::findAvailableNetNodes(const QString &path){
+
+ QDir d(path);
+ if(!d.exists())
+ return;
+
+ QString lang = ::getenv("LANG");
+
+ // Don't want sym links
+ d.setFilter( QDir::Files | QDir::NoSymLinks );
+ const QFileInfoList *list = d.entryInfoList();
+ QFileInfoListIterator it( *list );
+ QFileInfo *fi;
+
+ while ( (fi=it.current()) ) {
+
+ if( fi->fileName().contains(".so")){
+ /* if loaded install translation */
+ if( loadNetNode(path + "/" + fi->fileName()) ) {
+ QTranslator *trans = new QTranslator(qApp);
+ QString fn = QPEApplication::qpeDir()+
+ "/i18n/"+lang+"/"+
+ fi->fileName().left( fi->fileName().find(".") )+
+ ".qm";
+
+ if( trans->load( fn ) )
+ qApp->installTranslator( trans );
+ else
+ delete trans;
+ }
+ }
+ ++it;
+ }
+}
+
+/**
+ * Attempt to load a function and resolve a function.
+ * @param pluginFileName - the name of the file in which to attempt to load
+ * @param resolveString - function pointer to resolve
+ * @return true of loading is successful
+ */
+bool TheNSResources::loadNetNode(
+ const QString &pluginFileName, const QString &resolveString){
+
+ QLibrary *lib = new QLibrary(pluginFileName);
+ void * res = lib->resolve(resolveString);
+ if( ! res ){
+#ifdef DEBUG
+ qDebug("loadNetNode: Warning: %s is not a plugin", pluginFileName.latin1());
+#endif
+ delete lib;
+ return 0;
+ }
+
+ GetNetNodeListFt_t getNetNodeList = (GetNetNodeListFt_t)res;
+
+ // Try to get an object.
+ QList<ANetNode> PNN;
+
+ getNetNodeList( PNN );
+ if( PNN.isEmpty() ) {
+#ifdef DEBUG
+ qDebug("loadNetNode: Couldn't get node list, but did load library!");
+#endif
+ delete lib;
+ return 0;
+ }
+
+ ANetNode * NNP;
+ for( QListIterator<ANetNode> it(PNN);
+ it.current();
+ ++it ) {
+ NetNode_t * NN;
+
+ NNP = it.current();
+ NN = new NetNode_t;
+ NN->NetNode = NNP;
+ NN->TheLibrary = lib;
+ NN->NodeCountInLib = PNN.count();
+
+ // store mapping
+ AllNodeTypes.insert( NN->NetNode->nodeName(), NN );
+ }
+
+ return 1;
+}
+
+QPixmap TheNSResources::getPixmap( const QString & QS ) {
+ return Resource::loadPixmap( QString("networksettings2")+QS );
+}
+
+QString TheNSResources::tr( const char * s ) {
+ return qApp->translate( "resource", 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 ) {
+ ANetNodeInstance * NNI;
+ ConnectionsMap.insert( NC->name(), NC );
+ // add (new) nodes to NodeList
+ for( QListIterator<ANetNodeInstance> it(*NC);
+ it.current();
+ ++it ) {
+ NNI = it.current();
+ if( findNodeInstance( NNI->nodeName() ) == 0 ) {
+ // new item
+ addNodeInstance( NNI );
+ }
+ }
+}
+
+void TheNSResources::removeConnection( const QString & N ) {
+ NodeCollection * NC = findConnection( N );
+ if( ! NC )
+ return;
+
+ // delete netnodes in this connection
+ ANetNodeInstance * NNI;
+ for( NNI = NC->first(); NNI != 0; NNI = NC->next() ) {
+ removeNodeInstance( NNI->nodeName() );
+ }
+ ConnectionsMap.remove( N );
+}
+
+NodeCollection * TheNSResources::findConnection( const QString & S ) {
+ return ConnectionsMap[ S ];
+}
+
+void TheNSResources::renumberConnections( void ) {
+ Name2Connection_t & M = NSResources->connections();
+ NodeCollection * NC;
+
+ // for all connections
+ NodeCollection::resetMaxNr();
+ for( QDictIterator<NodeCollection> it(M);
+ it.current();
+ ++it ) {
+ NC = it.current();
+ NC->setNumber( NC->maxConnectionNumber()+1 );
+ NC->setModified( 1 );
+ }
+}
diff --git a/noncore/settings/networksettings2/networksettings2/resources.h b/noncore/settings/networksettings2/networksettings2/resources.h
new file mode 100644
index 0000000..cfa0b7a
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/resources.h
@@ -0,0 +1,105 @@
+#ifndef __RESOURCES__H
+#define __RESOURCES__H
+
+#include <qstring.h>
+#include <qdict.h>
+#include <qmap.h>
+#include <qlist.h>
+#include "netnode.h"
+#include "systemfile.h"
+#include "system.h"
+
+class QLibrary;
+class QPixmap;
+class ANetNode;
+class ANetNodeInstance;
+
+typedef void (*GetNetNodeListFt_t)(QList<ANetNode>& PNN );
+
+typedef struct NetNode_S {
+ ANetNode * NetNode;
+ QLibrary * TheLibrary;
+ long NodeCountInLib;
+} NetNode_t;
+
+typedef QDict<NetNode_t> Name2NetNode_t;
+typedef QDict<ANetNodeInstance > Name2Instance_t;
+typedef QDict<NodeCollection> Name2Connection_t;
+typedef QDict<SystemFile> Name2SystemFile_t;
+
+class TheNSResources {
+
+public :
+
+ TheNSResources( void );
+ ~TheNSResources( );
+
+ System & system()
+ { return *TheSystem; }
+
+ QPixmap getPixmap( const QString & Name );
+
+ Name2NetNode_t & netNodes( void )
+ { return AllNodeTypes; }
+ bool netNodeExists( const QString & X )
+ { return AllNodeTypes.find(X)!=0; }
+
+ Name2SystemFile_t & systemFiles( void )
+ { return SystemFiles; }
+ void addSystemFile( SystemFile * SF )
+ { SystemFiles.insert( SF->name(), SF ); }
+
+ ANetNodeInstance * createNodeInstance( const QString & S )
+ { ANetNodeInstance * NNI = 0;
+ NetNode_t * NNT = AllNodeTypes[S];
+ if( NNT ) {
+ NNI = NNT->NetNode->createInstance();
+ NNI->initialize();
+ }
+ return NNI;
+ }
+
+ Name2Instance_t & netNodeInstances( void )
+ { return AllNodes; }
+ void addNodeInstance( ANetNodeInstance * I )
+ { AllNodes.insert( I->nodeName(), I ); }
+ void removeNodeInstance( const QString & N )
+ { AllNodes.remove( N );}
+ ANetNodeInstance * findNodeInstance( const QString & S )
+ { return (AllNodes.find(S)!=0) ? AllNodes[S] : 0; }
+
+ const QString & netNode2Name( const char * Type );
+ const QString & netNode2Description( const char * Type );
+
+ void renumberConnections( void );
+ void addConnection( NodeCollection * NC );
+ void removeConnection( const QString & N );
+ NodeCollection * findConnection( const QString & N );
+ Name2Connection_t & connections( void )
+ { return ConnectionsMap; }
+
+private :
+
+ QString tr( const char * path );
+ void findAvailableNetNodes( const QString &path );
+ bool loadNetNode(
+ const QString &pluginFileName,
+ const QString &resolveString = "create_plugin");
+
+ QMap< QString, QString> NodeTypeNameMap;
+ QMap< QString, QString> NodeTypeDescriptionMap;
+ Name2Connection_t ConnectionsMap;
+ System * TheSystem;
+ Name2SystemFile_t SystemFiles;
+
+ // all node type classes
+ Name2NetNode_t AllNodeTypes;
+
+ // all nodes
+ Name2Instance_t AllNodes;
+};
+
+extern TheNSResources * _NSResources;
+#define NSResources _NSResources
+
+#endif
diff --git a/noncore/settings/networksettings2/networksettings2/system.cpp b/noncore/settings/networksettings2/networksettings2/system.cpp
new file mode 100644
index 0000000..99f642e
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/system.cpp
@@ -0,0 +1,318 @@
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+
+#include "resources.h"
+#include "system.h"
+
+#define PROCNETDEV "/proc/net/dev"
+
+static char Dig2Hex[] = {
+ '0', '1', '2', '3',
+ '4', '5', '6', '7',
+ '8', '9', 'A', 'B',
+ 'C', 'D', 'E', 'F'
+};
+
+// get HIGH nibble of byte
+#define HN(x) Dig2Hex[(((x)&0xf0)>>4)]
+// get LOW nibble of byte
+#define LN(x) Dig2Hex[((x)&0x0f)]
+
+System::System( void ) : ProbedInterfaces() {
+ probeInterfaces();
+}
+
+System::~System( void ) {
+ if( ProcDevNet )
+ delete ProcDevNet;
+}
+
+int System::execute( const QString & S ) {
+ QString MyS = S;
+ int rv;
+
+ if( S.isEmpty() ) {
+ // loophole to start shell
+ return 8888;
+ }
+ if( getenv("USER") != "root" ) {
+ // use SUDO
+ MyS.prepend( "sudo " );
+ }
+
+ fprintf( stderr, "Executing %s\n", MyS.latin1() );
+
+ rv = system( MyS.latin1() ) ;
+ switch( rv ) {
+ case -1 :
+ // cannot fork
+ return 1;
+ case 127 :
+ // cannot start shell
+ return 2;
+ default :
+ if( WEXITSTATUS(rv) != 0 ) {
+ // error in command
+ return 3;
+ }
+ }
+ // all is fine
+ return 0;
+}
+
+void System::refreshStatistics( InterfaceInfo & I ) {
+ if( ! ProcDevNet ) {
+ return;
+ }
+ // cannot seek on dev
+ ProcDevNet->close();
+ ProcDevNet->open( IO_ReadOnly );
+
+ QString line;
+ QTextStream procTs(ProcDevNet);
+ QStringList SL;
+ int loc = -1;
+ int version;
+
+ procTs.readLine();
+ line = procTs.readLine();
+ // get version
+ if( line.find("compressed") )
+ version = 3;
+ else if( line.find( "bytes" ) )
+ version = 2;
+ else
+ version = 1;
+ while((line = procTs.readLine().simplifyWhiteSpace()) != QString::null) {
+ if( (loc = line.find(":") ) == -1) {
+ continue;
+ }
+
+ if( I.Name != line.left(loc) )
+ continue;
+
+ // tokenize
+ SL = QStringList::split( ' ', line, FALSE );
+
+ // update data
+ switch( version ) {
+ case 1 :
+ I.RcvBytes = SL[1];
+ I.RcvErrors = SL[3];
+ I.RcvDropped = SL[4];
+ I.SndBytes = SL[6];
+ I.SndErrors = SL[8];
+ I.SndDropped = SL[9];
+ I.Collisions = SL[11];
+ break;
+ case 2 :
+ I.RcvBytes = SL[1];
+ I.RcvErrors = SL[3];
+ I.RcvDropped = SL[4];
+ I.SndBytes = SL[7];
+ I.SndErrors = SL[9];
+ I.SndDropped = SL[10];
+ I.Collisions = SL[12];
+ break;
+ case 3 :
+ I.RcvBytes = SL[1];
+ I.RcvErrors = SL[3];
+ I.RcvDropped = SL[4];
+ I.SndBytes = SL[9];
+ I.SndErrors = SL[11];
+ I.SndDropped = SL[12];
+ I.Collisions = SL[14];
+ break;
+ }
+ break;
+ }
+}
+
+//
+// THIS UPDATES THE LIST -> INTERFACES ARE NOT DELETED BUT
+// FLAGGED AS ! 'IsUp' IF NO LONGER PRESENT
+//
+
+void System::probeInterfaces( void ) {
+
+ // probe interfaces
+ int sockfd;
+ // get list of all interfaces
+ struct ifreq ifrs;
+ InterfaceInfo * IFI;
+
+ // flag all as 'down'
+ for( QDictIterator<InterfaceInfo> it( ProbedInterfaces );
+ it.current();
+ ++it ) {
+ it.current()->IsUp = 0;
+ }
+
+ sockfd = socket(PF_INET, SOCK_DGRAM, 0);
+ if(sockfd == -1)
+ return;
+
+ // read interfaces from /proc/dev/net
+ // SIOCGIFCONF does not return ALL interfaces ???!?
+ ProcDevNet = new QFile(PROCNETDEV);
+ if( ! ProcDevNet->open(IO_ReadOnly) ) {
+ delete ProcDevNet;
+ ProcDevNet =0;
+ return;
+ }
+
+ QString line;
+ QString NicName;
+ QTextStream procTs(ProcDevNet);
+ int loc = -1;
+
+ procTs.readLine(); // eat a line
+ procTs.readLine(); // eat a line
+ while((line = procTs.readLine().simplifyWhiteSpace()) != QString::null) {
+ if((loc = line.find(":")) == -1) {
+ continue;
+ }
+
+ NicName = line.left(loc);
+
+ // set name for ioctl
+ strcpy( ifrs.ifr_name, NicName.latin1() );
+
+ if ( ! ( IFI = ProbedInterfaces.find( NicName ) ) ) {
+ // new nic
+ fprintf( stderr, "NEWNIC %s\n", NicName.latin1());
+ IFI = new InterfaceInfo;
+ IFI->Name = line.left(loc);
+ IFI->NetNode = 0;
+ ProbedInterfaces.insert( IFI->Name, IFI );
+
+ // get dynamic info
+ if( ioctl(sockfd, SIOCGIFFLAGS, &ifrs) >= 0 ) {
+ IFI->IsPointToPoint = ((ifrs.ifr_flags & IFF_POINTOPOINT) == IFF_POINTOPOINT);
+ } else {
+ IFI->IsPointToPoint = 0;
+ }
+
+ // settings that never change
+ IFI->DstAddress = "";
+
+ if( IFI->IsPointToPoint ) {
+ if( ioctl(sockfd, SIOCGIFDSTADDR, &ifrs) >= 0 ) {
+ IFI->DstAddress =
+ inet_ntoa(((struct sockaddr_in*)&ifrs.ifr_dstaddr)->sin_addr);
+ }
+ }
+
+ IFI->CardType = 999999;
+ IFI->MACAddress = "";
+
+ if( ioctl(sockfd, SIOCGIFHWADDR, &ifrs) >= 0 ) {
+ fprintf( stderr, "%s = %d\n", IFI->Name.latin1(),
+ ifrs.ifr_hwaddr.sa_family );
+
+ IFI->CardType = ifrs.ifr_hwaddr.sa_family;
+ switch( ifrs.ifr_hwaddr.sa_family ) {
+ case ARPHRD_ETHER : // regular MAC address
+ // valid address -> convert to regular ::: format
+ // length = 6 bytes = 12 DIGITS -> 6 :
+ IFI->MACAddress.sprintf(
+ "%c%c:%c%c:%c%c:%c%c:%c%c:%c%c",
+ HN( ifrs.ifr_hwaddr.sa_data[0] ),
+ LN( ifrs.ifr_hwaddr.sa_data[0] ),
+ HN( ifrs.ifr_hwaddr.sa_data[1] ),
+ LN( ifrs.ifr_hwaddr.sa_data[1] ),
+ HN( ifrs.ifr_hwaddr.sa_data[2] ),
+ LN( ifrs.ifr_hwaddr.sa_data[2] ),
+ HN( ifrs.ifr_hwaddr.sa_data[3] ),
+ LN( ifrs.ifr_hwaddr.sa_data[3] ),
+ HN( ifrs.ifr_hwaddr.sa_data[4] ),
+ LN( ifrs.ifr_hwaddr.sa_data[4] ),
+ HN( ifrs.ifr_hwaddr.sa_data[5] ),
+ LN( ifrs.ifr_hwaddr.sa_data[5] )
+ );
+ break;
+#ifdef ARPHRD_IEEE1394
+ case ARPHRD_IEEE1394 : // Firewire Eth address
+ IFI->MACAddress.sprintf(
+ "%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-00-00",
+ HN( ifrs.ifr_hwaddr.sa_data[0] ),
+ LN( ifrs.ifr_hwaddr.sa_data[0] ),
+ HN( ifrs.ifr_hwaddr.sa_data[1] ),
+ LN( ifrs.ifr_hwaddr.sa_data[1] ),
+ HN( ifrs.ifr_hwaddr.sa_data[2] ),
+ LN( ifrs.ifr_hwaddr.sa_data[2] ),
+ HN( ifrs.ifr_hwaddr.sa_data[3] ),
+ LN( ifrs.ifr_hwaddr.sa_data[3] ),
+ HN( ifrs.ifr_hwaddr.sa_data[4] ),
+ LN( ifrs.ifr_hwaddr.sa_data[4] ),
+ HN( ifrs.ifr_hwaddr.sa_data[5] ),
+ LN( ifrs.ifr_hwaddr.sa_data[5] ),
+ HN( ifrs.ifr_hwaddr.sa_data[6] ),
+ LN( ifrs.ifr_hwaddr.sa_data[6] ),
+ HN( ifrs.ifr_hwaddr.sa_data[7] ),
+ LN( ifrs.ifr_hwaddr.sa_data[7] ),
+ HN( ifrs.ifr_hwaddr.sa_data[8] ),
+ LN( ifrs.ifr_hwaddr.sa_data[8] ),
+ HN( ifrs.ifr_hwaddr.sa_data[9] ),
+ LN( ifrs.ifr_hwaddr.sa_data[9] ),
+ HN( ifrs.ifr_hwaddr.sa_data[10] ),
+ LN( ifrs.ifr_hwaddr.sa_data[10] ),
+ HN( ifrs.ifr_hwaddr.sa_data[11] ),
+ LN( ifrs.ifr_hwaddr.sa_data[11] ),
+ HN( ifrs.ifr_hwaddr.sa_data[12] ),
+ LN( ifrs.ifr_hwaddr.sa_data[12] ),
+ HN( ifrs.ifr_hwaddr.sa_data[13] ),
+ LN( ifrs.ifr_hwaddr.sa_data[13] )
+ );
+ break;
+#endif
+ case ARPHRD_PPP : // PPP
+ break;
+ case ARPHRD_IEEE80211 : // WLAN
+ break;
+ case ARPHRD_IRDA : // IRDA
+ break;
+ }
+ }
+ } else // else already probed before -> just update
+ fprintf( stderr, "OLDNIC %s\n", NicName.latin1());
+
+ // get dynamic info
+ if( ioctl(sockfd, SIOCGIFFLAGS, &ifrs) >= 0 ) {
+ IFI->IsUp = ((ifrs.ifr_flags & IFF_UP) == IFF_UP);
+ IFI->HasMulticast = ((ifrs.ifr_flags & IFF_MULTICAST) == IFF_MULTICAST);
+ } else {
+ IFI->IsUp = 0;
+ IFI->HasMulticast = 0;
+ }
+
+ if( ioctl(sockfd, SIOCGIFADDR, &ifrs) >= 0 ) {
+ IFI->Address =
+ inet_ntoa(((struct sockaddr_in*)&ifrs.ifr_addr)->sin_addr);
+ } else {
+ IFI->Address = "";
+ IFI->IsUp = 0;
+ }
+ if( ioctl(sockfd, SIOCGIFBRDADDR, &ifrs) >= 0 ) {
+ IFI->BCastAddress =
+ inet_ntoa(((struct sockaddr_in*)&ifrs.ifr_broadaddr)->sin_addr);
+ } else {
+ IFI->BCastAddress = "";
+ }
+ if( ioctl(sockfd, SIOCGIFNETMASK, &ifrs) >= 0 ) {
+ IFI->Netmask =
+ inet_ntoa(((struct sockaddr_in*)&ifrs.ifr_netmask)->sin_addr);
+ } else {
+ IFI->Netmask = "";
+ }
+ }
+}
diff --git a/noncore/settings/networksettings2/networksettings2/system.h b/noncore/settings/networksettings2/networksettings2/system.h
new file mode 100644
index 0000000..f89fe5d
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/system.h
@@ -0,0 +1,76 @@
+#ifndef __SYSTEM__H
+#define __SYSTEM__H
+
+// for hardware types
+#include <net/if_arp.h>
+#include <qdict.h>
+
+class ANetNodeInstance;
+class QFile;
+
+class InterfaceInfo {
+
+public :
+
+ InterfaceInfo() :
+ Name(),
+ MACAddress(),
+ BCastAddress(),
+ Netmask(),
+ DstAddress() {
+ }
+
+ ANetNodeInstance * assignedNode()
+ { return NetNode; }
+
+ void assignNode( ANetNodeInstance * NNI )
+ { NetNode = NNI; }
+
+ ANetNodeInstance * NetNode; // netnode 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
+ bool HasMulticast; // Supports Multicast
+ bool IsPointToPoint; // IsPointToPoint card
+
+ QString RcvBytes;
+ QString SndBytes;
+ QString RcvErrors;
+ QString SndErrors;
+ QString RcvDropped;
+ QString SndDropped;
+ QString Collisions;
+};
+
+class System {
+
+public :
+
+ System( void );
+ ~System( void );
+
+ QDict<InterfaceInfo> & interfaces( void )
+ { return ProbedInterfaces; }
+ InterfaceInfo * interface( const QString& N )
+ { return ProbedInterfaces[N]; }
+
+ int execute( const QString & S );
+ // refresh stats for this interface
+ void refreshStatistics( InterfaceInfo & );
+
+ // reloads interfaces
+ void probeInterfaces( void );
+
+private :
+
+ QDict<InterfaceInfo> ProbedInterfaces;
+ QFile * ProcDevNet;
+
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/networksettings2/systemfile.cpp b/noncore/settings/networksettings2/networksettings2/systemfile.cpp
new file mode 100644
index 0000000..7249976
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/systemfile.cpp
@@ -0,0 +1,144 @@
+#include <stdio.h>
+#include <qpe/qpeapplication.h>
+#include <qfileinfo.h>
+#include <qmessagebox.h>
+#include <qfile.h>
+#include <qtextstream.h>
+
+#include "resources.h"
+#include "systemfile.h"
+
+#define TEMPLATEDIR "networktemplates/"
+QString TemplDir;
+
+SystemFile::SystemFile( const QString & N, const QString & P ){
+ Name = N;
+ Path = P;
+ F = 0;
+ // get template info
+ { QString S;
+ QFileInfo FI;
+
+ // find location of templates
+ TemplDir = QPEApplication::qpeDir() + "etc/" + TEMPLATEDIR;
+ FI.setFile( TemplDir );
+ if( ! FI.isDir() ) {
+ // try current dir
+ TemplDir = "./" TEMPLATEDIR;
+ FI.setFile( TemplDir );
+ if( ! FI.isDir() ) {
+ hasPreSection =
+ hasPostSection =
+ hasPreNodeSection =
+ hasPostNodeSection = 0;
+ return;
+ }
+ }
+
+ // have found location
+ S = TemplDir + Name + "/presection";
+ FI.setFile( S );
+ hasPreSection = ( FI.exists() && FI.isReadable() );
+ S = TemplDir + Name + "/postsection";
+ FI.setFile( S );
+ hasPostSection = ( FI.exists() && FI.isReadable() );
+ S = TemplDir + Name + "/prenodesection";
+ FI.setFile( S );
+ hasPreNodeSection = ( FI.exists() && FI.isReadable() );
+ S = TemplDir + Name + "/postnodesection";
+ FI.setFile( S );
+ hasPostNodeSection = ( FI.exists() && FI.isReadable() );
+ }
+}
+
+SystemFile::~SystemFile( void ) {
+ if( F )
+ delete F;
+}
+
+bool SystemFile::open( void ) {
+ if( F ) {
+ F->close();
+ delete F;
+ }
+
+ F = new QFile( Path + "bup" );
+ if( ! F->open( IO_WriteOnly ) ) {
+ return 0;
+ }
+ setDevice( F );
+ return 1;
+}
+
+bool SystemFile::close( void ) {
+ if( ! F ) {
+ return 1 ;
+ }
+
+ QString OldP = Path + "bup";
+
+ F->close();
+ delete F;
+ F = 0;
+
+ return ( rename( OldP.latin1(), Path.latin1() ) >= 0 );
+}
+
+bool SystemFile::preSection( void ) {
+ if( hasPreSection ) {
+ QFile Fl( TemplDir + Name + "/presection" );
+ if( ! Fl.open( IO_ReadOnly ) )
+ return 1; // error
+ // copy file to this file
+ F->writeBlock( Fl.readAll() );
+ }
+ return 0;
+}
+
+bool SystemFile::postSection( void ) {
+ if( hasPostSection ) {
+ QFile Fl( TemplDir + Name + "/postsection" );
+ if( ! Fl.open( IO_ReadOnly ) )
+ return 1; // error
+ // copy file to this file
+ F->writeBlock( Fl.readAll() );
+ }
+ return 0;
+}
+
+bool SystemFile::preNodeSection( ANetNodeInstance * NNI, long ) {
+ if( hasPreNodeSection ) {
+ QFile Fl( TemplDir + Name + "/prenodesectoin" );
+ if( ! Fl.open( IO_ReadOnly ) )
+ return 1; // error
+ QTextStream TX( &Fl );
+ QString Out;
+ QString S = TX.readLine();
+ while( ! TX.eof() ) {
+ Out = S.
+ arg(NNI->netNode()->nodeName());
+ (*this) << Out << endl;
+ S = TX.readLine();
+ }
+ }
+ return 0;
+}
+
+bool SystemFile::postNodeSection( ANetNodeInstance * NNI, long DevNr ) {
+ if( hasPostNodeSection ) {
+ QFile Fl( TemplDir + Name + "/postnodesectoin" );
+ if( ! Fl.open( IO_ReadOnly ) )
+ return 1; // error
+ QTextStream TX( &Fl );
+ QString Out;
+ QString S = TX.readLine();
+ while( ! TX.eof() ) {
+ Out = S.
+ arg(NNI->nodeName());
+ (*this) << Out << endl;
+ S = TX.readLine();
+ }
+ }
+ return 0;
+}
+
diff --git a/noncore/settings/networksettings2/networksettings2/systemfile.h b/noncore/settings/networksettings2/networksettings2/systemfile.h
new file mode 100644
index 0000000..8b6bcb9
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettings2/systemfile.h
@@ -0,0 +1,39 @@
+#ifndef __SYSTEMFILE__H
+#define __SYSTEMFILE__H
+
+#include <qstring.h>
+#include <qtextstream.h>
+
+class QFile;
+class ANetNodeInstance;
+
+class SystemFile : public QTextStream {
+
+public :
+
+ SystemFile( const QString & Name, const QString & Path );
+ ~SystemFile( void );
+
+ const QString & name( void )
+ { return Name; }
+
+ bool open( void );
+ bool close( void );
+
+ bool preSection( void );
+ bool postSection( void );
+ bool preNodeSection( ANetNodeInstance * NNI, long DevNr );
+ bool postNodeSection( ANetNodeInstance * NNI, long DevNr );
+
+private :
+
+ QString Name;
+ QString Path;
+ QFile * F;
+ bool hasPreSection;
+ bool hasPreNodeSection;
+ bool hasPostSection;
+ bool hasPostNodeSection;
+
+};
+#endif
diff --git a/noncore/settings/networksettings2/networksettingsGUI.ui b/noncore/settings/networksettings2/networksettingsGUI.ui
new file mode 100644
index 0000000..d457c35
--- a/dev/null
+++ b/noncore/settings/networksettings2/networksettingsGUI.ui
@@ -0,0 +1,598 @@
+<!DOCTYPE UI><UI>
+<class>NetworkSettingsGUI</class>
+<widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>NetworkSettingsGUI</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>403</width>
+ <height>502</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>Network Settings</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame4</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Add_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Delete_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>CheckState_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>GenConfig_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</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>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>On_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ <property stdset="1">
+ <name>toggleButton</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>toggleButton</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Enable_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ <property stdset="1">
+ <name>toggleButton</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>toggleButton</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Connect_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ <property stdset="1">
+ <name>toggleButton</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>toggleButton</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QIconView</class>
+ <item>
+ <property>
+ <name>text</name>
+ <string>New Item</string>
+ </property>
+ <property>
+ <name>pixmap</name>
+ <pixmap>image0</pixmap>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>New Item</string>
+ </property>
+ <property>
+ <name>pixmap</name>
+ <pixmap>image0</pixmap>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>New Item</string>
+ </property>
+ <property>
+ <name>pixmap</name>
+ <pixmap>image0</pixmap>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>New Item</string>
+ </property>
+ <property>
+ <name>pixmap</name>
+ <pixmap>image0</pixmap>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>New Item</string>
+ </property>
+ <property>
+ <name>pixmap</name>
+ <pixmap>image0</pixmap>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>New Item</string>
+ </property>
+ <property>
+ <name>pixmap</name>
+ <pixmap>image0</pixmap>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>New Item</string>
+ </property>
+ <property>
+ <name>pixmap</name>
+ <pixmap>image0</pixmap>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>New Item</string>
+ </property>
+ <property>
+ <name>pixmap</name>
+ <pixmap>image0</pixmap>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>New Item</string>
+ </property>
+ <property>
+ <name>pixmap</name>
+ <pixmap>image0</pixmap>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>New Item</string>
+ </property>
+ <property>
+ <name>pixmap</name>
+ <pixmap>image0</pixmap>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>New Item</string>
+ </property>
+ <property>
+ <name>pixmap</name>
+ <pixmap>image0</pixmap>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>New Item</string>
+ </property>
+ <property>
+ <name>pixmap</name>
+ <pixmap>image0</pixmap>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>New Item</string>
+ </property>
+ <property>
+ <name>pixmap</name>
+ <pixmap>image0</pixmap>
+ </property>
+ </item>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Profiles_IV</cstring>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>5</number>
+ </property>
+ <property stdset="1">
+ <name>itemsMovable</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>showToolTips</name>
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>QGroupBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>CurProfile_GB</cstring>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string></string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>4</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout3</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>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>State</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>State_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>State</string>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer6</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>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Description_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string></string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignTop|AlignLeft</set>
+ </property>
+ <property>
+ <name>vAlign</name>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+</widget>
+<images>
+ <image>
+ <name>image0</name>
+ <data format="XPM.GZ" length="1347">789c7dd3c14ac4301405d07dbf22f4ed8a743ace0882f8098a4b415ca4c92475310a3a2e44fc777393a64df2dabed7452e1c6eb368778d787e7a10cdaefabac8cb9b126a909fa2d1dfe7f3cfcbebfd6f551fae857bf69dd8d75755dd0a251e3fde4f38933b53e707b10f518df18478e8b08803e271c21af1e6168b681165e7f688681055874594211a13a242347efc95da9688dad58946ca75e58d6be9e5ba0a46e92d351a952aa2d3b2495459989849f949546632b5688c32c65aeadde428ed0132da23306e4c5863f1ba017042738f6fc138a5fdbd0a135b2203ec7bca7b723022e23d19628601cb0d6f59e8612dce0c2b2641658fb5650b375a0795a2c2b8afcaaba4859ba852c4cda4364da9964daed64caa60c2475d9a590503c54d54d1d0a2096abb67541bf79955fc0debbfbbea1f81b84f0e</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>Add_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkSettingsGUI</receiver>
+ <slot>SLOT_AddNode()</slot>
+ </connection>
+ <connection>
+ <sender>Delete_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkSettingsGUI</receiver>
+ <slot>SLOT_DeleteNode()</slot>
+ </connection>
+ <connection>
+ <sender>CheckState_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkSettingsGUI</receiver>
+ <slot>SLOT_CheckState()</slot>
+ </connection>
+ <connection>
+ <sender>Enable_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkSettingsGUI</receiver>
+ <slot>SLOT_Enable()</slot>
+ </connection>
+ <connection>
+ <sender>Connect_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkSettingsGUI</receiver>
+ <slot>SLOT_Connect()</slot>
+ </connection>
+ <connection>
+ <sender>On_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkSettingsGUI</receiver>
+ <slot>SLOT_On()</slot>
+ </connection>
+ <connection>
+ <sender>GenConfig_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkSettingsGUI</receiver>
+ <slot>SLOT_GenerateConfig()</slot>
+ </connection>
+ <connection>
+ <sender>Profiles_IV</sender>
+ <signal>selectionChanged(QIconViewItem*)</signal>
+ <receiver>NetworkSettingsGUI</receiver>
+ <slot>SLOT_ShowNode( QIconViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>Profiles_IV</sender>
+ <signal>doubleClicked(QIconViewItem*)</signal>
+ <receiver>NetworkSettingsGUI</receiver>
+ <slot>SLOT_EditNode( QIconViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>Profiles_IV</sender>
+ <signal>currentChanged(QIconViewItem*)</signal>
+ <receiver>NetworkSettingsGUI</receiver>
+ <slot>SLOT_ShowNode( QIconViewItem*)</slot>
+ </connection>
+ <slot access="public">SLOT_AddNode()</slot>
+ <slot access="public">SLOT_CheckState()</slot>
+ <slot access="public">SLOT_Connect()</slot>
+ <slot access="public">SLOT_DeleteNode()</slot>
+ <slot access="public">SLOT_EditNode( QIconViewItem*)</slot>
+ <slot access="public">SLOT_Enable()</slot>
+ <slot access="public">SLOT_GenerateConfig()</slot>
+ <slot access="public">SLOT_On()</slot>
+ <slot access="public">SLOT_ShowNode( QIconViewItem*)</slot>
+</connections>
+</UI>
diff --git a/noncore/settings/networksettings2/networktemplates/interfaces/presection b/noncore/settings/networksettings2/networktemplates/interfaces/presection
new file mode 100644
index 0000000..1fe8396
--- a/dev/null
+++ b/noncore/settings/networksettings2/networktemplates/interfaces/presection
@@ -0,0 +1,5 @@
+auto lo
+
+# The loopback interface
+iface lo inet loopback
+
diff --git a/noncore/settings/networksettings2/opie-networksettings.control b/noncore/settings/networksettings2/opie-networksettings.control
new file mode 100644
index 0000000..82aac2a
--- a/dev/null
+++ b/noncore/settings/networksettings2/opie-networksettings.control
@@ -0,0 +1,10 @@
+Package: opie-networksettings
+Files: plugins/application/libnetworksettings.so* bin/networksettings apps/Settings/networksettings.desktop pics/networksettings/* pics/Network/PPPConnect.png $OPIEDIR/lib/libinterfaces.so* root/usr/bin/changedns bin/getprofile
+Priority: optional
+Section: opie/settings
+Maintainer: Patrick S. Vogt <tille@handhelds.org>
+Architecture: arm
+Depends: task-opie-minimal
+Description: Network settings.
+Replaces: opie-networksetup
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/settings/networksettings2/ppp/PPPAuthGUI.ui b/noncore/settings/networksettings2/ppp/PPPAuthGUI.ui
new file mode 100644
index 0000000..826843a
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPAuthGUI.ui
@@ -0,0 +1,432 @@
+<!DOCTYPE UI><UI>
+<class>PPPAuthGUI</class>
+<widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PPPAuthGUI</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>249</width>
+ <height>209</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>PPPAuth</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QButtonGroup</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string></string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QRadioButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Login_RB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Login</string>
+ </property>
+ <property stdset="1">
+ <name>checked</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer3</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Fixed</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QGroupBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string></string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget row="0" column="0" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>LoginExpect_LE</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>ogin:</string>
+ </property>
+ </widget>
+ <widget row="0" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>LoginSend_LE</cstring>
+ </property>
+ </widget>
+ <widget row="1" column="0" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PasswordExpect_LE</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>assword:</string>
+ </property>
+ </widget>
+ <widget row="1" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PasswordSend_LE</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QRadioButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PapChap_RB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Pap/Chap/EAP</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer3_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Fixed</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QGroupBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>GroupBox3</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string></string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget row="2" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Server</string>
+ </property>
+ </widget>
+ <widget row="3" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_3</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Secret</string>
+ </property>
+ </widget>
+ <widget row="0" column="1" >
+ <class>QComboBox</class>
+ <item>
+ <property>
+ <name>text</name>
+ <string>PAP</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>CHAP</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>EAP</string>
+ </property>
+ </item>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>AuthMethod_CB</cstring>
+ </property>
+ </widget>
+ <widget row="1" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Client</string>
+ </property>
+ </widget>
+ <widget row="0" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_4</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Method</string>
+ </property>
+ </widget>
+ <widget row="1" column="1" rowspan="1" colspan="2" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Client_LE</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>*</string>
+ </property>
+ </widget>
+ <widget row="2" column="1" rowspan="1" colspan="2" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Server_LE</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>*</string>
+ </property>
+ </widget>
+ <widget row="3" column="1" rowspan="1" colspan="2" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Secret_LE</cstring>
+ </property>
+ </widget>
+ <spacer row="0" column="2" >
+ <property>
+ <name>name</name>
+ <cstring>Spacer7</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>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QRadioButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Terminal_RB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Terminal</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>PapChap_RB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>GroupBox3</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>Login_RB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>GroupBox1</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+</UI>
diff --git a/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp b/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp
new file mode 100644
index 0000000..f305cc4
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp
@@ -0,0 +1,85 @@
+#include <stdio.h>
+#include <qcombobox.h>
+#include <qmessagebox.h>
+#include <qradiobutton.h>
+#include <qlineedit.h>
+#include <GUIUtils.h>
+#include "PPPAuthedit.h"
+
+PPPAuthEdit::PPPAuthEdit( QWidget * Parent ) : PPPAuthGUI( Parent ){
+}
+
+QString PPPAuthEdit::acceptable( void ) {
+ if( Login_RB->isChecked() ) {
+ if( LoginSend_LE->text().isEmpty() )
+ return tr("Login send missing");
+ if( LoginExpect_LE->text().isEmpty() )
+ return tr("Login expect missing");
+ if( PasswordSend_LE->text().isEmpty() )
+ return tr("Password send missing");
+ if( PasswordExpect_LE->text().isEmpty() )
+ return tr("Password expect missing");
+ } else if( PapChap_RB->isChecked() ) {
+ if( Client_LE->text().isEmpty() )
+ return tr("Pap/Chap/EAP client id missing");
+ if( Server_LE->text().isEmpty() )
+ return tr("Pap/Chap/EAP server id missing");
+ if( Secret_LE->text().isEmpty() )
+ return tr("Pap/Chap/EAP secret id missing");
+ }
+ return QString();
+}
+
+bool PPPAuthEdit::commit( PPPData_t & D ) {
+ bool SM = 0;
+
+ if( ( D.Auth.Mode == 0 && ! Login_RB->isChecked() ) ||
+ ( D.Auth.Mode == 1 && ! PapChap_RB->isChecked() ) ||
+ ( D.Auth.Mode == 2 && ! Terminal_RB->isChecked() ) ) {
+ // mode modifed
+ SM = 1;
+ D.Auth.Mode = ( Login_RB->isChecked() ) ?
+ 0 :
+ ( ( PapChap_RB->isChecked() ) ?
+ 1 : 2 );
+ }
+
+ if( Login_RB->isChecked() ) {
+ TXTM( D.Auth.Login.Expect, LoginExpect_LE, SM );
+ TXTM( D.Auth.Login.Send, LoginSend_LE, SM );
+ TXTM( D.Auth.Password.Expect, PasswordExpect_LE, SM );
+ TXTM( D.Auth.Password.Send, PasswordSend_LE, SM );
+ } else if( PapChap_RB->isChecked() ) {
+ TXTM( D.Auth.Client, Client_LE, SM );
+ TXTM( D.Auth.Server, Server_LE, SM );
+ TXTM( D.Auth.Secret, Secret_LE, SM );
+ CIM( D.Auth.PCEMode, AuthMethod_CB, SM );
+ }
+ return SM;
+}
+
+void PPPAuthEdit::showData( PPPData_t & D ) {
+
+ switch( D.Auth.Mode ) {
+ case 0 :
+ Login_RB->isChecked();
+ break;
+ case 1 :
+ PapChap_RB->isChecked();
+ break;
+ case 2 :
+ Terminal_RB->isChecked();
+ break;
+ }
+
+ LoginExpect_LE->setText( D.Auth.Login.Expect );
+ PasswordExpect_LE->setText( D.Auth.Password.Expect );
+ LoginSend_LE->setText( D.Auth.Login.Send );
+ PasswordSend_LE->setText( D.Auth.Password.Send );
+
+ Client_LE->setText( D.Auth.Client );
+ Server_LE->setText( D.Auth.Server );
+ Secret_LE->setText( D.Auth.Secret );
+
+ AuthMethod_CB->setCurrentItem( D.Auth.PCEMode );
+}
diff --git a/noncore/settings/networksettings2/ppp/PPPAuthedit.h b/noncore/settings/networksettings2/ppp/PPPAuthedit.h
new file mode 100644
index 0000000..cbd540e
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPAuthedit.h
@@ -0,0 +1,15 @@
+#include "pppdata.h"
+#include "PPPAuthGUI.h"
+
+class PPPAuthEdit : public PPPAuthGUI {
+
+public :
+
+ PPPAuthEdit( QWidget * parent );
+ QString acceptable( void );
+ bool commit( PPPData_t & Data );
+ void showData( PPPData_t & Data );
+
+private :
+
+};
diff --git a/noncore/settings/networksettings2/ppp/PPPDNSGUI.ui b/noncore/settings/networksettings2/ppp/PPPDNSGUI.ui
new file mode 100644
index 0000000..0ed136f
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPDNSGUI.ui
@@ -0,0 +1,340 @@
+<!DOCTYPE UI><UI>
+<class>PPPDNSGUI</class>
+<widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PPPDNSGUI</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>228</width>
+ <height>169</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>PPPDNS</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QButtonGroup</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>ButtonGroup18</cstring>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string></string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QRadioButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DNSServerAssigned_RB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Server assigned</string>
+ </property>
+ <property stdset="1">
+ <name>checked</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>QRadioButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DNSFixed_RB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Fixed</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout13</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer29</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Fixed</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame21</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget row="0" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>DomainName</string>
+ </property>
+ </widget>
+ <widget row="1" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel6</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Address</string>
+ </property>
+ </widget>
+ <widget row="0" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DomainName_LE</cstring>
+ </property>
+ </widget>
+ <widget row="1" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>ServerAddress_LE</cstring>
+ </property>
+ </widget>
+ <widget row="3" column="1" >
+ <class>QListBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Servers_LB</cstring>
+ </property>
+ </widget>
+ <widget row="2" column="1" >
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame22</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Add_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer2</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>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Remove_TB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget row="3" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel7</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>List</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignTop|AlignLeft</set>
+ </property>
+ <property>
+ <name>vAlign</name>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>DNSFixed_RB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Frame21</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>Add_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>PPPDNSGUI</receiver>
+ <slot>SLOT_AddServer()</slot>
+ </connection>
+ <connection>
+ <sender>Remove_TB</sender>
+ <signal>clicked()</signal>
+ <receiver>PPPDNSGUI</receiver>
+ <slot>SLOT_RemoveServer()</slot>
+ </connection>
+ <slot access="public">SLOT_AddServer()</slot>
+ <slot access="public">SLOT_RemoveServer()</slot>
+</connections>
+</UI>
diff --git a/noncore/settings/networksettings2/ppp/PPPDNSedit.cpp b/noncore/settings/networksettings2/ppp/PPPDNSedit.cpp
new file mode 100644
index 0000000..22f8e59
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPDNSedit.cpp
@@ -0,0 +1,108 @@
+#include <qtoolbutton.h>
+#include <qmessagebox.h>
+#include <qlistbox.h>
+#include <qlineedit.h>
+#include <qradiobutton.h>
+#include <resources.h>
+#include <GUIUtils.h>
+#include "PPPDNSedit.h"
+
+PPPDNSEdit::PPPDNSEdit( QWidget * Parent ) : PPPDNSGUI( Parent ){
+
+ Add_TB->setPixmap( NSResources->getPixmap( "add" ) );
+ Remove_TB->setPixmap( NSResources->getPixmap( "remove" ) );
+}
+
+QString PPPDNSEdit::acceptable( void ) {
+ if( DNSFixed_RB->isChecked() ) {
+ if( DomainName_LE->text().isEmpty() )
+ tr("Domainname needed");
+ if( Servers_LB->count() == 0 )
+ tr("DNS Servers needed");
+ }
+ return QString();
+}
+
+bool PPPDNSEdit::commit( PPPData_t & D ) {
+ bool SM = 0;
+
+ CBM( D.DNS.ServerAssigned, DNSServerAssigned_RB, SM );
+ TXTM( D.DNS.DomainName, DomainName_LE, SM );
+
+ // new items in old ?
+ for ( unsigned i = 0; i < Servers_LB->count(); i++ ) {
+ QString S;
+ bool Found;
+ Found = 0;
+ S = Servers_LB->text(i);
+ for ( unsigned j = 0; j < D.DNS.Servers.size(); j++ ) {
+ if( *(D.DNS.Servers[i]) == S ) {
+ // still in list
+ Found = 1;
+ break;
+ }
+ }
+ if( ! Found ) {
+ SM = 1;
+ D.DNS.Servers.resize( D.DNS.Servers.size()+1 );
+ D.DNS.Servers[D.DNS.Servers.size()] = new QString( S );
+ }
+ }
+
+ // old in new ?
+ for ( unsigned j = 0; j < D.DNS.Servers.size(); j++ ) {
+ bool Found;
+ Found = 0;
+ for ( unsigned i = 0; i < Servers_LB->count(); i++ ) {
+ if( *(D.DNS.Servers[j]) == Servers_LB->text(i) ) {
+ // still in list
+ Found = 1;
+ break;
+ }
+ }
+ if( ! Found ) {
+ // old obsolete
+ SM = 1;
+ delete D.DNS.Servers[j];
+ for( unsigned i = j+1; i < D.DNS.Servers.size(); i ++ ) {
+ // compress array
+ D.DNS.Servers[i-1] = D.DNS.Servers[i];
+ }
+ // shrink
+ D.DNS.Servers.resize( D.DNS.Servers.size()-1 );
+ }
+ }
+ return SM;
+}
+
+void PPPDNSEdit::showData( PPPData_t & D) {
+
+ DNSServerAssigned_RB->setChecked( D.DNS.ServerAssigned );
+
+ DomainName_LE->setText( D.DNS.DomainName );
+ for( unsigned i = 0; i < D.DNS.Servers.size(); i ++ ) {
+ Servers_LB->insertItem( *(D.DNS.Servers[i]) );
+ }
+}
+
+void PPPDNSEdit::SLOT_AddServer( void ) {
+ if( ServerAddress_LE->text().isEmpty() )
+ return;
+
+ Servers_LB->insertItem( ServerAddress_LE->text() );
+ ServerAddress_LE->setText( "" );
+}
+
+void PPPDNSEdit::SLOT_RemoveServer( void ) {
+ long i = Servers_LB->currentItem();
+ if( i < 0 )
+ return;
+ Servers_LB->removeItem( i );
+ if( (unsigned) i >= Servers_LB->count() ) {
+ i --;
+ }
+ if( i >= 0 ) {
+ Servers_LB->setCurrentItem( i );
+ }
+
+}
diff --git a/noncore/settings/networksettings2/ppp/PPPDNSedit.h b/noncore/settings/networksettings2/ppp/PPPDNSedit.h
new file mode 100644
index 0000000..43e0067
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPDNSedit.h
@@ -0,0 +1,20 @@
+#include "pppdata.h"
+#include "PPPDNSGUI.h"
+
+class PPPDNSEdit : public PPPDNSGUI {
+
+public :
+
+ PPPDNSEdit( QWidget * parent );
+ QString acceptable( void );
+ bool commit( PPPData_t & Data );
+ void showData( PPPData_t & Data );
+
+public slots :
+
+ void SLOT_AddServer( void );
+ void SLOT_RemoveServer( void );
+
+private :
+
+};
diff --git a/noncore/settings/networksettings2/ppp/PPPGUI.ui b/noncore/settings/networksettings2/ppp/PPPGUI.ui
new file mode 100644
index 0000000..777e4a9
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPGUI.ui
@@ -0,0 +1,103 @@
+<!DOCTYPE UI><UI>
+<class>PPPGUI</class>
+<widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PPPGUI</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>124</width>
+ <height>29</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>PPP</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QComboBox</class>
+ <item>
+ <property>
+ <name>text</name>
+ <string>Authentication</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>IP settings</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>DNS Settings</string>
+ </property>
+ </item>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PPPOptions_CB</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QWidgetStack</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Options_WS</cstring>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>QWidgetStack</class>
+ <header location="global">qwidgetstack.h</header>
+ <sizehint>
+ <width>-1</width>
+ <height>-1</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>7</hordata>
+ <verdata>7</verdata>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ <slot access="public">raiseWidget( int )</slot>
+ </customwidget>
+</customwidgets>
+<images>
+ <image>
+ <name>image0</name>
+ <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>PPPOptions_CB</sender>
+ <signal>activated(int)</signal>
+ <receiver>PPPGUI</receiver>
+ <slot>SLOT_SelectTopic( int )</slot>
+ </connection>
+ <slot access="public">SLOT_SelectTopic( int )</slot>
+</connections>
+</UI>
diff --git a/noncore/settings/networksettings2/ppp/PPPIPGUI.ui b/noncore/settings/networksettings2/ppp/PPPIPGUI.ui
new file mode 100644
index 0000000..f3d5019
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPIPGUI.ui
@@ -0,0 +1,444 @@
+<!DOCTYPE UI><UI>
+<class>PPPIPGUI</class>
+<widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PPPIPGUI</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>133</width>
+ <height>235</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>PPPIP</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>3</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QButtonGroup</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>ButtonGroup4</cstring>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Box</enum>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string>IP</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QRadioButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>IPServerAssigned_RB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Server assigned</string>
+ </property>
+ <property stdset="1">
+ <name>checked</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>QRadioButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>IPFixed_RB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Fixed</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout11</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer8</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Fixed</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ </spacer>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame8</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget row="0" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>IPAddress_LE</cstring>
+ </property>
+ </widget>
+ <widget row="1" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Subnetmask</string>
+ </property>
+ </widget>
+ <widget row="0" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Address</string>
+ </property>
+ </widget>
+ <widget row="1" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>IPSubMask_LE</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget>
+ <class>QButtonGroup</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>ButtonGroup5</cstring>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string>Gateway</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QRadioButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>GWServerAssigned_RB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Server assigned</string>
+ </property>
+ <property stdset="1">
+ <name>checked</name>
+ <bool>true</bool>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ </widget>
+ <widget>
+ <class>QRadioButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>GWFixed_RB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Fixed</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout12</cstring>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer9</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Fixed</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame9</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget row="0" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Address</string>
+ </property>
+ </widget>
+ <widget row="0" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>GWAddress_LE</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer3</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>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>GWIsDefault_CB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Set as default</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>GWFixed_RB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Frame9</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>IPFixed_RB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Frame8</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+</UI>
diff --git a/noncore/settings/networksettings2/ppp/PPPIPedit.cpp b/noncore/settings/networksettings2/ppp/PPPIPedit.cpp
new file mode 100644
index 0000000..6965e5a
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPIPedit.cpp
@@ -0,0 +1,57 @@
+#include <qmessagebox.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qlineedit.h>
+#include <GUIUtils.h>
+#include "PPPIPedit.h"
+
+PPPIPEdit::PPPIPEdit( QWidget * Parent ) : PPPIPGUI( Parent ){
+}
+
+QString PPPIPEdit::acceptable( void ) {
+ if( IPFixed_RB->isChecked() ) {
+ if( IPAddress_LE->text().isEmpty() )
+ return tr("IPAddress needed" );
+ if( ! validIP( IPAddress_LE->text() ) )
+ return tr("IPAddress not valid" );
+ if( IPSubMask_LE->text().isEmpty() )
+ return tr("Subnet mask needed" );
+ if( ! validIP( IPSubMask_LE->text() ) )
+ return tr("Subnet mask not valid" );
+ } else if( GWFixed_RB->isChecked() ) {
+ if( GWAddress_LE->text().isEmpty() )
+ return tr("Gateway address needed" );
+ if( ! validIP( GWAddress_LE->text() ) )
+ return tr("Gateway address not valid" );
+ };
+
+ return QString();
+}
+
+bool PPPIPEdit::commit( PPPData_t & D ) {
+
+ bool SM = 0;
+
+ CBM( D.IP.IPAutomatic, IPServerAssigned_RB, SM );
+ if( ! D.IP.IPAutomatic ) {
+ TXTM( D.IP.IPAddress, IPAddress_LE, SM );
+ TXTM( D.IP.IPSubMask, IPSubMask_LE, SM );
+ }
+
+ CBM( D.IP.GWAutomatic, GWServerAssigned_RB, SM );
+ if( ! D.IP.GWAutomatic ) {
+ TXTM( D.IP.GWAddress, GWAddress_LE, SM );
+ }
+
+ CBM( D.IP.GWIsDefault, GWIsDefault_CB, SM );
+ return SM;
+}
+
+void PPPIPEdit::showData( PPPData_t & D ) {
+ IPServerAssigned_RB->setChecked( D.IP.IPAutomatic );
+ IPAddress_LE->setText( D.IP.IPAddress );
+ IPSubMask_LE->setText( D.IP.IPSubMask );
+ GWServerAssigned_RB->setChecked( D.IP.GWAutomatic );
+ GWAddress_LE->setText( D.IP.GWAddress );
+ GWIsDefault_CB->setChecked( D.IP.GWIsDefault );
+}
diff --git a/noncore/settings/networksettings2/ppp/PPPIPedit.h b/noncore/settings/networksettings2/ppp/PPPIPedit.h
new file mode 100644
index 0000000..153ee68
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPIPedit.h
@@ -0,0 +1,15 @@
+#include "pppdata.h"
+#include "PPPIPGUI.h"
+
+class PPPIPEdit : public PPPIPGUI {
+
+public :
+
+ PPPIPEdit( QWidget * parent );
+ QString acceptable( void );
+ bool commit( PPPData_t & Data );
+ void showData( PPPData_t & Data );
+
+private :
+
+};
diff --git a/noncore/settings/networksettings2/ppp/PPPedit.cpp b/noncore/settings/networksettings2/ppp/PPPedit.cpp
new file mode 100644
index 0000000..eb4fdbf
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPedit.cpp
@@ -0,0 +1,48 @@
+#include <qwidgetstack.h>
+
+#include "PPPIPedit.h"
+#include "PPPDNSedit.h"
+#include "PPPAuthedit.h"
+#include "PPPedit.h"
+
+PPPEdit::PPPEdit( QWidget * Parent ) : PPPGUI( Parent ){
+
+ Auth = new PPPAuthEdit( Options_WS );
+ IP = new PPPIPEdit( Options_WS );
+ DNS = new PPPDNSEdit( Options_WS );
+ Options_WS->addWidget( Auth, 0 );
+ Options_WS->addWidget( IP, 1 );
+ Options_WS->addWidget( DNS, 2 );
+
+ Options_WS->raiseWidget( 0 );
+}
+
+QString PPPEdit::acceptable( void ) {
+ QString S;
+ S = Auth->acceptable();
+ if( S.isEmpty() ) {
+ S = IP->acceptable();
+ if( S.isEmpty() ) {
+ S = DNS->acceptable();
+ }
+ }
+ return S;
+}
+
+bool PPPEdit::commit( PPPData_t & Data ) {
+ bool SM ;
+ SM = Auth->commit( Data );
+ SM |= IP->commit( Data );
+ SM |= DNS->commit( Data );
+ return SM;
+}
+
+void PPPEdit::showData( PPPData_t & Data ) {
+ Auth->showData( Data ) ;
+ IP->showData( Data );
+ DNS->showData( Data );
+}
+
+void PPPEdit::SLOT_SelectTopic( int v ) {
+ Options_WS->raiseWidget( v );
+}
diff --git a/noncore/settings/networksettings2/ppp/PPPedit.h b/noncore/settings/networksettings2/ppp/PPPedit.h
new file mode 100644
index 0000000..57d38ee
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/PPPedit.h
@@ -0,0 +1,27 @@
+#include "pppdata.h"
+#include "PPPGUI.h"
+
+class PPPAuthEdit;
+class PPPIPEdit;
+class PPPDNSEdit;
+
+class PPPEdit : public PPPGUI {
+
+public :
+
+ PPPEdit( QWidget * parent );
+ QString acceptable( void );
+ bool commit( PPPData_t & Data );
+ void showData( PPPData_t & Data );
+
+public slots :
+
+ void SLOT_SelectTopic( int );
+
+private :
+
+ PPPAuthEdit * Auth;
+ PPPDNSEdit * DNS;
+ PPPIPEdit * IP;
+
+};
diff --git a/noncore/settings/networksettings2/ppp/config.in b/noncore/settings/networksettings2/ppp/config.in
new file mode 100644
index 0000000..dc3abd0
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/config.in
@@ -0,0 +1,4 @@
+ config NS2PPP
+ boolean "opie-networksettings2plugin-ppp (set up PPP)"
+ default "n" if NS2
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE
diff --git a/noncore/settings/networksettings2/ppp/ppp.pro b/noncore/settings/networksettings2/ppp/ppp.pro
new file mode 100644
index 0000000..f8712cd
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/ppp.pro
@@ -0,0 +1,24 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release
+DESTDIR = $(OPIEDIR)/plugins/networksettings2
+HEADERS = ppp_NN.h \
+ ppp_NNI.h \
+ PPPedit.h \
+ PPPAuthedit.h \
+ PPPDNSedit.h \
+ PPPIPedit.h
+SOURCES = ppp_NN.cpp \
+ ppp_NNI.cpp \
+ PPPedit.cpp \
+ PPPDNSedit.cpp \
+ PPPAuthedit.cpp \
+ ppprun.cpp \
+ PPPIPedit.cpp
+INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2
+DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2
+LIBS += -lqpe
+INTERFACES = PPPGUI.ui PPPAuthGUI.ui PPPIPGUI.ui PPPDNSGUI.ui
+TARGET = ppp
+VERSION = 1.0.0
+
+include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.cpp b/noncore/settings/networksettings2/ppp/ppp_NN.cpp
new file mode 100644
index 0000000..309c9a1
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.cpp
@@ -0,0 +1,62 @@
+#include "ppp_NN.h"
+#include "ppp_NNI.h"
+
+static const char * PPPNeeds[] =
+ { "line",
+ "modem",
+ 0
+ };
+
+/**
+ * Constructor, find all of the possible interfaces
+ */
+PPPNetNode::PPPNetNode() : ANetNode() {
+}
+
+/**
+ * Delete any interfaces that we own.
+ */
+PPPNetNode::~PPPNetNode(){
+}
+
+const QString PPPNetNode::nodeDescription(){
+ return tr("\
+<p>Sets up IP using PPP.</p>\
+<p>Use this for dialup devices or serial setups</p>\
+"
+);
+}
+
+ANetNodeInstance * PPPNetNode::createInstance( void ) {
+ return new APPP( this );
+}
+
+const char ** PPPNetNode::needs( void ) {
+ return PPPNeeds;
+}
+
+const char * PPPNetNode::provides( void ) {
+ return "connection";
+}
+
+bool PPPNetNode::generateProperFilesFor(
+ ANetNodeInstance * ) {
+ return 1;
+}
+
+bool PPPNetNode::hasDataFor( const QString & ) {
+ return 0;
+}
+
+bool PPPNetNode::generateDataForCommonFile(
+ SystemFile & ,
+ long,
+ ANetNodeInstance * ) {
+ return 1;
+}
+
+extern "C" {
+void create_plugin( QList<ANetNode> & PNN ) {
+ PNN.append( new PPPNetNode() );
+}
+}
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.h b/noncore/settings/networksettings2/ppp/ppp_NN.h
new file mode 100644
index 0000000..a933523
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.h
@@ -0,0 +1,44 @@
+#ifndef PPP_NETNODE_H
+#define PPP_NETNODE_H
+
+#include "netnode.h"
+
+class APPP;
+
+class PPPNetNode : public ANetNode{
+
+ Q_OBJECT
+
+public:
+
+ PPPNetNode();
+ virtual ~PPPNetNode();
+
+ virtual const QString pixmapName()
+ { return "ppp"; }
+
+ virtual const QString nodeName()
+ { return tr("PPP Connection"); }
+
+ virtual const QString nodeDescription() ;
+
+ virtual ANetNodeInstance * createInstance( void );
+
+ virtual const char ** needs( void );
+ virtual const char * provides( void );
+
+ virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
+ virtual bool hasDataFor( const QString & S );
+ virtual bool generateDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+
+private:
+
+};
+
+extern "C"
+{
+ void create_plugin( QList<ANetNode> & PNN );
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
new file mode 100644
index 0000000..d09ecf9
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp
@@ -0,0 +1,115 @@
+#include "PPPedit.h"
+#include "ppp_NNI.h"
+#include "ppp_NN.h"
+
+APPP::APPP( PPPNetNode * PNN ) : ANetNodeInstance( PNN ) {
+ Data.DNS.ServerAssigned = 1;
+ Data.DNS.DomainName = "";
+
+ Data.Auth.Mode = 0;
+ Data.Auth.Login.Expect = "ogin:";
+ Data.Auth.Password.Expect = "assword:";
+ Data.Auth.PCEMode = 0;
+ Data.Auth.Client = "*";
+ Data.Auth.Server = "*";
+ Data.Auth.Secret = "";
+
+ Data.IP.IPAutomatic = 1;
+ Data.IP.IPAddress = "";
+ Data.IP.IPSubMask = "";
+ Data.IP.GWAutomatic = 1;
+ Data.IP.GWAddress = "";
+ Data.IP.GWIsDefault = 1;
+ GUI = 0;
+ RT = 0;
+
+}
+
+void APPP::setSpecificAttribute( QString & A, QString & V ) {
+ if( A.startsWith( "dns" ) ) {
+ if( A == "dnsserverassigned" ) {
+ Data.DNS.ServerAssigned = (V == "yes");
+ } else if( A == "dnsdomainname" ) {
+ Data.DNS.DomainName = V;
+ } else if( A == "dnsserver" ) {
+ Data.DNS.Servers.resize( Data.DNS.Servers.size()+1 );
+ Data.DNS.Servers[Data.DNS.Servers.size()-1] =
+ new QString( V );
+ }
+ } else if( A.startsWith( "auth" ) ) {
+ if( A == "authmode" ) {
+ Data.Auth.Mode = V.toShort();
+ } else if( A == "authloginexpect" ) {
+ Data.Auth.Login.Expect = V;
+ } else if( A == "authloginsend" ) {
+ Data.Auth.Login.Send = V;
+ } else if( A == "authpasswordexpect" ) {
+ Data.Auth.Password.Expect = V;
+ } else if( A == "authpasswordsend" ) {
+ Data.Auth.Password.Send = V;
+ } else if( A == "authpcemode" ) {
+ Data.Auth.PCEMode = V.toShort();
+ } else if( A == "authclient" ) {
+ Data.Auth.Client = V;
+ } else if( A == "authserver" ) {
+ Data.Auth.Server = V;
+ } else if( A == "authsecret" ) {
+ Data.Auth.Secret = V;
+ }
+ } else if( A.startsWith( "ip" ) ) {
+ if( A == "ipautomatic" ) {
+ Data.IP.IPAutomatic = (V == "yes");
+ } else if( A == "gwautomatic" ) {
+ Data.IP.GWAutomatic = (V == "yes");
+ } else if( A == "gwisdefault" ) {
+ Data.IP.GWIsDefault = (V == "yes");
+ } else if( A == "ipaddress" ) {
+ Data.IP.IPAddress = V;
+ } else if( A == "ipsubmask" ) {
+ Data.IP.IPSubMask = V;
+ } else if( A == "gwaddress" ) {
+ Data.IP.GWAddress = V;
+ }
+ }
+}
+
+void APPP::saveSpecificAttribute( QTextStream & TS ) {
+ TS << "dnsserverassigned=" <<
+ ( ( Data.DNS.ServerAssigned ) ? "yes" : "no" ) << endl;
+ TS << "dnsdomainname=" << Data.DNS.DomainName << endl;
+ for( unsigned int i = 0; i < Data.DNS.Servers.size(); i ++ ) {
+ TS << "dnsserver=" << *(Data.DNS.Servers[i]) << endl;
+ }
+ TS << "authmode=" << Data.Auth.Mode << endl;
+ TS << "authloginexpect=" << quote( Data.Auth.Login.Expect ) << endl;
+ TS << "authloginsend=" << quote( Data.Auth.Login.Send ) << endl;
+ TS << "authpasswordexpect=" << quote( Data.Auth.Password.Expect ) << endl;
+ TS << "authpasswordsend=" << quote( Data.Auth.Password.Send ) << endl;
+ TS << "authpcemode=" << Data.Auth.PCEMode << endl;
+ TS << "authclient=" << Data.Auth.Client << endl;
+ TS << "authserver=" << Data.Auth.Server << endl;
+ TS << "authsecret=" << quote( Data.Auth.Secret ) << endl;
+ TS << "ipautomatic=" << ( ( Data.IP.IPAutomatic ) ? "yes" : "no" ) << endl;
+ TS << "gwautomatic=" << ( ( Data.IP.GWAutomatic ) ? "yes" : "no" ) << endl;
+ TS << "gwisdefault=" << ( ( Data.IP.GWIsDefault ) ? "yes" : "no" ) << endl;
+ TS << "ipaddress=" << Data.IP.IPAddress << endl;
+ TS << "ipsubmask=" << Data.IP.IPSubMask << endl;
+ TS << "gwaddress=" << Data.IP.GWAddress << endl;
+}
+
+QWidget * APPP::edit( QWidget * parent ) {
+ GUI = new PPPEdit( parent );
+ GUI->showData( Data );
+ return GUI;
+}
+
+QString APPP::acceptable( void ) {
+ return ( GUI ) ? GUI->acceptable( ) : QString();
+}
+
+void APPP::commit( void ) {
+ if( GUI && GUI->commit( Data ) ) {
+ setModified( 1 );
+ }
+}
+
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.h b/noncore/settings/networksettings2/ppp/ppp_NNI.h
new file mode 100644
index 0000000..08dca1d
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/ppp_NNI.h
@@ -0,0 +1,43 @@
+#ifndef PPP_H
+#define PPP_H
+
+#include <netnode.h>
+#include "pppdata.h"
+#include "ppprun.h"
+
+class PPPNetNode;
+class PPPEdit;
+
+class APPP : public ANetNodeInstance {
+
+public :
+
+ APPP( PPPNetNode * PNN );
+
+ QWidget * edit( QWidget * parent );
+ QString acceptable( void );
+ void commit( void );
+
+ RuntimeInfo * runtime( void )
+ { if( RT == 0 )
+ RT = new PPPRun( this, Data );
+ return RT;
+ }
+
+ virtual void * data( void )
+ { return (void *)&Data; }
+
+protected :
+
+ virtual void setSpecificAttribute( QString & Attr, QString & Value );
+ virtual void saveSpecificAttribute( QTextStream & TS );
+
+private :
+
+ PPPEdit * GUI;
+ PPPData Data;
+ PPPRun * RT;
+
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/ppp/pppdata.h b/noncore/settings/networksettings2/ppp/pppdata.h
new file mode 100644
index 0000000..9e8543c
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/pppdata.h
@@ -0,0 +1,38 @@
+#ifndef PPP_DATA_H
+#define PPP_DATA_H
+
+#include <qstring.h>
+#include <qarray.h>
+
+typedef struct PPPData {
+ struct {
+ bool IPAutomatic;
+ QString IPAddress;
+ QString IPSubMask;
+ bool GWAutomatic;
+ QString GWAddress;
+ bool GWIsDefault;
+ } IP;
+ struct {
+ short Mode; // 0 login, 1 chap/pap, 2 Terminal
+ struct {
+ QString Expect;
+ QString Send;
+ } Login;
+ struct {
+ QString Expect;
+ QString Send;
+ } Password;
+ short PCEMode; // 0 pap, 1, chap 2, EAP
+ QString Server;
+ QString Client;
+ QString Secret;
+ } Auth;
+ struct {
+ bool ServerAssigned;
+ QString DomainName;
+ QArray<QString *> Servers;
+ } DNS;
+} PPPData_t;
+
+#endif
diff --git a/noncore/settings/networksettings2/ppp/ppprun.cpp b/noncore/settings/networksettings2/ppp/ppprun.cpp
new file mode 100644
index 0000000..8933f85
--- a/dev/null
+++ b/noncore/settings/networksettings2/ppp/ppprun.cpp
@@ -0,0 +1,77 @@
+#include <resources.h>
+#include "ppprun.h"
+
+void PPPRun::detectState( NodeCollection * NC ) {
+ if( isMyPPPDRunning( ) ) {
+ if( isMyPPPUp() ) {
+ NC->setCurrentState( IsUp );
+ } else {
+ NC->setCurrentState( Available );
+ }
+ } else {
+ NC->setCurrentState( Off ); // at least this
+ // but could also be unavailable
+ netNode()->nextNode()->runtime()->detectState( NC );
+ }
+}
+
+bool PPPRun::setState( NodeCollection * NC, Action_t A ) {
+ switch( A ) {
+ case Activate :
+ NC->setCurrentState( Available );
+ // no
+ break;
+ case Deactivate :
+ if( NC->currentState() == IsUp ) {
+ NC->state( Down );
+ }
+ // cannot really disable
+ NC->setCurrentState( Available );
+ break;
+ case Up :
+ if( NC->currentState() != IsUp ) {
+ // start my PPPD
+ NC->setCurrentState( IsUp );
+ }
+ break;
+ case Down :
+ if( NC->currentState() == IsUp ) {
+ // stop my PPPD
+ NC->setCurrentState( Available );
+ }
+ break;
+ default : // FT
+ break;
+ }
+ return 1;
+}
+
+bool PPPRun::isMyPPPDRunning( void ) {
+ return 0;
+}
+
+bool PPPRun::isMyPPPUp( void ) {
+ System & S = NSResources->system();
+ InterfaceInfo * best = 0, * Run;
+ QRegExp R( "ppp[0-9]" );
+
+ 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->assignedNode() == netNode() ) {
+ // assigned to us
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+bool PPPRun::handlesInterface( const QString & S ) {
+ return Pat.match( S ) >= 0;
+}
diff --git a/noncore/settings/networksettings2/profile/config.in b/noncore/settings/networksettings2/profile/config.in
new file mode 100644
index 0000000..0efa6a2
--- a/dev/null
+++ b/noncore/settings/networksettings2/profile/config.in
@@ -0,0 +1,4 @@
+ config NS2PROFILE
+ boolean "opie-networksettings2plugin-profiles (User profiles)"
+ default "n" if NS2
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE
diff --git a/noncore/settings/networksettings2/profile/profile.pro b/noncore/settings/networksettings2/profile/profile.pro
new file mode 100644
index 0000000..36a9012
--- a/dev/null
+++ b/noncore/settings/networksettings2/profile/profile.pro
@@ -0,0 +1,18 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release
+DESTDIR = $(OPIEDIR)/plugins/networksettings2
+HEADERS = profile_NN.h \
+ profile_NNI.h \
+ profileedit.h
+SOURCES = profile_NN.cpp \
+ profile_NNI.cpp \
+ profileedit.cpp \
+ profilerun.cpp
+INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2
+DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2
+LIBS += -lqpe
+INTERFACES = profileGUI.ui
+TARGET = profile
+VERSION = 1.0.0
+
+include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/networksettings2/profile/profileGUI.ui b/noncore/settings/networksettings2/profile/profileGUI.ui
new file mode 100644
index 0000000..365704b
--- a/dev/null
+++ b/noncore/settings/networksettings2/profile/profileGUI.ui
@@ -0,0 +1,1715 @@
+<!DOCTYPE UI><UI>
+<class>ProfileGUI</class>
+<widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Profile_FRM</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>225</width>
+ <height>301</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>Profile</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QTabWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TabWidget6</cstring>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Setup</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Automatic_CB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Start automatically</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Confirm_CB</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Confirm before start</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Disabled_CB</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Disabled</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Description</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QMultiLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Description_LE</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>State</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame73</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Plain</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>InterfaceName_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>font</name>
+ <font>
+ <underline>1</underline>
+ </font>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>eth0</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>InterfaceOptions_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>font</name>
+ <font>
+ <underline>1</underline>
+ </font>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>(Multicast, Up)</string>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Interface_GB</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget row="0" column="2" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel4_2_3</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Subnet Mask</string>
+ </property>
+ </widget>
+ <widget row="0" column="3" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_3_3</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Broadcast</string>
+ </property>
+ </widget>
+ <widget row="3" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_5</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>MAC</string>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ <widget row="2" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_5_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>P-t-P</string>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ <widget row="0" column="0" rowspan="1" colspan="2" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel3_2_3</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>IP Address</string>
+ </property>
+ </widget>
+ <widget row="1" column="0" rowspan="1" colspan="2" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>IPAddress_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>0.0.0.0</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="1" column="2" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>SubnetMask_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>0.0.0.0</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="1" column="3" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Broadcast_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>StyledPanel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <widget row="2" column="1" rowspan="1" colspan="3" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PointToPoint_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ <widget row="3" column="1" rowspan="1" colspan="3" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>MACAddress_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>00:00:00:00:00:00</string>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>font</name>
+ <font>
+ <underline>1</underline>
+ </font>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>margin</name>
+ <number>1</number>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>DHCP</string>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DHCP_GB</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget row="2" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel9_3</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Lease Expires</string>
+ </property>
+ </widget>
+ <widget row="1" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel8_3</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Lease Obtained</string>
+ </property>
+ </widget>
+ <widget row="0" column="1" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>DHCPServer_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string></string>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ <widget row="1" column="1" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>LeaseObtained_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>minimumSize</name>
+ <size>
+ <width>94</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string></string>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ <widget row="2" column="1" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>LeaseExpires_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string></string>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ <widget row="0" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel6_3</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>DHCP Server</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer16</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</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>
+ </vbox>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Traffic</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout5</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>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Receiving</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer17_2</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>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout43</cstring>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame114</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>minimumSize</name>
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property stdset="1">
+ <name>maximumSize</name>
+ <size>
+ <width>5</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ </widget>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Rcv_GB</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget row="1" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_5_9</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Errors</string>
+ </property>
+ </widget>
+ <widget row="0" column="1" rowspan="1" colspan="3" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>RcvBytes_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ <widget row="1" column="3" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>RcvDropped_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ <widget row="1" column="1" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>RcvErrors_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ <widget row="1" column="2" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_5_4</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Dropped</string>
+ </property>
+ </widget>
+ <widget row="0" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_5_3</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Bytes</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout6</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>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Transmitting</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer18_2</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>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout44</cstring>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame115</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>minimumSize</name>
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property stdset="1">
+ <name>maximumSize</name>
+ <size>
+ <width>5</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Plain</enum>
+ </property>
+ </widget>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Snd_GB</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>1</number>
+ </property>
+ <widget row="1" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_5_9_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Errors</string>
+ </property>
+ </widget>
+ <widget row="1" column="2" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_5_4_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Dropped</string>
+ </property>
+ </widget>
+ <widget row="0" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_5_3_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Bytes</string>
+ </property>
+ </widget>
+ <widget row="1" column="3" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>SndDropped_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ <widget row="1" column="1" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>SndErrors_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ <widget row="0" column="1" rowspan="1" colspan="3" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>SndBytes_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout7</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>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_3</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Others</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer19</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>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout45</cstring>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>2</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Frame116</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>minimumSize</name>
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property stdset="1">
+ <name>maximumSize</name>
+ <size>
+ <width>5</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ </widget>
+ <widget>
+ <class>QFrame</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Collisions_FRM</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>NoFrame</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Raised</enum>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_5_3_3</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Collisions</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Collisions_LBL</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>indent</name>
+ <number>0</number>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer18</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>
+ </hbox>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer17</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</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>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout17</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>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Refresh_CB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Live feed </string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer57</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>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>Refresh_CB</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Profile_FRM</receiver>
+ <slot>SLOT_AutoRefresh(bool)</slot>
+ </connection>
+ <slot access="public">SLOT_AutoRefresh(bool)</slot>
+</connections>
+</UI>
diff --git a/noncore/settings/networksettings2/profile/profile_NN.cpp b/noncore/settings/networksettings2/profile/profile_NN.cpp
new file mode 100644
index 0000000..c39b86f
--- a/dev/null
+++ b/noncore/settings/networksettings2/profile/profile_NN.cpp
@@ -0,0 +1,61 @@
+#include "profile_NN.h"
+#include "profile_NNI.h"
+
+static const char * ProfileNeeds[] =
+ { "connection",
+ 0
+ };
+
+/**
+ * Constructor, find all of the possible interfaces
+ */
+ProfileNetNode::ProfileNetNode() : ANetNode() {
+}
+
+/**
+ * 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>\
+"
+);
+}
+
+ANetNodeInstance * ProfileNetNode::createInstance( void ) {
+ return new AProfile( this );
+}
+
+const char ** ProfileNetNode::needs( void ) {
+ return ProfileNeeds;
+}
+
+const char * ProfileNetNode::provides( void ) {
+ return "fullsetup";
+}
+
+bool ProfileNetNode::generateProperFilesFor(
+ ANetNodeInstance * ) {
+ return 1;
+}
+
+bool ProfileNetNode::hasDataFor( const QString & ) {
+ return 0;
+}
+
+bool ProfileNetNode::generateDataForCommonFile(
+ SystemFile & ,
+ long,
+ ANetNodeInstance * ) {
+ return 1;
+}
+
+extern "C" {
+void create_plugin( QList<ANetNode> & PNN ) {
+ PNN.append( new ProfileNetNode() );
+}
+}
diff --git a/noncore/settings/networksettings2/profile/profile_NN.h b/noncore/settings/networksettings2/profile/profile_NN.h
new file mode 100644
index 0000000..2b469c7
--- a/dev/null
+++ b/noncore/settings/networksettings2/profile/profile_NN.h
@@ -0,0 +1,44 @@
+#ifndef PROFILE_NETNODE_H
+#define PROFILE_NETNODE_H
+
+#include "netnode.h"
+
+class AProfile;
+
+class ProfileNetNode : public ANetNode{
+
+ Q_OBJECT
+
+public:
+
+ ProfileNetNode();
+ virtual ~ProfileNetNode();
+
+ virtual const QString pixmapName()
+ { return "commprofile"; }
+
+ virtual const QString nodeName()
+ { return tr("Regular profile"); }
+
+ virtual const QString nodeDescription() ;
+
+ virtual ANetNodeInstance * createInstance( void );
+
+ virtual const char ** needs( void );
+ virtual const char * provides( void );
+
+ virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
+ virtual bool hasDataFor( const QString & S );
+ virtual bool generateDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+
+private:
+
+};
+
+extern "C"
+{
+ void create_plugin( QList<ANetNode> & PNN );
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/profile/profile_NNI.cpp b/noncore/settings/networksettings2/profile/profile_NNI.cpp
new file mode 100644
index 0000000..bc0118e
--- a/dev/null
+++ b/noncore/settings/networksettings2/profile/profile_NNI.cpp
@@ -0,0 +1,48 @@
+#include "profileedit.h"
+#include "profile_NNI.h"
+#include "profile_NN.h"
+
+AProfile::AProfile( ProfileNetNode * PNN ) : ANetNodeInstance( PNN ) {
+ Data.Automatic = 1;
+ Data.Confirm = 0;
+ Data.Description = "";
+ Data.Disabled = 0;
+ GUI = 0;
+ RT = 0;
+}
+
+void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) {
+
+ if ( Attr == "automatic" ) {
+ Data.Automatic = (Value=="yes");
+ } else if ( Attr == "preconfirm" ) {
+ Data.Confirm = (Value=="yes");
+ } else if ( Attr == "disabled" ) {
+ Data.Disabled = (Value=="yes");
+ } else if ( Attr == "description" ) {
+ Data.Description = Value;
+ }
+}
+
+void AProfile::saveSpecificAttribute( QTextStream & TS ) {
+ TS << "automatic=" << ((Data.Automatic) ? "yes" : "no") << endl;
+ TS << "preconfirm=" << ((Data.Confirm) ? "yes" : "no") << endl;
+ TS << "disabled=" << ((Data.Disabled) ? "yes" : "no") << endl;
+ TS << "description=" << Data.Description << endl;
+}
+
+QWidget * AProfile::edit( QWidget * parent ) {
+ GUI = new ProfileEdit( parent, this );
+ GUI->showData( Data );
+ return GUI;
+}
+
+QString AProfile::acceptable( void ) {
+ return ( GUI ) ? GUI->acceptable( ) : QString();
+}
+
+void AProfile::commit( void ) {
+ if( GUI && GUI->commit( Data ) )
+ setModified( 1 );
+}
+
diff --git a/noncore/settings/networksettings2/profile/profile_NNI.h b/noncore/settings/networksettings2/profile/profile_NNI.h
new file mode 100644
index 0000000..dfeb178
--- a/dev/null
+++ b/noncore/settings/networksettings2/profile/profile_NNI.h
@@ -0,0 +1,45 @@
+#ifndef PROFILE_H
+#define PROFILE_H
+
+#include <netnode.h>
+#include "profiledata.h"
+#include "profilerun.h"
+
+class ProfileNetNode;
+class ProfileEdit;
+
+class AProfile : public ANetNodeInstance {
+
+public :
+
+ AProfile( ProfileNetNode * PNN );
+
+ QWidget * edit( QWidget * parent );
+ QString acceptable( void );
+ void commit( void );
+
+ const QString & description( void )
+ { return Data.Description; }
+ RuntimeInfo * runtime( void )
+ { if( RT == 0 )
+ RT = new ProfileRun( this, Data );
+ return RT;
+ }
+
+ virtual void * data( void )
+ { return (void *)&Data; }
+
+protected :
+
+ virtual void setSpecificAttribute( QString & Attr, QString & Value );
+ virtual void saveSpecificAttribute( QTextStream & TS );
+
+private :
+
+ ProfileEdit * GUI;
+ ProfileData Data;
+ ProfileRun * RT;
+
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/profile/profiledata.h b/noncore/settings/networksettings2/profile/profiledata.h
new file mode 100644
index 0000000..b4168e2
--- a/dev/null
+++ b/noncore/settings/networksettings2/profile/profiledata.h
@@ -0,0 +1,15 @@
+#ifndef PROFILE_DATA_H
+#define PROFILE_DATA_H
+
+#include <qstring.h>
+typedef struct ProfileData {
+ QString Description;
+ // start up automatically
+ bool Automatic;
+ // if started up automatically, ask user for confirmation
+ bool Confirm;
+ // Do not bring this connection up
+ bool Disabled;
+} ProfileData_t;
+
+#endif
diff --git a/noncore/settings/networksettings2/profile/profileedit.cpp b/noncore/settings/networksettings2/profile/profileedit.cpp
new file mode 100644
index 0000000..3f72c52
--- a/dev/null
+++ b/noncore/settings/networksettings2/profile/profileedit.cpp
@@ -0,0 +1,93 @@
+#include <qlabel.h>
+#include <qframe.h>
+#include <qcheckbox.h>
+#include <qmultilineedit.h>
+#include <qcheckbox.h>
+
+#include <GUIUtils.h>
+#include <asdevice.h>
+#include <resources.h>
+
+#include "profileedit.h"
+
+ProfileEdit::ProfileEdit( QWidget * Parent, ANetNodeInstance * TNNI ) :
+ ProfileGUI( Parent ), TrafficRefresh(this) {
+ InterfaceInfo * II;
+
+ NNI = TNNI;
+ Dev = NNI->runtime()->device();
+ if( ( II = Dev->assignedInterface() ) ) {
+ Refresh_CB->setEnabled( TRUE );
+ Snd_GB->setEnabled( TRUE );
+ Rcv_GB->setEnabled( TRUE );
+ Collisions_FRM->setEnabled( TRUE );
+ // show current content
+ SLOT_Refresh();
+
+ // fill in static data
+ InterfaceName_LBL->setText( II->Name );
+ IPAddress_LBL->setText( II->Address );
+ SubnetMask_LBL->setText( II->Netmask );
+ Broadcast_LBL->setText( II->BCastAddress );
+ MACAddress_LBL->setText( II->MACAddress );
+ if( II->IsPointToPoint ) {
+ PointToPoint_LBL->setText( II->DstAddress );
+ }
+ QString S;
+ InterfaceName_LBL->setText( II->Name );
+ if( II->HasMulticast ) {
+ S += "Multicast";
+ }
+ if( ! S.isEmpty() ) {
+ S.prepend( " : " );
+ }
+ InterfaceOptions_LBL->setText( S );
+ }
+
+ connect( &TrafficRefresh, SIGNAL( timeout() ),
+ this, SLOT( SLOT_Refresh() ) );
+}
+
+QString ProfileEdit::acceptable( void ) {
+ return QString();
+}
+
+void ProfileEdit::showData( ProfileData_t & Data ) {
+ Description_LE->setText( Data.Description );
+ Automatic_CB->setChecked( Data.Automatic );
+ Confirm_CB->setChecked( Data.Confirm );
+ Disabled_CB->setChecked( Data.Disabled );
+}
+
+
+bool ProfileEdit::commit( ProfileData_t & Data ) {
+ bool SM = 0;
+ TXTM( Data.Description, Description_LE, SM );
+
+ CBM( Data.Automatic, Automatic_CB, SM );
+ CBM( Data.Disabled, Disabled_CB, SM );
+ CBM( Data.Confirm, Confirm_CB, SM );
+
+ return SM;
+}
+
+void ProfileEdit::SLOT_Refresh( void ) {
+ InterfaceInfo * II = Dev->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 );
+}
+
+void ProfileEdit::SLOT_AutoRefresh( bool ar ) {
+ if( ar ) {
+ TrafficRefresh.start( 1000 );
+ SLOT_Refresh();
+ } else {
+ TrafficRefresh.stop();
+ }
+}
diff --git a/noncore/settings/networksettings2/profile/profileedit.h b/noncore/settings/networksettings2/profile/profileedit.h
new file mode 100644
index 0000000..8ca34be
--- a/dev/null
+++ b/noncore/settings/networksettings2/profile/profileedit.h
@@ -0,0 +1,29 @@
+#include "profiledata.h"
+#include "profileGUI.h"
+
+#include <qtimer.h>
+class ANetNodeInstance;
+class AsDevice;
+
+class ProfileEdit : public ProfileGUI {
+
+ Q_OBJECT
+
+public :
+
+ ProfileEdit( QWidget * parent, ANetNodeInstance * NNI );
+ QString acceptable( void );
+ bool commit( ProfileData_t & Data );
+ void showData( ProfileData_t & Data );
+
+public slots :
+
+ void SLOT_AutoRefresh( bool );
+ void SLOT_Refresh( void );
+
+private :
+
+ QTimer TrafficRefresh;
+ ANetNodeInstance * NNI;
+ AsDevice * Dev;
+};
diff --git a/noncore/settings/networksettings2/profile/profilerun.cpp b/noncore/settings/networksettings2/profile/profilerun.cpp
new file mode 100644
index 0000000..90c37ed
--- a/dev/null
+++ b/noncore/settings/networksettings2/profile/profilerun.cpp
@@ -0,0 +1,67 @@
+#include <resources.h>
+
+#include "profilerun.h"
+
+void ProfileRun::detectState( NodeCollection * NC ) {
+ if( Data->Disabled ) {
+ NC->setCurrentState( Disabled );
+ } else {
+ // find next item in connection
+ // convert to runtime and ask to detect the state
+ netNode()->nextNode()->runtime()->detectState( NC );
+ }
+}
+
+bool ProfileRun::setState( NodeCollection * NC, Action_t A ) {
+ ANetNodeInstance * NNNI;
+
+ NNNI = netNode()->nextNode();
+ switch ( A ) {
+ case Enable :
+ if( NC->currentState() == Disabled ) {
+ NC->setCurrentState( Off ); // at least
+ // ... but request deeper
+ NNNI->runtime()->detectState(NC);
+ return 1;
+ }
+ return 1;
+ case Disable :
+ if( NC->currentState() == IsUp ) {
+ // bring down -> make available
+ NNNI->runtime()->setState(NC, Down);
+ }
+ if( NC->currentState() == Available ) {
+ // make unavailable
+ NNNI->runtime()->setState(NC, Deactivate);
+ }
+ if( NC->currentState() > Available ) {
+ // could not disable
+ return 0;
+ }
+ NC->setCurrentState( Disabled );
+ return 1;
+ default :
+ break;
+ }
+ return NNNI->runtime()->setState(NC, A);
+}
+
+bool ProfileRun::canSetState( State_t Curr, Action_t A ) {
+ RuntimeInfo * RI;
+ switch ( A ) {
+ case Enable :
+ case Disable :
+ // always possible
+ return 1;
+ default :
+ break;
+ }
+ RI = netNode()->nextNode()->runtime();
+ return ( Curr != Disabled ) ?
+ RI->canSetState(Curr, A) : 0;
+}
+
+bool ProfileRun::handlesInterface( const QString & S ) {
+ // donno -> pass deeper
+ return netNode()->nextNode()->runtime()->handlesInterface(S);
+}
diff --git a/noncore/settings/networksettings2/profile/profilerun.h b/noncore/settings/networksettings2/profile/profilerun.h
new file mode 100644
index 0000000..d3797b5
--- a/dev/null
+++ b/noncore/settings/networksettings2/profile/profilerun.h
@@ -0,0 +1,28 @@
+#ifndef PROFILERUN_H
+#define PROFILERUN_H
+
+#include <asfullsetup.h>
+#include "profiledata.h"
+
+class ProfileRun : public AsFullSetup {
+
+public :
+
+ ProfileRun( ANetNodeInstance * NNI, ProfileData & D ) :
+ AsFullSetup( NNI )
+ { Data = &D; }
+
+ void detectState( NodeCollection * NC );
+ bool setState( NodeCollection * NC, Action_t A );
+ bool canSetState( State_t Curr, Action_t A );
+
+ bool handlesInterface( const QString & I );
+
+ virtual const QString & description( void )
+ { return Data->Description; }
+private :
+
+ ProfileData * Data;
+
+};
+#endif
diff --git a/noncore/settings/networksettings2/setmacaddress.sh b/noncore/settings/networksettings2/setmacaddress.sh
new file mode 100755
index 0000000..f9abca2
--- a/dev/null
+++ b/noncore/settings/networksettings2/setmacaddress.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+BDIR=/opt/QtPalmtop/etc/networktemplates
+[ ! -z "$1" -a -f ${BDIR}/$1.mac ] && ifconfig $1 hw ether `cat ${BDIR}/$1.mac`
+exit 0
diff --git a/noncore/settings/networksettings2/usb/config.in b/noncore/settings/networksettings2/usb/config.in
new file mode 100644
index 0000000..988601a
--- a/dev/null
+++ b/noncore/settings/networksettings2/usb/config.in
@@ -0,0 +1,4 @@
+ config NS2USB
+ boolean "opie-networksettings2plugin-usb (set up USB)"
+ default "n" if NS2
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE
diff --git a/noncore/settings/networksettings2/usb/usb.pro b/noncore/settings/networksettings2/usb/usb.pro
new file mode 100644
index 0000000..cc2f9db
--- a/dev/null
+++ b/noncore/settings/networksettings2/usb/usb.pro
@@ -0,0 +1,18 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release
+DESTDIR = $(OPIEDIR)/plugins/networksettings2
+HEADERS = usb_NN.h \
+ usb_NNI.h \
+ usbedit.h
+SOURCES = usb_NN.cpp \
+ usb_NNI.cpp \
+ usbedit.cpp \
+ usbrun.cpp
+INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2
+DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2
+LIBS += -lqpe
+INTERFACES = usbGUI.ui
+TARGET = usb
+VERSION = 1.0.0
+
+include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/networksettings2/usb/usbGUI.ui b/noncore/settings/networksettings2/usb/usbGUI.ui
new file mode 100644
index 0000000..bd78ab4
--- a/dev/null
+++ b/noncore/settings/networksettings2/usb/usbGUI.ui
@@ -0,0 +1,57 @@
+<!DOCTYPE UI><UI>
+<class>USBGUI</class>
+<widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>USB_FRM</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>279</width>
+ <height>199</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>USB</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Nothing to configure</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+</UI>
diff --git a/noncore/settings/networksettings2/usb/usb_NN.cpp b/noncore/settings/networksettings2/usb/usb_NN.cpp
new file mode 100644
index 0000000..c65771d
--- a/dev/null
+++ b/noncore/settings/networksettings2/usb/usb_NN.cpp
@@ -0,0 +1,60 @@
+#include "usb_NN.h"
+#include "usb_NNI.h"
+
+static const char * USBNeeds[] =
+ { 0
+ };
+
+/**
+ * Constructor, find all of the possible interfaces
+ */
+USBNetNode::USBNetNode() : ANetNode() {
+}
+
+/**
+ * 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>\
+"
+);
+}
+
+ANetNodeInstance * USBNetNode::createInstance( void ) {
+ return new AUSB( this );
+}
+
+const char ** USBNetNode::needs( void ) {
+ return USBNeeds;
+}
+
+const char * USBNetNode::provides( void ) {
+ return "device";
+}
+
+bool USBNetNode::generateProperFilesFor(
+ ANetNodeInstance * ) {
+ return 1;
+}
+
+bool USBNetNode::hasDataFor( const QString & S ) {
+ return (S== "interfaces");
+}
+
+bool USBNetNode::generateDataForCommonFile(
+ SystemFile & S ,
+ long DevNr,
+ ANetNodeInstance * NNI) {
+ return ((AUSB *)NNI)->generateDataForCommonFile(S, DevNr);
+}
+
+extern "C" {
+void create_plugin( QList<ANetNode> & PNN ) {
+ PNN.append( new USBNetNode() );
+}
+}
diff --git a/noncore/settings/networksettings2/usb/usb_NN.h b/noncore/settings/networksettings2/usb/usb_NN.h
new file mode 100644
index 0000000..3871afc
--- a/dev/null
+++ b/noncore/settings/networksettings2/usb/usb_NN.h
@@ -0,0 +1,44 @@
+#ifndef USB_NETNODE_H
+#define USB_NETNODE_H
+
+#include "netnode.h"
+
+class AUSB;
+
+class USBNetNode : public ANetNode{
+
+ Q_OBJECT
+
+public:
+
+ USBNetNode();
+ virtual ~USBNetNode();
+
+ virtual const QString pixmapName()
+ { return "usb"; }
+
+ virtual const QString nodeName()
+ { return tr("USB Cable Connect"); }
+
+ virtual const QString nodeDescription() ;
+
+ virtual ANetNodeInstance * createInstance( void );
+
+ virtual const char ** needs( void );
+ virtual const char * provides( void );
+
+ virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
+ virtual bool hasDataFor( const QString & S );
+ virtual bool generateDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+
+private:
+
+};
+
+extern "C"
+{
+ void create_plugin( QList<ANetNode> & PNN );
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/usb/usb_NNI.cpp b/noncore/settings/networksettings2/usb/usb_NNI.cpp
new file mode 100644
index 0000000..4729416
--- a/dev/null
+++ b/noncore/settings/networksettings2/usb/usb_NNI.cpp
@@ -0,0 +1,46 @@
+#include <qpe/qpeapplication.h>
+#include "usbedit.h"
+#include "usb_NNI.h"
+#include "usb_NN.h"
+
+AUSB::AUSB( USBNetNode * PNN ) : ANetNodeInstance( PNN ) {
+
+ GUI = 0;
+ RT = 0;
+}
+
+void AUSB::setSpecificAttribute( QString & , QString & ) {
+}
+
+void AUSB::saveSpecificAttribute( QTextStream & ) {
+}
+
+
+QWidget * AUSB::edit( QWidget * parent ) {
+ GUI = new USBEdit( parent );
+ GUI->showData( Data );
+ return GUI;
+}
+
+QString AUSB::acceptable( void ) {
+ return ( GUI ) ? GUI->acceptable( ) : QString();
+}
+
+void AUSB::commit( void ) {
+ if( GUI && GUI->commit( Data ) ) {
+ setModified( 1 );
+ }
+}
+
+bool AUSB::generateDataForCommonFile( SystemFile & S, long DevNr ) {
+ AsDevice * Dev = runtime()->device();
+ QString NIC = Dev->genNic( DevNr );
+
+ if( S.name() == "interfaces" ) {
+ // generate mapping stanza for this interface
+ S << " pre-up " << QPEApplication::qpeDir() << "bin/setmacaddress.sh " << NIC << " || true" << endl;
+ }
+ return 0;
+}
+
+
diff --git a/noncore/settings/networksettings2/usb/usb_NNI.h b/noncore/settings/networksettings2/usb/usb_NNI.h
new file mode 100644
index 0000000..b09f17a
--- a/dev/null
+++ b/noncore/settings/networksettings2/usb/usb_NNI.h
@@ -0,0 +1,44 @@
+#ifndef USB_H
+#define USB_H
+
+#include <netnode.h>
+#include "usbdata.h"
+#include "usbrun.h"
+
+class USBNetNode;
+class USBEdit;
+
+class AUSB : public ANetNodeInstance {
+
+public :
+
+ AUSB( USBNetNode * PNN );
+
+ QWidget * edit( QWidget * parent );
+ QString acceptable( void );
+ void commit( void );
+
+ RuntimeInfo * runtime( void )
+ { if( RT == 0 )
+ RT = new USBRun( this, Data );
+ return RT;
+ }
+
+ virtual void * data( void )
+ { return (void *)&Data; }
+
+ bool generateDataForCommonFile( SystemFile & S, long DevNr );
+
+protected :
+
+ virtual void setSpecificAttribute( QString & Attr, QString & Value );
+ virtual void saveSpecificAttribute( QTextStream & TS );
+
+private :
+
+ USBEdit * GUI;
+ USBData Data;
+ USBRun * RT;
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/usb/usbdata.h b/noncore/settings/networksettings2/usb/usbdata.h
new file mode 100644
index 0000000..c59f508
--- a/dev/null
+++ b/noncore/settings/networksettings2/usb/usbdata.h
@@ -0,0 +1,8 @@
+#ifndef USB_DATA_H
+#define USB_DATA_H
+
+typedef struct USBData {
+ bool Fake;
+} USBData_t;
+
+#endif
diff --git a/noncore/settings/networksettings2/usb/usbedit.cpp b/noncore/settings/networksettings2/usb/usbedit.cpp
new file mode 100644
index 0000000..153c497
--- a/dev/null
+++ b/noncore/settings/networksettings2/usb/usbedit.cpp
@@ -0,0 +1,17 @@
+#include <GUIUtils.h>
+#include "usbedit.h"
+
+USBEdit::USBEdit( QWidget * Parent ) : USBGUI( Parent ){
+
+}
+
+QString USBEdit::acceptable( void ) {
+ return QString();
+}
+
+void USBEdit::showData( USBData_t & Data ) {
+}
+
+bool USBEdit::commit( USBData_t & Data ) {
+ return 1;
+}
diff --git a/noncore/settings/networksettings2/usb/usbedit.h b/noncore/settings/networksettings2/usb/usbedit.h
new file mode 100644
index 0000000..441f2f0
--- a/dev/null
+++ b/noncore/settings/networksettings2/usb/usbedit.h
@@ -0,0 +1,12 @@
+#include "usbdata.h"
+#include "usbGUI.h"
+
+class USBEdit : public USBGUI {
+
+public :
+
+ USBEdit( QWidget * parent );
+ QString acceptable( void );
+ bool commit( USBData_t & Data );
+ void showData( USBData_t & Data );
+};
diff --git a/noncore/settings/networksettings2/usb/usbrun.cpp b/noncore/settings/networksettings2/usb/usbrun.cpp
new file mode 100644
index 0000000..49b5a77
--- a/dev/null
+++ b/noncore/settings/networksettings2/usb/usbrun.cpp
@@ -0,0 +1,171 @@
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qtextstream.h>
+#include <resources.h>
+#include "usbrun.h"
+
+void USBRun::detectState( NodeCollection * NC ) {
+ // unavailable : no card found
+ // available : card found and assigned to us or free
+ // up : card found and assigned to us and up
+ 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
+ QString X;
+ QTextStream TS(&F);
+ X = TS.readLine();
+ // find interface
+ if( handlesInterface( X ) ) {
+ for( QDictIterator<InterfaceInfo> It(Sys.interfaces());
+ It.current();
+ ++It ) {
+ Run = It.current();
+ if( X == Run->Name ) {
+ Run->assignNode( netNode() );
+ assignInterface( Run );
+ NC->setCurrentState( IsUp );
+ return;
+ }
+ }
+ }
+ }
+
+ fprintf( stderr, "NUP\n" );
+ // definitively not up
+ assignInterface( 0 );
+
+ // find possible interface
+ for( QDictIterator<InterfaceInfo> It(Sys.interfaces());
+ It.current();
+ ++It ) {
+ Run = It.current();
+ fprintf( stderr, "%s %d %d=%d %d\n",
+ Run->Name.latin1(),
+ handlesInterface( Run->Name ),
+ Run->CardType, ARPHRD_ETHER,
+ ! Run->IsUp );
+ if( handlesInterface( Run->Name ) &&
+ Run->CardType == ARPHRD_ETHER &&
+ ! Run->IsUp
+ ) {
+ fprintf( stderr, "OFF\n" );
+ // proper type, and Not UP -> free
+ NC->setCurrentState( Off );
+ return;
+ }
+ }
+ // no free found
+ fprintf( stderr, "UNA\n" );
+
+ NC->setCurrentState( Unavailable );
+}
+
+bool USBRun::setState( NodeCollection * NC, Action_t A ) {
+
+ // we only handle activate and deactivate
+ switch( A ) {
+ case Activate :
+ {
+ if( NC->currentState() != Off ) {
+ return 0;
+ }
+ InterfaceInfo * N = getInterface();
+ if( ! N ) {
+ // no interface available
+ NC->setCurrentState( Unavailable );
+ return 0;
+ }
+ // because we were OFF the interface
+ // we get back is NOT assigned
+ N->assignNode( netNode() );
+ assignInterface( N );
+ NC->setCurrentState( Available );
+ return 1;
+ }
+ case Deactivate :
+ if( NC->currentState() == IsUp ) {
+ // bring down first
+ if( ! connection()->setState( Down ) )
+ // could not ...
+ return 0;
+ }
+ if( NC->currentState() != Available ) {
+ return 1;
+ }
+ assignedInterface()->assignNode( 0 ); // release
+ assignInterface( 0 );
+ NC->setCurrentState( Off );
+ return 1;
+ default :
+ // FT
+ break;
+ }
+ return 0;
+}
+
+bool USBRun::canSetState( State_t Curr, Action_t A ) {
+ // we only handle up down activate and deactivate
+ switch( A ) {
+ case Activate :
+ { // at least available
+ if( Curr == Available ) {
+ return 1;
+ }
+ // or we can make one available
+ InterfaceInfo * N = getInterface();
+ if( ! N || N->assignedNode() != 0 ) {
+ // non available or assigned
+ return 0;
+ }
+ return 1;
+ }
+ case Deactivate :
+ return ( Curr >= Available );
+ default :
+ // FT
+ break;
+ }
+ return 0;
+}
+
+// get interface that is free or assigned to us
+InterfaceInfo * USBRun::getInterface( void ) {
+
+ System & S = NSResources->system();
+ InterfaceInfo * best = 0, * Run;
+ QRegExp R( "usb[0-9abcdef]" );
+
+ for( QDictIterator<InterfaceInfo> It(S.interfaces());
+ It.current();
+ ++It ) {
+ Run = It.current();
+ if( handlesInterface( Run->Name ) &&
+ Run->CardType == ARPHRD_ETHER
+ ) {
+ // this is a USB card
+ if( Run->assignedNode() == netNode() ) {
+ // assigned to us
+ return Run;
+ } else if( Run->assignedNode() == 0 ) {
+ // free
+ best = Run;
+ }
+ }
+ }
+ return best; // can be 0
+}
+
+bool USBRun::handlesInterface( const QString & S ) {
+ return Pat.match( S ) >= 0;
+}
+
+QString USBRun::genNic( long nr ) {
+ QString S;
+ S.sprintf( "usbf" );
+ return S;
+}
+
diff --git a/noncore/settings/networksettings2/usb/usbrun.h b/noncore/settings/networksettings2/usb/usbrun.h
new file mode 100644
index 0000000..c9c9121
--- a/dev/null
+++ b/noncore/settings/networksettings2/usb/usbrun.h
@@ -0,0 +1,38 @@
+#ifndef USBRUN_H
+#define USBRUN_H
+
+#include <asdevice.h>
+#include <qregexp.h>
+#include "usbdata.h"
+
+class USBRun : public AsDevice {
+
+public :
+
+ USBRun( ANetNodeInstance * NNI,
+ USBData & Data ) :
+ AsDevice( NNI ),
+ Pat( "usb[0-9abcdef]" )
+ { }
+
+ virtual long count( void )
+ { return 1; }
+ virtual QString genNic( long nr );
+ virtual AsDevice * device( void )
+ { return asDevice(); }
+
+protected :
+
+ void detectState( NodeCollection * );
+ bool setState( NodeCollection * , Action_t A );
+ bool canSetState( State_t , Action_t A );
+
+ bool handlesInterface( const QString & I );
+
+private :
+
+ InterfaceInfo * getInterface( void );
+ QRegExp Pat;
+
+};
+#endif
diff --git a/noncore/settings/networksettings2/vpn/config.in b/noncore/settings/networksettings2/vpn/config.in
new file mode 100644
index 0000000..796f996
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/config.in
@@ -0,0 +1,4 @@
+ config NS2VPN
+ boolean "opie-networksettings2plugin-vpn (set up VPN)"
+ default "n" if NS2
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE
diff --git a/noncore/settings/networksettings2/vpn/vpn.pro b/noncore/settings/networksettings2/vpn/vpn.pro
new file mode 100644
index 0000000..81b4d08
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpn.pro
@@ -0,0 +1,18 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release
+DESTDIR = $(OPIEDIR)/plugins/networksettings2
+HEADERS = vpn_NN.h \
+ vpn_NNI.h \
+ vpnedit.h
+SOURCES = vpn_NN.cpp \
+ vpn_NNI.cpp \
+ vpnedit.cpp \
+ vpnrun.cpp
+INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2
+DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2
+LIBS += -lqpe
+INTERFACES = vpnGUI.ui
+TARGET = vpn
+VERSION = 1.0.0
+
+include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/networksettings2/vpn/vpnGUI.cpp b/noncore/settings/networksettings2/vpn/vpnGUI.cpp
new file mode 100644
index 0000000..708c92b
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpnGUI.cpp
@@ -0,0 +1,76 @@
+/****************************************************************************
+** Form implementation generated from reading ui file 'vpnGUI.ui'
+**
+** Created: Tue Mar 30 02:42:53 2004
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "vpnGUI.h"
+
+#include <qcheckbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qmultilineedit.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qvariant.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a VPNGUI which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+VPNGUI::VPNGUI( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "VPN_FRM" );
+ resize( 283, 199 );
+ setCaption( tr( "VPN" ) );
+ VPN_FRMLayout = new QVBoxLayout( this );
+ VPN_FRMLayout->setSpacing( 2 );
+ VPN_FRMLayout->setMargin( 2 );
+
+ Layout4 = new QHBoxLayout;
+ Layout4->setSpacing( 6 );
+ Layout4->setMargin( 0 );
+
+ TextLabel4 = new QLabel( this, "TextLabel4" );
+ TextLabel4->setText( tr( "Name" ) );
+ Layout4->addWidget( TextLabel4 );
+
+ Name_LE = new QLineEdit( this, "Name_LE" );
+ Layout4->addWidget( Name_LE );
+ VPN_FRMLayout->addLayout( Layout4 );
+
+ TextLabel3 = new QLabel( this, "TextLabel3" );
+ TextLabel3->setText( tr( "Description" ) );
+ VPN_FRMLayout->addWidget( TextLabel3 );
+
+ Description_LE = new QMultiLineEdit( this, "Description_LE" );
+ VPN_FRMLayout->addWidget( Description_LE );
+
+ Layout5 = new QHBoxLayout;
+ Layout5->setSpacing( 6 );
+ Layout5->setMargin( 0 );
+
+ Automatic_CB = new QCheckBox( this, "Automatic_CB" );
+ Automatic_CB->setText( tr( "Start automatically" ) );
+ Layout5->addWidget( Automatic_CB );
+
+ Confirm_CB = new QCheckBox( this, "Confirm_CB" );
+ Confirm_CB->setText( tr( "Confirm before start" ) );
+ Layout5->addWidget( Confirm_CB );
+ VPN_FRMLayout->addLayout( Layout5 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+VPNGUI::~VPNGUI()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
diff --git a/noncore/settings/networksettings2/vpn/vpnGUI.h b/noncore/settings/networksettings2/vpn/vpnGUI.h
new file mode 100644
index 0000000..fcc3e54
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpnGUI.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+** Form interface generated from reading ui file 'vpnGUI.ui'
+**
+** Created: Tue Mar 30 02:42:50 2004
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef VPN_FRM_H
+#define VPN_FRM_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QCheckBox;
+class QLabel;
+class QLineEdit;
+class QMultiLineEdit;
+
+class VPNGUI : public QWidget
+{
+ Q_OBJECT
+
+public:
+ VPNGUI( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~VPNGUI();
+
+ QLabel* TextLabel4;
+ QLineEdit* Name_LE;
+ QLabel* TextLabel3;
+ QMultiLineEdit* Description_LE;
+ QCheckBox* Automatic_CB;
+ QCheckBox* Confirm_CB;
+
+protected:
+ QVBoxLayout* VPN_FRMLayout;
+ QHBoxLayout* Layout4;
+ QHBoxLayout* Layout5;
+};
+
+#endif // VPN_FRM_H
diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.cpp b/noncore/settings/networksettings2/vpn/vpn_NN.cpp
new file mode 100644
index 0000000..c800929
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpn_NN.cpp
@@ -0,0 +1,61 @@
+#include "vpn_NN.h"
+#include "vpn_NNI.h"
+
+static const char * VPNNeeds[] =
+ { "connection",
+ 0
+ };
+
+/**
+ * Constructor, find all of the possible interfaces
+ */
+VPNNetNode::VPNNetNode() : ANetNode() {
+}
+
+/**
+ * Delete any interfaces that we own.
+ */
+VPNNetNode::~VPNNetNode(){
+}
+
+const QString VPNNetNode::nodeDescription(){
+ return tr("\
+<p>Configure private IP connection.</p>\
+<p>Defines Secure tunnels over non secure IP sessions</p>\
+"
+);
+}
+
+ANetNodeInstance * VPNNetNode::createInstance( void ) {
+ return new AVPN( this );
+}
+
+const char ** VPNNetNode::needs( void ) {
+ return VPNNeeds;
+}
+
+const char * VPNNetNode::provides( void ) {
+ return "connection";
+}
+
+bool VPNNetNode::generateProperFilesFor(
+ ANetNodeInstance * ) {
+ return 1;
+}
+
+bool VPNNetNode::hasDataFor( const QString & ) {
+ return 0;
+}
+
+bool VPNNetNode::generateDataForCommonFile(
+ SystemFile & ,
+ long,
+ ANetNodeInstance * ) {
+ return 1;
+}
+
+extern "C" {
+void create_plugin( QList<ANetNode> & PNN ) {
+ PNN.append( new VPNNetNode() );
+}
+}
diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.h b/noncore/settings/networksettings2/vpn/vpn_NN.h
new file mode 100644
index 0000000..5718961
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpn_NN.h
@@ -0,0 +1,44 @@
+#ifndef VPN_NETNODE_H
+#define VPN_NETNODE_H
+
+#include "netnode.h"
+
+class AVPN;
+
+class VPNNetNode : public ANetNode{
+
+ Q_OBJECT
+
+public:
+
+ VPNNetNode();
+ virtual ~VPNNetNode();
+
+ virtual const QString pixmapName()
+ { return "vpn"; }
+
+ virtual const QString nodeName()
+ { return tr("VPN Connection"); }
+
+ virtual const QString nodeDescription() ;
+
+ virtual ANetNodeInstance * createInstance( void );
+
+ virtual const char ** needs( void );
+ virtual const char * provides( void );
+
+ virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
+ virtual bool hasDataFor( const QString & S );
+ virtual bool generateDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+
+private:
+
+};
+
+extern "C"
+{
+ void create_plugin( QList<ANetNode> & PNN );
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/vpn/vpn_NNI.cpp b/noncore/settings/networksettings2/vpn/vpn_NNI.cpp
new file mode 100644
index 0000000..6c20aeb
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpn_NNI.cpp
@@ -0,0 +1,30 @@
+#include "vpnedit.h"
+#include "vpn_NNI.h"
+#include "vpn_NN.h"
+
+AVPN::AVPN( VPNNetNode * PNN ) : ANetNodeInstance( PNN ) {
+ GUI = 0;
+ RT = 0;
+}
+
+void AVPN::setSpecificAttribute( QString & , QString & ) {
+}
+
+void AVPN::saveSpecificAttribute( QTextStream & ) {
+}
+
+QWidget * AVPN::edit( QWidget * parent ) {
+ GUI = new VPNEdit( parent );
+ GUI->showData( Data );
+ return GUI;
+}
+
+QString AVPN::acceptable( void ) {
+ return ( GUI ) ? GUI->acceptable( ) : QString();
+}
+
+void AVPN::commit( void ) {
+ if( GUI && GUI->commit( Data ) )
+ setModified( 1 );
+}
+
diff --git a/noncore/settings/networksettings2/vpn/vpn_NNI.h b/noncore/settings/networksettings2/vpn/vpn_NNI.h
new file mode 100644
index 0000000..31ce0d6
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpn_NNI.h
@@ -0,0 +1,43 @@
+#ifndef VPN_H
+#define VPN_H
+
+#include <netnode.h>
+#include "vpndata.h"
+#include "vpnrun.h"
+
+class VPNNetNode;
+class VPNEdit;
+
+class AVPN : public ANetNodeInstance {
+
+public :
+
+ AVPN( VPNNetNode * PNN );
+
+ QWidget * edit( QWidget * parent );
+ QString acceptable( void );
+ void commit( void );
+
+ RuntimeInfo * runtime( void )
+ { if( RT == 0 )
+ RT = new VPNRun( this, Data );
+ return RT;
+ }
+
+ virtual void * data( void )
+ { return (void *)&Data; }
+
+protected :
+
+ virtual void setSpecificAttribute( QString & Attr, QString & Value );
+ virtual void saveSpecificAttribute( QTextStream & TS );
+
+private :
+
+ VPNEdit * GUI;
+ VPNData Data;
+ VPNRun * RT;
+
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/vpn/vpndata.h b/noncore/settings/networksettings2/vpn/vpndata.h
new file mode 100644
index 0000000..5c986aa
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpndata.h
@@ -0,0 +1,16 @@
+#ifndef VPN_DATA_H
+#define VPN_DATA_H
+
+#include <qstring.h>
+typedef struct VPNData {
+ QString Device;
+ QString LockFile;
+ long Speed;
+ short Parity;
+ short DataBits;
+ short StopBits;
+ bool HardwareControl;
+ bool SoftwareControl;
+} VPNData_t;
+
+#endif
diff --git a/noncore/settings/networksettings2/vpn/vpnedit.cpp b/noncore/settings/networksettings2/vpn/vpnedit.cpp
new file mode 100644
index 0000000..f336394
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpnedit.cpp
@@ -0,0 +1,18 @@
+#include <GUIUtils.h>
+#include "vpnedit.h"
+
+
+VPNEdit::VPNEdit( QWidget * Parent ) : VPNGUI( Parent ){
+
+}
+
+QString VPNEdit::acceptable( void ) {
+ return QString();
+}
+
+void VPNEdit::showData( VPNData_t & Data ) {
+}
+
+bool VPNEdit::commit( VPNData_t & Data ) {
+ return 0;
+}
diff --git a/noncore/settings/networksettings2/vpn/vpnedit.h b/noncore/settings/networksettings2/vpn/vpnedit.h
new file mode 100644
index 0000000..76480cd
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpnedit.h
@@ -0,0 +1,12 @@
+#include "vpndata.h"
+#include "vpnGUI.h"
+
+class VPNEdit : public VPNGUI {
+
+public :
+
+ VPNEdit( QWidget * parent );
+ QString acceptable( void );
+ bool commit( VPNData_t & Data );
+ void showData( VPNData_t & Data );
+};
diff --git a/noncore/settings/networksettings2/vpn/vpnrun.cpp b/noncore/settings/networksettings2/vpn/vpnrun.cpp
new file mode 100644
index 0000000..ab2966c
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpnrun.cpp
@@ -0,0 +1,6 @@
+#include "vpnrun.h"
+
+bool VPNRun::handlesInterface( const QString & ) {
+ // to be figured out
+ return 0;
+}
diff --git a/noncore/settings/networksettings2/vpn/vpnrun.h b/noncore/settings/networksettings2/vpn/vpnrun.h
new file mode 100644
index 0000000..c221fd0
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpnrun.h
@@ -0,0 +1,30 @@
+#ifndef VPNRUN_H
+#define VPNRUN_H
+
+#include <asconnection.h>
+#include "vpndata.h"
+
+class VPNRun : public AsConnection {
+
+public :
+
+ VPNRun( ANetNodeInstance * NNI, VPNData & Data ) :
+ AsConnection( NNI )
+ { }
+
+protected :
+
+ void detectState( NodeCollection * )
+ { }
+
+ bool setState( NodeCollection *, Action_t )
+ { return 0; }
+
+ bool canSetState( State_t, Action_t )
+ { return 0; }
+
+ bool handlesInterface( const QString & I );
+
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/wlan/wlan.pro b/noncore/settings/networksettings2/wlan/wlan.pro
new file mode 100644
index 0000000..4cc47ee
--- a/dev/null
+++ b/noncore/settings/networksettings2/wlan/wlan.pro
@@ -0,0 +1,18 @@
+TEMPLATE = lib
+CONFIG += qt warn_on release
+DESTDIR = $(OPIEDIR)/plugins/networksettings2
+HEADERS = wlan_NN.h \
+ wlan_NNI.h \
+ wlanedit.h
+SOURCES = wlan_NN.cpp \
+ wlan_NNI.cpp \
+ wlanedit.cpp \
+ wlanrun.cpp
+INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2
+DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2
+LIBS += -lqpe
+INTERFACES = wlanGUI.ui
+TARGET = wlan
+VERSION = 1.0.0
+
+include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/networksettings2/wlan/wlanGUI.cpp b/noncore/settings/networksettings2/wlan/wlanGUI.cpp
new file mode 100644
index 0000000..902bd27
--- a/dev/null
+++ b/noncore/settings/networksettings2/wlan/wlanGUI.cpp
@@ -0,0 +1,360 @@
+/****************************************************************************
+** Form implementation generated from reading ui file 'wlanGUI.ui'
+**
+** Created: Tue Mar 30 02:42:58 2004
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "wlanGUI.h"
+
+#include <qbuttongroup.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qprogressbar.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qspinbox.h>
+#include <qtabwidget.h>
+#include <qlayout.h>
+#include <qvariant.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a WLanGUI which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+WLanGUI::WLanGUI( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "WLanGUI" );
+ resize( 196, 329 );
+ setCaption( tr( "Form1" ) );
+ WLanGUILayout = new QVBoxLayout( this );
+ WLanGUILayout->setSpacing( 0 );
+ WLanGUILayout->setMargin( 0 );
+
+ tabWidget = new QTabWidget( this, "tabWidget" );
+ tabWidget->setEnabled( TRUE );
+
+ ConfigPage = new QWidget( tabWidget, "ConfigPage" );
+ ConfigPageLayout = new QVBoxLayout( ConfigPage );
+ ConfigPageLayout->setSpacing( 2 );
+ ConfigPageLayout->setMargin( 0 );
+
+ Layout6 = new QGridLayout;
+ Layout6->setSpacing( 6 );
+ Layout6->setMargin( 1 );
+
+ essidLabel = new QLabel( ConfigPage, "essidLabel" );
+ essidLabel->setEnabled( TRUE );
+ essidLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, essidLabel->sizePolicy().hasHeightForWidth() ) );
+ essidLabel->setText( tr( "ESS-ID" ) );
+
+ Layout6->addWidget( essidLabel, 1, 0 );
+
+ essid = new QComboBox( FALSE, ConfigPage, "essid" );
+ essid->insertItem( tr( "any" ) );
+ essid->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, essid->sizePolicy().hasHeightForWidth() ) );
+ essid->setEditable( TRUE );
+ essid->setCurrentItem( 0 );
+ essid->setSizeLimit( 5 );
+ essid->setAutoCompletion( TRUE );
+ essid->setDuplicatesEnabled( FALSE );
+
+ Layout6->addWidget( essid, 1, 1 );
+
+ modeLabel = new QLabel( ConfigPage, "modeLabel" );
+ modeLabel->setEnabled( TRUE );
+ modeLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, modeLabel->sizePolicy().hasHeightForWidth() ) );
+ modeLabel->setText( tr( "Mode" ) );
+
+ Layout6->addWidget( modeLabel, 0, 0 );
+
+ mode = new QComboBox( FALSE, ConfigPage, "mode" );
+ mode->insertItem( tr( "Infrastructure" ) );
+ mode->insertItem( tr( "Auto" ) );
+ mode->insertItem( tr( "Managed" ) );
+ mode->insertItem( tr( "Ad-Hoc" ) );
+ mode->setEnabled( TRUE );
+ mode->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, mode->sizePolicy().hasHeightForWidth() ) );
+
+ Layout6->addWidget( mode, 0, 1 );
+ ConfigPageLayout->addLayout( Layout6 );
+
+ Layout8 = new QGridLayout;
+ Layout8->setSpacing( 2 );
+ Layout8->setMargin( 1 );
+
+ specifyAp = new QCheckBox( ConfigPage, "specifyAp" );
+ specifyAp->setText( tr( "Specify &Access Point" ) );
+
+ Layout8->addMultiCellWidget( specifyAp, 0, 0, 0, 2 );
+
+ macLabel = new QLabel( ConfigPage, "macLabel" );
+ macLabel->setEnabled( FALSE );
+ macLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)1, macLabel->sizePolicy().hasHeightForWidth() ) );
+ macLabel->setText( tr( "MAC" ) );
+
+ Layout8->addWidget( macLabel, 1, 1 );
+
+ macEdit = new QLineEdit( ConfigPage, "macEdit" );
+ macEdit->setEnabled( FALSE );
+ macEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, macEdit->sizePolicy().hasHeightForWidth() ) );
+
+ Layout8->addWidget( macEdit, 1, 2 );
+ QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
+ Layout8->addItem( spacer, 1, 0 );
+ ConfigPageLayout->addLayout( Layout8 );
+
+ Layout7 = new QHBoxLayout;
+ Layout7->setSpacing( 6 );
+ Layout7->setMargin( 1 );
+
+ specifyChan = new QCheckBox( ConfigPage, "specifyChan" );
+ specifyChan->setText( tr( "Specific &Channel" ) );
+ Layout7->addWidget( specifyChan );
+
+ networkChannel = new QSpinBox( ConfigPage, "networkChannel" );
+ networkChannel->setEnabled( FALSE );
+ networkChannel->setMaxValue( 15 );
+ networkChannel->setMinValue( 1 );
+ networkChannel->setValue( 1 );
+ Layout7->addWidget( networkChannel );
+ ConfigPageLayout->addLayout( Layout7 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ ConfigPageLayout->addItem( spacer_2 );
+ tabWidget->insertTab( ConfigPage, tr( "General" ) );
+
+ WepPage = new QWidget( tabWidget, "WepPage" );
+ WepPageLayout = new QVBoxLayout( WepPage );
+ WepPageLayout->setSpacing( 2 );
+ WepPageLayout->setMargin( 0 );
+
+ wepEnabled = new QCheckBox( WepPage, "wepEnabled" );
+ wepEnabled->setText( tr( "&Enable Encryption" ) );
+ WepPageLayout->addWidget( wepEnabled );
+
+ KeyButtonGroup = new QButtonGroup( WepPage, "KeyButtonGroup" );
+ KeyButtonGroup->setEnabled( FALSE );
+ KeyButtonGroup->setTitle( tr( "&Key Setting" ) );
+ KeyButtonGroup->setColumnLayout(0, Qt::Vertical );
+ KeyButtonGroup->layout()->setSpacing( 0 );
+ KeyButtonGroup->layout()->setMargin( 0 );
+ KeyButtonGroupLayout = new QGridLayout( KeyButtonGroup->layout() );
+ KeyButtonGroupLayout->setAlignment( Qt::AlignTop );
+ KeyButtonGroupLayout->setSpacing( 2 );
+ KeyButtonGroupLayout->setMargin( 2 );
+
+ keyRadio0 = new QRadioButton( KeyButtonGroup, "keyRadio0" );
+ keyRadio0->setText( tr( "Key &1" ) );
+ keyRadio0->setChecked( TRUE );
+
+ KeyButtonGroupLayout->addWidget( keyRadio0, 0, 0 );
+
+ keyRadio3 = new QRadioButton( KeyButtonGroup, "keyRadio3" );
+ keyRadio3->setText( tr( "Key &4" ) );
+
+ KeyButtonGroupLayout->addWidget( keyRadio3, 3, 0 );
+
+ LineEdit6 = new QLineEdit( KeyButtonGroup, "LineEdit6" );
+
+ KeyButtonGroupLayout->addWidget( LineEdit6, 0, 1 );
+
+ keyRadio1 = new QRadioButton( KeyButtonGroup, "keyRadio1" );
+ keyRadio1->setText( tr( "Key &2" ) );
+
+ KeyButtonGroupLayout->addWidget( keyRadio1, 1, 0 );
+
+ keyRadio2 = new QRadioButton( KeyButtonGroup, "keyRadio2" );
+ keyRadio2->setText( tr( "Key &3" ) );
+
+ KeyButtonGroupLayout->addWidget( keyRadio2, 2, 0 );
+
+ LineEdit6_2 = new QLineEdit( KeyButtonGroup, "LineEdit6_2" );
+
+ KeyButtonGroupLayout->addWidget( LineEdit6_2, 1, 1 );
+
+ LineEdit6_4 = new QLineEdit( KeyButtonGroup, "LineEdit6_4" );
+
+ KeyButtonGroupLayout->addWidget( LineEdit6_4, 3, 1 );
+
+ LineEdit6_3 = new QLineEdit( KeyButtonGroup, "LineEdit6_3" );
+
+ KeyButtonGroupLayout->addWidget( LineEdit6_3, 2, 1 );
+ WepPageLayout->addWidget( KeyButtonGroup );
+
+ NonEncButtonGroup = new QButtonGroup( WepPage, "NonEncButtonGroup" );
+ NonEncButtonGroup->setEnabled( FALSE );
+ NonEncButtonGroup->setTitle( tr( "Non-encrypted Packets" ) );
+ NonEncButtonGroup->setRadioButtonExclusive( TRUE );
+ NonEncButtonGroup->setColumnLayout(0, Qt::Vertical );
+ NonEncButtonGroup->layout()->setSpacing( 0 );
+ NonEncButtonGroup->layout()->setMargin( 0 );
+ NonEncButtonGroupLayout = new QGridLayout( NonEncButtonGroup->layout() );
+ NonEncButtonGroupLayout->setAlignment( Qt::AlignTop );
+ NonEncButtonGroupLayout->setSpacing( 6 );
+ NonEncButtonGroupLayout->setMargin( 2 );
+
+ acceptNonEnc = new QRadioButton( NonEncButtonGroup, "acceptNonEnc" );
+ acceptNonEnc->setText( tr( "&Accept" ) );
+ acceptNonEnc->setChecked( TRUE );
+ NonEncButtonGroup->insert( acceptNonEnc, 0 );
+
+ NonEncButtonGroupLayout->addWidget( acceptNonEnc, 0, 0 );
+
+ rejectNonEnc = new QRadioButton( NonEncButtonGroup, "rejectNonEnc" );
+ rejectNonEnc->setText( tr( "&Reject" ) );
+ NonEncButtonGroup->insert( rejectNonEnc, 1 );
+
+ NonEncButtonGroupLayout->addWidget( rejectNonEnc, 0, 1 );
+ WepPageLayout->addWidget( NonEncButtonGroup );
+ QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ WepPageLayout->addItem( spacer_3 );
+ tabWidget->insertTab( WepPage, tr( "Encryption" ) );
+
+ tab = new QWidget( tabWidget, "tab" );
+ tabLayout = new QVBoxLayout( tab );
+ tabLayout->setSpacing( 2 );
+ tabLayout->setMargin( 0 );
+
+ Layout12 = new QGridLayout;
+ Layout12->setSpacing( 2 );
+ Layout12->setMargin( 0 );
+
+ TextLabel1_3 = new QLabel( tab, "TextLabel1_3" );
+ TextLabel1_3->setText( tr( "Station" ) );
+
+ Layout12->addWidget( TextLabel1_3, 0, 0 );
+
+ Channel_LBL = new QLabel( tab, "Channel_LBL" );
+ Channel_LBL->setFrameShape( QLabel::Panel );
+ Channel_LBL->setFrameShadow( QLabel::Sunken );
+
+ Layout12->addWidget( Channel_LBL, 3, 1 );
+
+ TextLabel4_3 = new QLabel( tab, "TextLabel4_3" );
+ TextLabel4_3->setText( tr( "Channel" ) );
+
+ Layout12->addWidget( TextLabel4_3, 3, 0 );
+
+ TextLabel3_3 = new QLabel( tab, "TextLabel3_3" );
+ TextLabel3_3->setText( tr( "Mode" ) );
+
+ Layout12->addWidget( TextLabel3_3, 2, 0 );
+
+ TextLabel2_3 = new QLabel( tab, "TextLabel2_3" );
+ TextLabel2_3->setText( tr( "ESSID" ) );
+
+ Layout12->addWidget( TextLabel2_3, 1, 0 );
+
+ TextLabel9_2 = new QLabel( tab, "TextLabel9_2" );
+ TextLabel9_2->setText( tr( "AP" ) );
+
+ Layout12->addWidget( TextLabel9_2, 4, 0 );
+
+ Station_LBL = new QLabel( tab, "Station_LBL" );
+ Station_LBL->setFrameShape( QLabel::Panel );
+ Station_LBL->setFrameShadow( QLabel::Sunken );
+
+ Layout12->addWidget( Station_LBL, 0, 1 );
+
+ Rate_LBL = new QLabel( tab, "Rate_LBL" );
+ Rate_LBL->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, Rate_LBL->sizePolicy().hasHeightForWidth() ) );
+ Rate_LBL->setFrameShape( QLabel::Panel );
+ Rate_LBL->setFrameShadow( QLabel::Sunken );
+
+ Layout12->addWidget( Rate_LBL, 5, 1 );
+
+ TextLabel4_2_2 = new QLabel( tab, "TextLabel4_2_2" );
+ TextLabel4_2_2->setText( tr( "Rate" ) );
+
+ Layout12->addWidget( TextLabel4_2_2, 5, 0 );
+
+ AP_LBL = new QLabel( tab, "AP_LBL" );
+ AP_LBL->setFrameShape( QLabel::Panel );
+ AP_LBL->setFrameShadow( QLabel::Sunken );
+
+ Layout12->addWidget( AP_LBL, 4, 1 );
+
+ essidLabel_3 = new QLabel( tab, "essidLabel_3" );
+ essidLabel_3->setFrameShape( QLabel::Panel );
+ essidLabel_3->setFrameShadow( QLabel::Sunken );
+
+ Layout12->addWidget( essidLabel_3, 1, 1 );
+
+ modeLabel_3 = new QLabel( tab, "modeLabel_3" );
+ modeLabel_3->setFrameShape( QLabel::Panel );
+ modeLabel_3->setFrameShadow( QLabel::Sunken );
+
+ Layout12->addWidget( modeLabel_3, 2, 1 );
+ tabLayout->addLayout( Layout12 );
+
+ GroupBox1 = new QGroupBox( tab, "GroupBox1" );
+ GroupBox1->setTitle( tr( "Link Quality" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 0 );
+ GroupBox1->layout()->setMargin( 0 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+ GroupBox1Layout->setSpacing( 2 );
+ GroupBox1Layout->setMargin( 2 );
+
+ TextLabel2_2_2 = new QLabel( GroupBox1, "TextLabel2_2_2" );
+ TextLabel2_2_2->setText( tr( "Noise" ) );
+
+ GroupBox1Layout->addWidget( TextLabel2_2_2, 1, 0 );
+
+ TextLabel3_2_2 = new QLabel( GroupBox1, "TextLabel3_2_2" );
+ TextLabel3_2_2->setText( tr( "Quality" ) );
+
+ GroupBox1Layout->addWidget( TextLabel3_2_2, 2, 0 );
+
+ Noise_PB = new QProgressBar( GroupBox1, "Noise_PB" );
+ Noise_PB->setProgress( 0 );
+
+ GroupBox1Layout->addWidget( Noise_PB, 1, 2 );
+
+ Quality_PB = new QProgressBar( GroupBox1, "Quality_PB" );
+ Quality_PB->setProgress( 0 );
+
+ GroupBox1Layout->addWidget( Quality_PB, 2, 2 );
+
+ TextLabel1_2_2 = new QLabel( GroupBox1, "TextLabel1_2_2" );
+ TextLabel1_2_2->setText( tr( "Signal" ) );
+
+ GroupBox1Layout->addWidget( TextLabel1_2_2, 0, 0 );
+ QSpacerItem* spacer_4 = new QSpacerItem( 16, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
+ GroupBox1Layout->addItem( spacer_4, 0, 1 );
+
+ Signal_PB = new QProgressBar( GroupBox1, "Signal_PB" );
+ Signal_PB->setProgress( 0 );
+
+ GroupBox1Layout->addWidget( Signal_PB, 0, 2 );
+ tabLayout->addWidget( GroupBox1 );
+ QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ tabLayout->addItem( spacer_5 );
+ tabWidget->insertTab( tab, tr( "State" ) );
+ WLanGUILayout->addWidget( tabWidget );
+
+ // signals and slots connections
+ connect( wepEnabled, SIGNAL( toggled(bool) ), KeyButtonGroup, SLOT( setEnabled(bool) ) );
+ connect( wepEnabled, SIGNAL( toggled(bool) ), NonEncButtonGroup, SLOT( setEnabled(bool) ) );
+ connect( specifyAp, SIGNAL( toggled(bool) ), macEdit, SLOT( setEnabled(bool) ) );
+ connect( specifyAp, SIGNAL( toggled(bool) ), macLabel, SLOT( setEnabled(bool) ) );
+ connect( specifyChan, SIGNAL( toggled(bool) ), networkChannel, SLOT( setEnabled(bool) ) );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+WLanGUI::~WLanGUI()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
diff --git a/noncore/settings/networksettings2/wlan/wlanGUI.h b/noncore/settings/networksettings2/wlan/wlanGUI.h
new file mode 100644
index 0000000..42e8705
--- a/dev/null
+++ b/noncore/settings/networksettings2/wlan/wlanGUI.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+** Form interface generated from reading ui file 'wlanGUI.ui'
+**
+** Created: Tue Mar 30 02:42:55 2004
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef WLANGUI_H
+#define WLANGUI_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QButtonGroup;
+class QCheckBox;
+class QComboBox;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QProgressBar;
+class QRadioButton;
+class QSpinBox;
+class QTabWidget;
+
+class WLanGUI : public QWidget
+{
+ Q_OBJECT
+
+public:
+ WLanGUI( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~WLanGUI();
+
+ QTabWidget* tabWidget;
+ QWidget* ConfigPage;
+ QLabel* essidLabel;
+ QComboBox* essid;
+ QLabel* modeLabel;
+ QComboBox* mode;
+ QCheckBox* specifyAp;
+ QLabel* macLabel;
+ QLineEdit* macEdit;
+ QCheckBox* specifyChan;
+ QSpinBox* networkChannel;
+ QWidget* WepPage;
+ QCheckBox* wepEnabled;
+ QButtonGroup* KeyButtonGroup;
+ QRadioButton* keyRadio0;
+ QRadioButton* keyRadio3;
+ QLineEdit* LineEdit6;
+ QRadioButton* keyRadio1;
+ QRadioButton* keyRadio2;
+ QLineEdit* LineEdit6_2;
+ QLineEdit* LineEdit6_4;
+ QLineEdit* LineEdit6_3;
+ QButtonGroup* NonEncButtonGroup;
+ QRadioButton* acceptNonEnc;
+ QRadioButton* rejectNonEnc;
+ QWidget* tab;
+ QLabel* TextLabel1_3;
+ QLabel* Channel_LBL;
+ QLabel* TextLabel4_3;
+ QLabel* TextLabel3_3;
+ QLabel* TextLabel2_3;
+ QLabel* TextLabel9_2;
+ QLabel* Station_LBL;
+ QLabel* Rate_LBL;
+ QLabel* TextLabel4_2_2;
+ QLabel* AP_LBL;
+ QLabel* essidLabel_3;
+ QLabel* modeLabel_3;
+ QGroupBox* GroupBox1;
+ QLabel* TextLabel2_2_2;
+ QLabel* TextLabel3_2_2;
+ QProgressBar* Noise_PB;
+ QProgressBar* Quality_PB;
+ QLabel* TextLabel1_2_2;
+ QProgressBar* Signal_PB;
+
+protected:
+ QVBoxLayout* WLanGUILayout;
+ QVBoxLayout* ConfigPageLayout;
+ QGridLayout* Layout6;
+ QGridLayout* Layout8;
+ QHBoxLayout* Layout7;
+ QVBoxLayout* WepPageLayout;
+ QGridLayout* KeyButtonGroupLayout;
+ QGridLayout* NonEncButtonGroupLayout;
+ QVBoxLayout* tabLayout;
+ QGridLayout* Layout12;
+ QGridLayout* GroupBox1Layout;
+};
+
+#endif // WLANGUI_H
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.cpp b/noncore/settings/networksettings2/wlan/wlan_NN.cpp
new file mode 100644
index 0000000..5a26e41
--- a/dev/null
+++ b/noncore/settings/networksettings2/wlan/wlan_NN.cpp
@@ -0,0 +1,60 @@
+#include "wlan_NN.h"
+#include "wlan_NNI.h"
+
+static const char * WLanNeeds[] =
+ { 0
+ };
+
+/**
+ * Constructor, find all of the possible interfaces
+ */
+WLanNetNode::WLanNetNode() : ANetNode() {
+}
+
+/**
+ * Delete any interfaces that we own.
+ */
+WLanNetNode::~WLanNetNode(){
+}
+
+const QString WLanNetNode::nodeDescription(){
+ return tr("\
+<p>Configure Wi/Fi or WLan network cards.</p>\
+<p>Defines Wireless options for those cards</p>\
+"
+);
+}
+
+ANetNodeInstance * WLanNetNode::createInstance( void ) {
+ return new AWLan( this );
+}
+
+const char ** WLanNetNode::needs( void ) {
+ return WLanNeeds;
+}
+
+const char * WLanNetNode::provides( void ) {
+ return "device";
+}
+
+bool WLanNetNode::generateProperFilesFor(
+ ANetNodeInstance * ) {
+ return 1;
+}
+
+bool WLanNetNode::hasDataFor( const QString & ) {
+ return 0;
+}
+
+bool WLanNetNode::generateDataForCommonFile(
+ SystemFile & ,
+ long,
+ ANetNodeInstance * ) {
+ return 1;
+}
+
+extern "C" {
+void create_plugin( QList<ANetNode> & PNN ) {
+ PNN.append( new WLanNetNode() );
+}
+}
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.h b/noncore/settings/networksettings2/wlan/wlan_NN.h
new file mode 100644
index 0000000..d1d6ded
--- a/dev/null
+++ b/noncore/settings/networksettings2/wlan/wlan_NN.h
@@ -0,0 +1,44 @@
+#ifndef WLAN_NETNODE_H
+#define WLAN_NETNODE_H
+
+#include "netnode.h"
+
+class AWLan;
+
+class WLanNetNode : public ANetNode{
+
+ Q_OBJECT
+
+public:
+
+ WLanNetNode();
+ virtual ~WLanNetNode();
+
+ virtual const QString pixmapName()
+ { return "wlan"; }
+
+ virtual const QString nodeName()
+ { return tr("WLan Device"); }
+
+ virtual const QString nodeDescription() ;
+
+ virtual ANetNodeInstance * createInstance( void );
+
+ virtual const char ** needs( void );
+ virtual const char * provides( void );
+
+ virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
+ virtual bool hasDataFor( const QString & S );
+ virtual bool generateDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+
+private:
+
+};
+
+extern "C"
+{
+ void create_plugin( QList<ANetNode> & PNN );
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.cpp b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp
new file mode 100644
index 0000000..92f3457
--- a/dev/null
+++ b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp
@@ -0,0 +1,30 @@
+#include "wlanedit.h"
+#include "wlan_NNI.h"
+#include "wlan_NN.h"
+
+AWLan::AWLan( WLanNetNode * PNN ) : ANetNodeInstance( PNN ) {
+ GUI = 0;
+ RT = 0;
+}
+
+void AWLan::setSpecificAttribute( QString & , QString & ) {
+}
+
+void AWLan::saveSpecificAttribute( QTextStream & ) {
+}
+
+QWidget * AWLan::edit( QWidget * parent ) {
+ GUI = new WLanEdit( parent );
+ GUI->showData( Data );
+ return GUI;
+}
+
+QString AWLan::acceptable( void ) {
+ return ( GUI ) ? GUI->acceptable( ) : QString();
+}
+
+void AWLan::commit( void ) {
+ if( GUI && GUI->commit( Data ) )
+ setModified( 1 );
+}
+
diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.h b/noncore/settings/networksettings2/wlan/wlan_NNI.h
new file mode 100644
index 0000000..8b695b5
--- a/dev/null
+++ b/noncore/settings/networksettings2/wlan/wlan_NNI.h
@@ -0,0 +1,43 @@
+#ifndef WLAN_H
+#define WLAN_H
+
+#include <netnode.h>
+#include "wlandata.h"
+#include "wlanrun.h"
+
+class WLanNetNode;
+class WLanEdit;
+
+class AWLan : public ANetNodeInstance {
+
+public :
+
+ AWLan( WLanNetNode * PNN );
+
+ QWidget * edit( QWidget * parent );
+ QString acceptable( void );
+ void commit( void );
+
+ RuntimeInfo * runtime( void )
+ { if( RT == 0 )
+ RT = new WLanRun( this, Data );
+ return RT;
+ }
+
+ virtual void * data( void )
+ { return (void *)&Data; }
+
+protected :
+
+ virtual void setSpecificAttribute( QString & Attr, QString & Value );
+ virtual void saveSpecificAttribute( QTextStream & TS );
+
+private :
+
+ WLanEdit * GUI;
+ WLanData Data;
+ WLanRun * RT;
+
+};
+
+#endif
diff --git a/noncore/settings/networksettings2/wlan/wlandata.h b/noncore/settings/networksettings2/wlan/wlandata.h
new file mode 100644
index 0000000..ba1f2c2
--- a/dev/null
+++ b/noncore/settings/networksettings2/wlan/wlandata.h
@@ -0,0 +1,17 @@
+#ifndef WLAN_DATA_H
+#define WLAN_DATA_H
+
+#include <qstring.h>
+typedef struct WLanData {
+ QString Device;
+ QString LockFile;
+ long Speed;
+ short Parity;
+ short DataBits;
+ short StopBits;
+ bool HardwareControl;
+ bool SoftwareControl;
+
+} WLanData_t;
+
+#endif
diff --git a/noncore/settings/networksettings2/wlan/wlanedit.cpp b/noncore/settings/networksettings2/wlan/wlanedit.cpp
new file mode 100644
index 0000000..c884886
--- a/dev/null
+++ b/noncore/settings/networksettings2/wlan/wlanedit.cpp
@@ -0,0 +1,16 @@
+#include <GUIUtils.h>
+#include "wlanedit.h"
+
+WLanEdit::WLanEdit( QWidget * Parent ) : WLanGUI( Parent ){
+}
+
+QString WLanEdit::acceptable( void ) {
+ return QString();
+}
+
+void WLanEdit::showData( WLanData_t & Data ) {
+}
+
+bool WLanEdit::commit( WLanData_t & Data ) {
+ return 0;
+}
diff --git a/noncore/settings/networksettings2/wlan/wlanedit.h b/noncore/settings/networksettings2/wlan/wlanedit.h
new file mode 100644
index 0000000..b7442d5
--- a/dev/null
+++ b/noncore/settings/networksettings2/wlan/wlanedit.h
@@ -0,0 +1,12 @@
+#include "wlandata.h"
+#include "wlanGUI.h"
+
+class WLanEdit : public WLanGUI {
+
+public :
+
+ WLanEdit( QWidget * parent );
+ QString acceptable( void );
+ void showData( WLanData_t & Data );
+ bool commit( WLanData_t & Data );
+};
diff --git a/noncore/settings/networksettings2/wlan/wlanrun.cpp b/noncore/settings/networksettings2/wlan/wlanrun.cpp
new file mode 100644
index 0000000..79f11f7
--- a/dev/null
+++ b/noncore/settings/networksettings2/wlan/wlanrun.cpp
@@ -0,0 +1,5 @@
+#include "wlanrun.h"
+
+bool WLanRun::handlesInterface( const QString & S ) {
+ return Pat.match( S ) >= 0;
+}
diff --git a/noncore/settings/networksettings2/wlan/wlanrun.h b/noncore/settings/networksettings2/wlan/wlanrun.h
new file mode 100644
index 0000000..4cbb059
--- a/dev/null
+++ b/noncore/settings/networksettings2/wlan/wlanrun.h
@@ -0,0 +1,42 @@
+#ifndef WLANRUN_H
+#define WLANRUN_H
+
+#include <qregexp.h>
+#include <asdevice.h>
+#include "wlandata.h"
+
+class WLanRun : public AsDevice {
+
+public :
+
+ WLanRun( ANetNodeInstance * NNI, WLanData & Data ) :
+ AsDevice( NNI ),
+ Pat( "wlan[0-9]" )
+ { }
+
+ virtual long count( void )
+ { return 2; }
+ virtual QString genNic( long nr )
+ { QString S; return S.sprintf( "wlan%ld", nr ); }
+ virtual AsDevice * device( void )
+ { return asDevice(); }
+
+protected :
+
+ void detectState( NodeCollection * )
+ { }
+
+ bool setState( NodeCollection *, Action_t )
+ { return 0; }
+
+ bool canSetState( State_t, Action_t )
+ { return 0; }
+
+ bool handlesInterface( const QString & I );
+
+private :
+
+ QRegExp Pat;
+};
+
+#endif