summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/networksettings.cpp
authorwimpie <wimpie>2005-01-11 21:42:31 (UTC)
committer wimpie <wimpie>2005-01-11 21:42:31 (UTC)
commit96678694f8952f60d0a895cede2b621404b4bfb8 (patch) (side-by-side diff)
tree7138e554e5ba200b8f9ca8b51c89b47531dc34f2 /noncore/settings/networksettings2/networksettings.cpp
parentf89120a7a1a3d0bf9c0805456490906ca914e560 (diff)
downloadopie-96678694f8952f60d0a895cede2b621404b4bfb8.zip
opie-96678694f8952f60d0a895cede2b621404b4bfb8.tar.gz
opie-96678694f8952f60d0a895cede2b621404b4bfb8.tar.bz2
Major rename of NodeCollection to NetworkSetup
this commit is broken (missing symbols)
Diffstat (limited to 'noncore/settings/networksettings2/networksettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/networksettings.cpp54
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
@@ -61,16 +61,16 @@ NetworkSettings::NetworkSettings( QWidget *parent,
Profiles_LB->viewport(), QPEApplication::RightOnHold );
connect( Profiles_LB,
SIGNAL(rightButtonPressed(QListBoxItem*,const QPoint&)),
this, SLOT(SLOT_EditNode(QListBoxItem*)) );
- { Name2Connection_t & M = NSResources->connections();
- NodeCollection * NC;
- // for all connections
- for( QDictIterator<NodeCollection> it(M);
+ { Name2NetworkSetup_t & M = NSResources->networkSetups();
+ NetworkSetup * NC;
+ // for all NetworkSetups
+ for( QDictIterator<NetworkSetup> it(M);
it.current();
++it ) {
NC = it.current();
Profiles_LB->insertItem( NC->devicePixmap(),
NC->name() );
}
@@ -78,13 +78,13 @@ NetworkSettings::NetworkSettings( QWidget *parent,
if( Profiles_LB->count() ) {
Profiles_LB->setSelected( 0, TRUE );
}
// if no profiles -> auto popup editing
- if( NSResources->connections().count() == 0 ) {
+ if( NSResources->networkSetups().count() == 0 ) {
QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) );
}
connect( &(NSResources->system()),
SIGNAL( stdoutLine(const QString &) ),
this, SLOT( SLOT_CmdMessage(const QString &) ) );
@@ -133,32 +133,32 @@ 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 ) {
updateProfileState( LBI );
}
}
}
/* -> LATER !!
bool is;
- NodeCollection * NC;
+ NetworkSetup * NC;
for( unsigned int i = 0; i < Profiles_LB->count() ; i ++ ) {
- NC = NSResources->findConnection( Profiles_LB->text(i) );
+ NC = NSResources->findNetworkSetup( Profiles_LB->text(i) );
if( NC ) {
State_t OldS = NC->state();
State_t NewS = NC->state(1);
if( OldS != NewS ) {
is = Profiles_LB->isSelected(i);
Profiles_LB->changeItem( NC->statePixmap(NewS),
@@ -187,79 +187,79 @@ void NetworkSettings::SLOT_DeleteNode( void ) {
if( QMessageBox::warning(
0,
tr( "Removing profile" ),
tr( "Remove selected profile ?" ),
1, 0 ) == 1 ) {
- NSResources->removeConnection( LBI->text() );
+ NSResources->removeNetworkSetup( LBI->text() );
delete LBI;
NSD.setModified( 1 );
}
}
void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
QString OldName = "";
- EditConnection EC( this );
+ EditNetworkSetup EC( this );
if( LBI ) {
- NodeCollection * NC = NSResources->findConnection( LBI->text() );
+ NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
if( ! NC ) {
return;
}
OldName = NC->name();
- EC.setConnection( NC );
+ EC.setNetworkSetup( NC );
}
EC.showMaximized();
// disable refresh timer
UpdateTimer->stop();
// we need to retry
while( 1 ) {
if( EC.exec() == QDialog::Accepted ) {
// toplevel item -> store
- NodeCollection * NC = EC.connection();
+ NetworkSetup * NC = EC.networkSetup();
if( NC->isModified() ) {
if( LBI ) {
if( NC->name() != OldName ) {
// find if new name is free
- NodeCollection * LCN = NSResources->findConnection(
+ NetworkSetup * LCN = NSResources->findNetworkSetup(
NC->name() );
if( LCN ) {
QMessageBox::warning(
0,
tr( "In System Config" ),
tr( "Name %1 already exists" ).arg(NC->name())
);
continue; // restart exec
} // else new name
// new name -> remove item
- NSResources->removeConnection( OldName );
- NSResources->addConnection( NC, 0 );
+ NSResources->removeNetworkSetup( OldName );
+ NSResources->addNetworkSetup( NC, 0 );
} // else not changed
// must add it here since change will trigger event
Profiles_LB->changeItem( NC->devicePixmap(),
NC->name(),
Profiles_LB->index( LBI )
);
} else {
// new item
int ci = Profiles_LB->count();
- NSResources->addConnection( NC, 0 );
- NC->setNumber( NSResources->assignConnectionNumber() );
+ NSResources->addNetworkSetup( NC, 0 );
+ NC->setNumber( NSResources->assignNetworkSetupNumber() );
Profiles_LB->insertItem( NC->devicePixmap(), NC->name() );
Profiles_LB->setSelected( ci, TRUE );
}
updateProfileState( LBI );
}
} else {
- // cancelled : reset connection
+ // cancelled : reset NetworkSetup
if( LBI ) {
- NodeCollection * NC = NSResources->findConnection( LBI->text() );
+ NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
NC->reassign();
}
}
break;
}
// reenable
@@ -267,13 +267,13 @@ 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 {
Description_LBL->setText( NC->description() );
}
@@ -350,13 +350,13 @@ void NetworkSettings::SLOT_Disable( bool T ) {
QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
QString Msg;
if ( ! LBI )
return;
- NodeCollection * NC = NSResources->findConnection( LBI->text() );
+ NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
Log(( "Prepare to %sable\n", (T) ? "en" : "dis" ));
Msg = NC->setState( (T) ? Disable : Enable );
if( ! Msg.isEmpty() ) {
Msg.insert( 0, "<p>" );
Msg.append( "</p>" );
@@ -379,14 +379,14 @@ void NetworkSettings::SLOT_Up( void ) {
QString Msg;
int led = -1;
if ( ! LBI )
return;
- NodeCollection * NC =
- NSResources->findConnection( LBI->text() );
+ NetworkSetup * NC =
+ NSResources->findNetworkSetup( LBI->text() );
switch( NC->state() ) {
case Disabled : // cannot modify this state
case Unknown : // cannot modify this state
case Unchecked : // cannot modify this state
case Unavailable : // cannot modify this state
@@ -435,14 +435,14 @@ void NetworkSettings::SLOT_Down( void ) {
int led = -1;
QString Msg;
if ( ! LBI )
return;
- NodeCollection * NC =
- NSResources->findConnection( LBI->text() );
+ NetworkSetup * NC =
+ NSResources->findNetworkSetup( LBI->text() );
switch( NC->state() ) {
case Disabled : // cannot modify this state
case Unknown : // cannot modify this state
case Unchecked : // cannot modify this state
case Unavailable : // cannot modify this state