Diffstat (limited to 'noncore/settings/networksettings2/networksettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp index 78b6cce..80dcb3d 100644 --- a/noncore/settings/networksettings2/networksettings.cpp +++ b/noncore/settings/networksettings2/networksettings.cpp @@ -63,12 +63,12 @@ NetworkSettings::NetworkSettings( QWidget *parent, connect( Profiles_LB, SIGNAL(rightButtonPressed(QListBoxItem*,const QPoint&)), this, SLOT(SLOT_EditNode(QListBoxItem*)) ); - { Name2Connection_t & M = NSResources->connections(); - NodeCollection * NC; - // for all connections - for( QDictIterator<NodeCollection> it(M); + { Name2NetworkSetup_t & M = NSResources->networkSetups(); + NetworkSetup * NC; + // for all NetworkSetups + for( QDictIterator<NetworkSetup> it(M); it.current(); ++it ) { NC = it.current(); Profiles_LB->insertItem( NC->devicePixmap(), @@ -80,9 +80,9 @@ NetworkSettings::NetworkSettings( QWidget *parent, Profiles_LB->setSelected( 0, TRUE ); } // if no profiles -> auto popup editing - if( NSResources->connections().count() == 0 ) { + if( NSResources->networkSetups().count() == 0 ) { QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) ); } connect( &(NSResources->system()), @@ -135,12 +135,12 @@ void NetworkSettings::SLOT_CmdMessage( const QString & S ) { void NetworkSettings::SLOT_RefreshStates( void ) { QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); // remember if( LBI ) { - NodeCollection * NC; + NetworkSetup * NC; NSResources->system().probeInterfaces(); // update current selection only - NC = NSResources->findConnection( LBI->text() ); + NC = NSResources->findNetworkSetup( LBI->text() ); if( NC ) { State_t OldS = NC->state(); State_t NewS = NC->state(1); if( OldS != NewS ) { @@ -151,12 +151,12 @@ void NetworkSettings::SLOT_RefreshStates( void ) { /* -> LATER !! bool is; - NodeCollection * NC; + NetworkSetup * NC; for( unsigned int i = 0; i < Profiles_LB->count() ; i ++ ) { - NC = NSResources->findConnection( Profiles_LB->text(i) ); + NC = NSResources->findNetworkSetup( Profiles_LB->text(i) ); if( NC ) { State_t OldS = NC->state(); State_t NewS = NC->state(1); if( OldS != NewS ) { @@ -189,26 +189,26 @@ void NetworkSettings::SLOT_DeleteNode( void ) { 0, tr( "Removing profile" ), tr( "Remove selected profile ?" ), 1, 0 ) == 1 ) { - NSResources->removeConnection( LBI->text() ); + NSResources->removeNetworkSetup( LBI->text() ); delete LBI; NSD.setModified( 1 ); } } void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { QString OldName = ""; - EditConnection EC( this ); + EditNetworkSetup EC( this ); if( LBI ) { - NodeCollection * NC = NSResources->findConnection( LBI->text() ); + NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() ); if( ! NC ) { return; } OldName = NC->name(); - EC.setConnection( NC ); + EC.setNetworkSetup( NC ); } EC.showMaximized(); // disable refresh timer @@ -217,14 +217,14 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { // we need to retry while( 1 ) { if( EC.exec() == QDialog::Accepted ) { // toplevel item -> store - NodeCollection * NC = EC.connection(); + NetworkSetup * NC = EC.networkSetup(); if( NC->isModified() ) { if( LBI ) { if( NC->name() != OldName ) { // find if new name is free - NodeCollection * LCN = NSResources->findConnection( + NetworkSetup * LCN = NSResources->findNetworkSetup( NC->name() ); if( LCN ) { QMessageBox::warning( 0, @@ -233,10 +233,10 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { ); continue; // restart exec } // else new name // new name -> remove item - NSResources->removeConnection( OldName ); - NSResources->addConnection( NC, 0 ); + NSResources->removeNetworkSetup( OldName ); + NSResources->addNetworkSetup( NC, 0 ); } // else not changed // must add it here since change will trigger event Profiles_LB->changeItem( NC->devicePixmap(), @@ -245,19 +245,19 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { ); } else { // new item int ci = Profiles_LB->count(); - NSResources->addConnection( NC, 0 ); - NC->setNumber( NSResources->assignConnectionNumber() ); + NSResources->addNetworkSetup( NC, 0 ); + NC->setNumber( NSResources->assignNetworkSetupNumber() ); Profiles_LB->insertItem( NC->devicePixmap(), NC->name() ); Profiles_LB->setSelected( ci, TRUE ); } updateProfileState( LBI ); } } else { - // cancelled : reset connection + // cancelled : reset NetworkSetup if( LBI ) { - NodeCollection * NC = NSResources->findConnection( LBI->text() ); + NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() ); NC->reassign(); } } break; @@ -269,9 +269,9 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) { if( LBI == 0 ) return; - NodeCollection * NC = NSResources->findConnection( LBI->text() ); + NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() ); if( NC->description().isEmpty() ) { Description_LBL->setText( tr( "<<No description>>" ) ); } else { @@ -352,9 +352,9 @@ void NetworkSettings::SLOT_Disable( bool T ) { if ( ! LBI ) return; - NodeCollection * NC = NSResources->findConnection( LBI->text() ); + NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() ); Log(( "Prepare to %sable\n", (T) ? "en" : "dis" )); Msg = NC->setState( (T) ? Disable : Enable ); if( ! Msg.isEmpty() ) { @@ -381,10 +381,10 @@ void NetworkSettings::SLOT_Up( void ) { if ( ! LBI ) return; - NodeCollection * NC = - NSResources->findConnection( LBI->text() ); + NetworkSetup * NC = + NSResources->findNetworkSetup( LBI->text() ); switch( NC->state() ) { case Disabled : // cannot modify this state case Unknown : // cannot modify this state @@ -437,10 +437,10 @@ void NetworkSettings::SLOT_Down( void ) { if ( ! LBI ) return; - NodeCollection * NC = - NSResources->findConnection( LBI->text() ); + NetworkSetup * NC = + NSResources->findNetworkSetup( LBI->text() ); switch( NC->state() ) { case Disabled : // cannot modify this state case Unknown : // cannot modify this state |