summaryrefslogtreecommitdiff
authorwimpie <wimpie>2004-04-04 00:27:59 (UTC)
committer wimpie <wimpie>2004-04-04 00:27:59 (UTC)
commita416c6c9630d6d63ee63cf520953b86af8b7cddc (patch) (side-by-side diff)
treedbd0f5173728129f5a3faffdafd4f73d8cc72407
parent152ffce2a4e8191d28738e3b40d8a726250a8767 (diff)
downloadopie-a416c6c9630d6d63ee63cf520953b86af8b7cddc.zip
opie-a416c6c9630d6d63ee63cf520953b86af8b7cddc.tar.gz
opie-a416c6c9630d6d63ee63cf520953b86af8b7cddc.tar.bz2
*** empty log message ***
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h2
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetooth_NN.h4
-rw-r--r--noncore/settings/networksettings2/cable/cable_NN.h2
-rw-r--r--noncore/settings/networksettings2/editconnection.cpp2
-rw-r--r--noncore/settings/networksettings2/irda/irda_NN.h2
-rw-r--r--noncore/settings/networksettings2/lancard/lancard_NN.h2
-rw-r--r--noncore/settings/networksettings2/main.cpp4
-rw-r--r--noncore/settings/networksettings2/modem/modem_NN.h2
-rw-r--r--noncore/settings/networksettings2/network/network_NN.h2
-rw-r--r--noncore/settings/networksettings2/network/networkrun.cpp2
-rw-r--r--noncore/settings/networksettings2/networksettings.cpp101
-rw-r--r--noncore/settings/networksettings2/networksettings.h8
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.cpp4
-rw-r--r--noncore/settings/networksettings2/networksettings2/resources.cpp5
-rw-r--r--noncore/settings/networksettings2/networksettings2/system.cpp1
-rw-r--r--noncore/settings/networksettings2/networksettingsGUI.ui185
-rw-r--r--noncore/settings/networksettings2/nsdata.cpp1
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.h2
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NNI.h2
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.cpp19
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.h20
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.h2
-rw-r--r--noncore/settings/networksettings2/usb/usb_NN.h2
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NN.h2
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NN.h2
25 files changed, 130 insertions, 250 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h
index 4dd508d..57ff95e 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h
@@ -16,13 +16,13 @@ public :
QWidget * edit( QWidget * parent );
QString acceptable( void );
void commit( void );
RuntimeInfo * runtime( void )
- { if( RT )
+ { if( RT == 0 )
RT = new BluetoothRFCOMMRun( this, Data );
return RT;
}
virtual void * data( void )
{ return (void *)&Data; }
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
index ee346f0..705201c 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
@@ -12,13 +12,13 @@ class BluetoothBNEPNetNode : public ANetNode {
public:
BluetoothBNEPNetNode();
virtual ~BluetoothBNEPNetNode();
virtual const QString pixmapName()
- { return "bluetooth"; }
+ { return "Devices/bluetooth"; }
virtual const QString nodeName()
{ return tr("Bluetooth PAN/NAP"); }
virtual const QString nodeDescription() ;
@@ -43,13 +43,13 @@ class BluetoothRFCOMMNetNode : public ANetNode {
public:
BluetoothRFCOMMNetNode();
virtual ~BluetoothRFCOMMNetNode();
virtual const QString pixmapName()
- { return "bluetooth"; }
+ { return "Devices/bluetooth"; }
virtual const QString nodeName()
{ return tr("Bluetooth serial link"); }
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/cable/cable_NN.h b/noncore/settings/networksettings2/cable/cable_NN.h
index 401317b..da99c1c 100644
--- a/noncore/settings/networksettings2/cable/cable_NN.h
+++ b/noncore/settings/networksettings2/cable/cable_NN.h
@@ -12,13 +12,13 @@ class CableNetNode : public ANetNode {
public:
CableNetNode();
virtual ~CableNetNode();
virtual const QString pixmapName()
- { return "cable"; }
+ { return "Devices/cable"; }
virtual const QString nodeName()
{ return tr("Cable Connection"); }
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/editconnection.cpp b/noncore/settings/networksettings2/editconnection.cpp
index d4b2bb3..ce13573 100644
--- a/noncore/settings/networksettings2/editconnection.cpp
+++ b/noncore/settings/networksettings2/editconnection.cpp
@@ -286,13 +286,13 @@ void EditConnection::buildFullTree( void ) {
continue;
}
MyQCheckListItem * it = new MyQCheckListItem( TheTop,
NN->nodeName(),
QCheckListItem::RadioButton );
- it->setPixmap( 0, NSResources->getPixmap( "commprofile" ) );
+ it->setPixmap( 0, NSResources->getPixmap( "Devices/commprofile" ) );
// remember that this node maps to this listitem
Mapping->insert( it, NN );
buildSubTree( it, NN );
}
}
diff --git a/noncore/settings/networksettings2/irda/irda_NN.h b/noncore/settings/networksettings2/irda/irda_NN.h
index 82811a4..6574c17 100644
--- a/noncore/settings/networksettings2/irda/irda_NN.h
+++ b/noncore/settings/networksettings2/irda/irda_NN.h
@@ -12,13 +12,13 @@ class IRDANetNode : public ANetNode {
public:
IRDANetNode();
virtual ~IRDANetNode();
virtual const QString pixmapName()
- { return "irda"; }
+ { return "Devices/irda"; }
virtual const QString nodeName()
{ return tr("Infrared link"); }
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.h b/noncore/settings/networksettings2/lancard/lancard_NN.h
index 576a6e0..71b49d0 100644
--- a/noncore/settings/networksettings2/lancard/lancard_NN.h
+++ b/noncore/settings/networksettings2/lancard/lancard_NN.h
@@ -12,13 +12,13 @@ class LanCardNetNode : public ANetNode{
public:
LanCardNetNode();
virtual ~LanCardNetNode();
virtual const QString pixmapName()
- { return "card"; }
+ { return "Devices/card"; }
virtual const QString nodeName()
{ return tr("LAN card"); }
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/main.cpp b/noncore/settings/networksettings2/main.cpp
index 1e1270e..7ec26a7 100644
--- a/noncore/settings/networksettings2/main.cpp
+++ b/noncore/settings/networksettings2/main.cpp
@@ -85,15 +85,15 @@ int main( int argc, char * argv[] ) {
rv = (NS.regenerate()) ? 1 : 0;
}
break;
case ACT_PROMPT :
{ ActivateProfile AP(argv[1]);
if( AP.exec() == QDialog::Accepted ) {
- printf( "%s-c%d-allowed", AP.selectedProfile() );
+ printf( "%s-c%ld-allowed", argv[1], AP.selectedProfile() );
} else {
- printf( "%s-cNN-disallowed" );
+ printf( "%s-cNN-disallowed", argv[1] );
}
}
break;
case ACT_GUI :
{ QWidget * W = new NetworkSettings(0);
TheApp->setMainWidget( W );
diff --git a/noncore/settings/networksettings2/modem/modem_NN.h b/noncore/settings/networksettings2/modem/modem_NN.h
index 0f4c124..5eceed2 100644
--- a/noncore/settings/networksettings2/modem/modem_NN.h
+++ b/noncore/settings/networksettings2/modem/modem_NN.h
@@ -12,13 +12,13 @@ class ModemNetNode : public ANetNode{
public:
ModemNetNode();
virtual ~ModemNetNode();
virtual const QString pixmapName()
- { return "modem"; }
+ { return "Devices/modem"; }
virtual const QString nodeName()
{ return tr("Dialup modem"); }
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/network/network_NN.h b/noncore/settings/networksettings2/network/network_NN.h
index 3b0cd64..220e00f 100644
--- a/noncore/settings/networksettings2/network/network_NN.h
+++ b/noncore/settings/networksettings2/network/network_NN.h
@@ -12,13 +12,13 @@ class NetworkNetNode : public ANetNode{
public:
NetworkNetNode();
virtual ~NetworkNetNode();
virtual const QString pixmapName()
- { return "tcpip"; }
+ { return "Devices/tcpip"; }
virtual const QString nodeName()
{ return tr("IP Configuration"); }
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/network/networkrun.cpp b/noncore/settings/networksettings2/network/networkrun.cpp
index e732bfa..8deca14 100644
--- a/noncore/settings/networksettings2/network/networkrun.cpp
+++ b/noncore/settings/networksettings2/network/networkrun.cpp
@@ -23,13 +23,13 @@ bool NetworkRun::setState( NodeCollection * NC, Action_t A ) {
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() );
+ S.sprintf( "ifup %s", II->Name.latin1() );
NSResources->system().execute( S );
NC->setCurrentState( IsUp );
}
return 1;
} else if( A == Down ) {
if( NC->currentState() == IsUp ) {
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp
index f72fa8e..e1110e2 100644
--- a/noncore/settings/networksettings2/networksettings.cpp
+++ b/noncore/settings/networksettings2/networksettings.cpp
@@ -1,10 +1,10 @@
#include <stdio.h>
#include <qpe/qpeapplication.h>
-#include <qiconset.h>
+#include <qlistbox.h>
#include <qgroupbox.h>
#include <qtimer.h>
#include <qlistbox.h>
#include <qmessagebox.h>
#include <qlabel.h>
#include <qiconview.h>
@@ -32,30 +32,27 @@ NetworkSettings::NetworkSettings( QWidget *parent,
Connect_TB->setPixmap( NSResources->getPixmap( "connected" ) );
On_TB->setPixmap( NSResources->getPixmap( "off" ) );
// populate main Listbox
- Profiles_IV->clear();
+ Profiles_LB->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() );
+ Profiles_LB->insertItem( NC->devicePixmap(),
+ NC->name() );
}
}
- if( Profiles_IV->count() ) {
- Profiles_IV->setSelected( Profiles_IV->firstItem(), TRUE );
+ if( Profiles_LB->count() ) {
+ Profiles_LB->setSelected( 0, TRUE );
}
// if no profiles -> auto popup editing
if( NSResources->connections().count() == 0 ) {
QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) );
}
@@ -88,24 +85,24 @@ NetworkSettings::~NetworkSettings() {
0,
tr( "Saving setup" ), S );
}
}
void NetworkSettings::SLOT_RefreshStates( void ) {
- QIconViewItem * IVI = Profiles_IV->currentItem(); // remeber
+ QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); // remember
- if( IVI ) {
+ if( LBI ) {
NodeCollection * NC;
NSResources->system().probeInterfaces();
// update current selection only
- NC = NSResources->findConnection( IVI->text() );
+ NC = NSResources->findConnection( LBI->text() );
if( NC ) {
State_t OldS = NC->state();
State_t NewS = NC->state(1);
if( OldS != NewS ) {
- updateProfileState( IVI );
+ updateProfileState( LBI );
}
}
}
/* -> LATER !!
@@ -135,35 +132,35 @@ void NetworkSettings::SLOT_RefreshStates( void ) {
void NetworkSettings::SLOT_AddNode( void ) {
SLOT_EditNode( 0 );
}
void NetworkSettings::SLOT_DeleteNode( void ) {
- QIconViewItem * IVI = Profiles_IV->currentItem();
+ QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
- if ( ! IVI )
+ if ( ! LBI )
return;
if( QMessageBox::warning(
0,
tr( "Removing profile" ),
tr( "Remove selected profile ?" ),
1, 0 ) == 1 ) {
- NSResources->removeConnection( IVI->text() );
- delete IVI;
+ NSResources->removeConnection( LBI->text() );
+ delete LBI;
setModified( 1 );
NSD.forceGeneration(1);
}
}
-void NetworkSettings::SLOT_EditNode( QIconViewItem * IVI ) {
+void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
QString OldName = "";
EditConnection EC( this );
- if( IVI ) {
- NodeCollection * NC = NSResources->findConnection( IVI->text() );
+ if( LBI ) {
+ NodeCollection * NC = NSResources->findConnection( LBI->text() );
if( ! NC ) {
return;
}
OldName = NC->name();
EC.setConnection( NC );
}
@@ -173,47 +170,47 @@ void NetworkSettings::SLOT_EditNode( QIconViewItem * IVI ) {
UpdateTimer->stop();
if( EC.exec() == QDialog::Accepted ) {
// toplevel item -> store
NodeCollection * NC = EC.connection();
if( NC->isModified() ) {
setModified( 1 );
- if( IVI ) {
+ if( LBI ) {
// 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() );
+ Profiles_LB->changeItem( NC->devicePixmap(),
+ NC->name(),
+ Profiles_LB->index( LBI )
+ );
} else {
// new item
+ int ci = Profiles_LB->count();
NSResources->addConnection( NC );
NC->setNumber( NC->maxConnectionNumber()+1 );
- IVI = new QIconViewItem( Profiles_IV,
- NC->name(),
- NC->devicePixmap()
- );
- Profiles_IV->setSelected( IVI, TRUE );
+ Profiles_LB->insertItem( NC->devicePixmap(), NC->name() );
+ Profiles_LB->setSelected( ci, TRUE );
}
- updateProfileState( IVI );
+ updateProfileState( LBI );
}
} else {
// cancelled : reset connection
- if( IVI ) {
- NodeCollection * NC = NSResources->findConnection( IVI->text() );
+ if( LBI ) {
+ NodeCollection * NC = NSResources->findConnection( LBI->text() );
NC->reassign();
}
}
// reenable
UpdateTimer->start( 5000 );
}
-void NetworkSettings::SLOT_ShowNode( QIconViewItem * IVI ) {
- if( IVI == 0 )
+void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) {
+ if( LBI == 0 )
return;
- NodeCollection * NC = NSResources->findConnection( IVI->text() );
+ NodeCollection * NC = NSResources->findConnection( LBI->text() );
// is button possible
bool EnabledPossible, OnPossible, ConnectPossible;
// is button On or Off
bool DisabledOn, OnOn, ConnectOn;
@@ -258,26 +255,26 @@ void NetworkSettings::SLOT_ShowNode( QIconViewItem * IVI ) {
if( NC->description().isEmpty() ) {
Description_LBL->setText( tr( "No description" ) );
} else {
Description_LBL->setText( NC->description() );
}
- CurProfile_GB->setTitle( IVI->text() );
+ CurProfile_GB->setTitle( LBI->text() );
State_LBL->setText( NC->stateName() );
}
void NetworkSettings::SLOT_CheckState( void ) {
- QIconViewItem * IVI = Profiles_IV->currentItem();
- if ( ! IVI )
+ QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
+ if ( ! LBI )
return;
- updateProfileState( IVI );
+ updateProfileState( LBI );
}
-void NetworkSettings::updateProfileState( QIconViewItem * IVI ) {
- if( IVI == Profiles_IV->currentItem() ) {
- SLOT_ShowNode( IVI );
+void NetworkSettings::updateProfileState( QListBoxItem * LBI ) {
+ if( LBI == Profiles_LB->item( Profiles_LB->currentItem() ) ) {
+ SLOT_ShowNode( LBI );
}
}
void NetworkSettings::SLOT_GenerateConfig( void ) {
QString S = NSD.generateSettings( TRUE );
@@ -288,19 +285,19 @@ void NetworkSettings::SLOT_GenerateConfig( void ) {
S
);
}
}
void NetworkSettings::SLOT_Enable( void ) {
- QIconViewItem * IVI = Profiles_IV->currentItem();
+ QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
QString Msg;
- if ( ! IVI )
+ if ( ! LBI )
return;
NodeCollection * NC =
- NSResources->findConnection( IVI->text() );
+ NSResources->findConnection( LBI->text() );
bool rv;
switch( NC->state() ) {
case Disabled :
Msg = tr( "Cannot enable profile" );
rv = NC->setState( Enable );
@@ -315,23 +312,23 @@ void NetworkSettings::SLOT_Enable( void ) {
QMessageBox::warning(
0,
tr( "Activating profile" ),
Msg );
return;
}
- updateProfileState( IVI );
+ updateProfileState( LBI );
}
void NetworkSettings::SLOT_On( void ) {
- QIconViewItem * IVI = Profiles_IV->currentItem();
+ QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
- if ( ! IVI )
+ if ( ! LBI )
return;
NodeCollection * NC =
- NSResources->findConnection( IVI->text() );
+ NSResources->findConnection( LBI->text() );
bool rv;
switch( NC->state() ) {
case Off :
// activate interface
rv = NC->setState( Activate );
@@ -354,23 +351,23 @@ void NetworkSettings::SLOT_On( void ) {
QMessageBox::warning(
0,
tr( "Activating profile" ),
tr( "Cannot enable profile" ) );
return;
}
- updateProfileState( IVI );
+ updateProfileState( LBI );
}
void NetworkSettings::SLOT_Connect( void ) {
- QIconViewItem * IVI = Profiles_IV->currentItem();
+ QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
- if ( ! IVI )
+ if ( ! LBI )
return;
NodeCollection * NC =
- NSResources->findConnection( IVI->text() );
+ NSResources->findConnection( LBI->text() );
bool rv;
switch( NC->state() ) {
case IsUp :
// down interface
rv = NC->setState( Down );
diff --git a/noncore/settings/networksettings2/networksettings.h b/noncore/settings/networksettings2/networksettings.h
index fadf81b..d9ea5d4 100644
--- a/noncore/settings/networksettings2/networksettings.h
+++ b/noncore/settings/networksettings2/networksettings.h
@@ -2,13 +2,13 @@
#include "networksettingsGUI.h"
#include "resources.h"
class ANetNode;
class ANetNodeInstance;
class QTimer;
-class QIconViewItem;
+class QListBoxItem;
class NetworkSettings : public NetworkSettingsGUI {
Q_OBJECT
public :
@@ -27,23 +27,23 @@ public :
{ NSD.setModified( m ); }
public slots :
void SLOT_AddNode( void );
void SLOT_DeleteNode( void );
- void SLOT_ShowNode( QIconViewItem * );
- void SLOT_EditNode( QIconViewItem * );
+ void SLOT_ShowNode( QListBoxItem * );
+ void SLOT_EditNode( QListBoxItem * );
void SLOT_CheckState( void );
void SLOT_Enable( void );
void SLOT_On( void );
void SLOT_Connect( void );
void SLOT_GenerateConfig( void );
void SLOT_RefreshStates( void );
void SLOT_QCopMessage( const QCString&,const QByteArray& );
private :
- void updateProfileState( QIconViewItem * it );
+ void updateProfileState( QListBoxItem * it );
QTimer * UpdateTimer;
NetworkSettingsData NSD;
};
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.cpp b/noncore/settings/networksettings2/networksettings2/netnode.cpp
index d36a1e5..f040c99 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.cpp
+++ b/noncore/settings/networksettings2/networksettings2/netnode.cpp
@@ -229,14 +229,14 @@ static char * State2PixmapTbl[] = {
"off", // off
"disconnected", // available
"connected" // up
};
QPixmap NodeCollection::devicePixmap( void ) {
- return NSResources->getPixmap(
- device()->netNode()->pixmapName()+"-large" );
+ return NSResources->getPixmap(
+ device()->netNode()->pixmapName()+"-large" );
}
QPixmap NodeCollection::statePixmap( State_t S) {
return NSResources->getPixmap( State2PixmapTbl[S] );
}
diff --git a/noncore/settings/networksettings2/networksettings2/resources.cpp b/noncore/settings/networksettings2/networksettings2/resources.cpp
index 15e1b64..0301361 100644
--- a/noncore/settings/networksettings2/networksettings2/resources.cpp
+++ b/noncore/settings/networksettings2/networksettings2/resources.cpp
@@ -165,13 +165,16 @@ bool TheNSResources::loadNetNode(
}
return 1;
}
QPixmap TheNSResources::getPixmap( const QString & QS ) {
- return Resource::loadPixmap( QString("networksettings2")+QS );
+ QString S("networksettings2/");
+ S += QS;
+ printf( " pixmap %s\n", S.latin1() );
+ return Resource::loadPixmap( QString("networksettings2/")+QS );
}
QString TheNSResources::tr( const char * s ) {
return qApp->translate( "resource", s );
}
diff --git a/noncore/settings/networksettings2/networksettings2/system.cpp b/noncore/settings/networksettings2/networksettings2/system.cpp
index 99f642e..85dcd7d 100644
--- a/noncore/settings/networksettings2/networksettings2/system.cpp
+++ b/noncore/settings/networksettings2/networksettings2/system.cpp
@@ -311,8 +311,9 @@ void System::probeInterfaces( void ) {
if( ioctl(sockfd, SIOCGIFNETMASK, &ifrs) >= 0 ) {
IFI->Netmask =
inet_ntoa(((struct sockaddr_in*)&ifrs.ifr_netmask)->sin_addr);
} else {
IFI->Netmask = "";
}
+ fprintf( stderr, "NIC %s UP %d\n", NicName.latin1(), IFI->IsUp );
}
}
diff --git a/noncore/settings/networksettings2/networksettingsGUI.ui b/noncore/settings/networksettings2/networksettingsGUI.ui
index d457c35..1d79123 100644
--- a/noncore/settings/networksettings2/networksettingsGUI.ui
+++ b/noncore/settings/networksettings2/networksettingsGUI.ui
@@ -8,13 +8,13 @@
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>403</width>
+ <width>399</width>
<height>502</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>Network Settings</string>
@@ -29,13 +29,13 @@
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
- <number>2</number>
+ <number>0</number>
</property>
<widget>
<class>QFrame</class>
<property stdset="1">
<name>name</name>
<cstring>Frame4</cstring>
@@ -241,167 +241,32 @@
<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>
+ <class>QListBox</class>
<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>
+ <cstring>Profiles_LB</cstring>
</property>
</widget>
<widget>
<class>QGroupBox</class>
<property stdset="1">
<name>name</name>
<cstring>CurProfile_GB</cstring>
</property>
<property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
<name>title</name>
<string></string>
</property>
<property>
<name>layoutMargin</name>
</property>
@@ -515,18 +380,12 @@
</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>
@@ -565,34 +424,34 @@
<sender>GenConfig_TB</sender>
<signal>clicked()</signal>
<receiver>NetworkSettingsGUI</receiver>
<slot>SLOT_GenerateConfig()</slot>
</connection>
<connection>
- <sender>Profiles_IV</sender>
- <signal>selectionChanged(QIconViewItem*)</signal>
+ <sender>Profiles_LB</sender>
+ <signal>clicked(QListBoxItem*)</signal>
<receiver>NetworkSettingsGUI</receiver>
- <slot>SLOT_ShowNode( QIconViewItem*)</slot>
+ <slot>SLOT_ShowNode( QListBoxItem*)</slot>
</connection>
<connection>
- <sender>Profiles_IV</sender>
- <signal>doubleClicked(QIconViewItem*)</signal>
+ <sender>Profiles_LB</sender>
+ <signal>currentChanged(QListBoxItem*)</signal>
<receiver>NetworkSettingsGUI</receiver>
- <slot>SLOT_EditNode( QIconViewItem*)</slot>
+ <slot>SLOT_ShowNode( QListBoxItem*)</slot>
</connection>
<connection>
- <sender>Profiles_IV</sender>
- <signal>currentChanged(QIconViewItem*)</signal>
+ <sender>Profiles_LB</sender>
+ <signal>doubleClicked(QListBoxItem*)</signal>
<receiver>NetworkSettingsGUI</receiver>
- <slot>SLOT_ShowNode( QIconViewItem*)</slot>
+ <slot>SLOT_EditNode( QListBoxItem *)</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_EditNode( QListBoxItem *)</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>
+ <slot access="public">SLOT_ShowNode( QListBoxItem*)</slot>
</connections>
</UI>
diff --git a/noncore/settings/networksettings2/nsdata.cpp b/noncore/settings/networksettings2/nsdata.cpp
index 9b2ad3a..3f5e958 100644
--- a/noncore/settings/networksettings2/nsdata.cpp
+++ b/noncore/settings/networksettings2/nsdata.cpp
@@ -16,12 +16,13 @@ NetworkSettingsData::NetworkSettingsData( void ) {
new TheNSResources();
CfgFile.sprintf( "%s/NETCONFIG", getenv("HOME") );
// load settings
Force = 0;
+ IsModified = 0;
loadSettings();
}
// saving is done by caller
NetworkSettingsData::~NetworkSettingsData( void ) {
delete NSResources;
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.h b/noncore/settings/networksettings2/ppp/ppp_NN.h
index a933523..3f9a338 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NN.h
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.h
@@ -12,13 +12,13 @@ class PPPNetNode : public ANetNode{
public:
PPPNetNode();
virtual ~PPPNetNode();
virtual const QString pixmapName()
- { return "ppp"; }
+ { return "Devices/ppp"; }
virtual const QString nodeName()
{ return tr("PPP Connection"); }
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.h b/noncore/settings/networksettings2/ppp/ppp_NNI.h
index 08dca1d..a17721a 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NNI.h
+++ b/noncore/settings/networksettings2/ppp/ppp_NNI.h
@@ -18,13 +18,13 @@ public :
QString acceptable( void );
void commit( void );
RuntimeInfo * runtime( void )
{ if( RT == 0 )
RT = new PPPRun( this, Data );
- return RT;
+ return RT->runtimeInfo();
}
virtual void * data( void )
{ return (void *)&Data; }
protected :
diff --git a/noncore/settings/networksettings2/ppp/ppprun.cpp b/noncore/settings/networksettings2/ppp/ppprun.cpp
index 8933f85..4ac0c5a 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.cpp
+++ b/noncore/settings/networksettings2/ppp/ppprun.cpp
@@ -1,20 +1,33 @@
#include <resources.h>
#include "ppprun.h"
+PPPRun::PPPRun( ANetNodeInstance * NNI, PPPData & Data ) :
+ AsConnection( NNI ), AsDevice( NNI ), Pat( "eth[0-9]" ) {
+ D = &Data;
+}
+
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 );
+ ANetNodeInstance * NNI;
+ RuntimeInfo * RI;
+ NNI = AsDevice::netNode();
+ printf( "%p\n", NNI );
+ NNI = NNI->nextNode();
+ printf( "%p\n", NNI );
+ RI = NNI->runtime();
+ printf( "%p\n", RI );
+ RI->detectState( NC );
}
}
bool PPPRun::setState( NodeCollection * NC, Action_t A ) {
switch( A ) {
case Activate :
@@ -49,24 +62,24 @@ bool PPPRun::setState( NodeCollection * NC, Action_t A ) {
bool PPPRun::isMyPPPDRunning( void ) {
return 0;
}
bool PPPRun::isMyPPPUp( void ) {
System & S = NSResources->system();
- InterfaceInfo * best = 0, * Run;
+ InterfaceInfo * 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() ) {
+ if( Run->assignedNode() == AsDevice::netNode() ) {
// assigned to us
return 1;
}
}
}
return 0;
diff --git a/noncore/settings/networksettings2/ppp/ppprun.h b/noncore/settings/networksettings2/ppp/ppprun.h
index 76a05be..abb9176 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.h
+++ b/noncore/settings/networksettings2/ppp/ppprun.h
@@ -1,29 +1,35 @@
#ifndef PPPRUN_H
#define PPPRUN_H
#include <qregexp.h>
#include <asconnection.h>
+#include <asdevice.h>
#include "pppdata.h"
-class PPPRun : public AsConnection {
+class PPPRun : public AsConnection, public AsDevice {
public :
PPPRun( ANetNodeInstance * NNI,
- PPPData & Data ) :
- AsConnection( NNI ),
- Pat( "eth[0-9]" )
- { D = &Data; }
+ PPPData & Data );
+ virtual QString genNic( long NicNr )
+ { QString S; return S.sprintf( "ppp%ld", NicNr ); }
-protected :
+ virtual AsDevice * device( void )
+ { return AsDevice::asDevice(); }
+ virtual RuntimeInfo * runtimeInfo( void )
+ { return ( AsConnection *)this; }
+
+ protected :
void detectState( NodeCollection * NC );
bool setState( NodeCollection * NC, Action_t A );
bool canSetState( State_t S, Action_t A )
- { return connection()->findNext( netNode() )->runtime()->canSetState( S,A ); }
+ { return AsDevice::connection()->findNext(
+ AsDevice::netNode() )->runtime()->canSetState( S,A ); }
bool handlesInterface( const QString & I );
private :
bool isMyPPPDRunning( void );
diff --git a/noncore/settings/networksettings2/profile/profile_NN.h b/noncore/settings/networksettings2/profile/profile_NN.h
index 2b469c7..3c06947 100644
--- a/noncore/settings/networksettings2/profile/profile_NN.h
+++ b/noncore/settings/networksettings2/profile/profile_NN.h
@@ -12,13 +12,13 @@ class ProfileNetNode : public ANetNode{
public:
ProfileNetNode();
virtual ~ProfileNetNode();
virtual const QString pixmapName()
- { return "commprofile"; }
+ { return "Devices/commprofile"; }
virtual const QString nodeName()
{ return tr("Regular profile"); }
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/usb/usb_NN.h b/noncore/settings/networksettings2/usb/usb_NN.h
index 3871afc..8b97452 100644
--- a/noncore/settings/networksettings2/usb/usb_NN.h
+++ b/noncore/settings/networksettings2/usb/usb_NN.h
@@ -12,13 +12,13 @@ class USBNetNode : public ANetNode{
public:
USBNetNode();
virtual ~USBNetNode();
virtual const QString pixmapName()
- { return "usb"; }
+ { return "Devices/usb"; }
virtual const QString nodeName()
{ return tr("USB Cable Connect"); }
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.h b/noncore/settings/networksettings2/vpn/vpn_NN.h
index 5718961..a113ab9 100644
--- a/noncore/settings/networksettings2/vpn/vpn_NN.h
+++ b/noncore/settings/networksettings2/vpn/vpn_NN.h
@@ -12,13 +12,13 @@ class VPNNetNode : public ANetNode{
public:
VPNNetNode();
virtual ~VPNNetNode();
virtual const QString pixmapName()
- { return "vpn"; }
+ { return "Devices/vpn"; }
virtual const QString nodeName()
{ return tr("VPN Connection"); }
virtual const QString nodeDescription() ;
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.h b/noncore/settings/networksettings2/wlan/wlan_NN.h
index d1d6ded..0728a79 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NN.h
+++ b/noncore/settings/networksettings2/wlan/wlan_NN.h
@@ -12,13 +12,13 @@ class WLanNetNode : public ANetNode{
public:
WLanNetNode();
virtual ~WLanNetNode();
virtual const QString pixmapName()
- { return "wlan"; }
+ { return "Devices/wlan"; }
virtual const QString nodeName()
{ return tr("WLan Device"); }
virtual const QString nodeDescription() ;