summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/networksettings.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings2/networksettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/networksettings.cpp34
1 files changed, 23 insertions, 11 deletions
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp
index e1110e2..c3e6572 100644
--- a/noncore/settings/networksettings2/networksettings.cpp
+++ b/noncore/settings/networksettings2/networksettings.cpp
@@ -170,2 +170,4 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
UpdateTimer->stop();
+ // we need to retry
+ while( 1 ) {
if( EC.exec() == QDialog::Accepted ) {
@@ -176,6 +178,20 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
if( LBI ) {
+ if( NC->name() != OldName ) {
+ // find if new name is free
+ NodeCollection * LCN = NSResources->findConnection(
+ NC->name() );
+ if( LCN ) {
+ QMessageBox::warning(
+ 0,
+ tr( "Generating system configuration" ),
+ tr( "Name %1 already exists" ).arg(NC->name())
+ );
+ continue; // restart exec
+ } // else new name
// new name -> remove item
NSResources->removeConnection( OldName );
- // must add it here since change will trigger event
NSResources->addConnection( NC );
+ } // else not changed
+
+ // must add it here since change will trigger event
Profiles_LB->changeItem( NC->devicePixmap(),
@@ -201,2 +217,4 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
}
+ break;
+ }
// reenable
@@ -335,11 +353,6 @@ void NetworkSettings::SLOT_On( void ) {
break;
- case Available :
- // deactivate
+ case Available : // deactivate
+ case IsUp : // deactivate (will also bring down if needed)
rv = NC->setState( Deactivate );
break;
- case IsUp :
- // bring down and deactivate
- rv = ( NC->setState( Down ) &&
- NC->setState( Deactivate ) );
- break;
default :
@@ -368,3 +381,3 @@ void NetworkSettings::SLOT_Connect( void ) {
- bool rv;
+ bool rv = 1 ;
switch( NC->state() ) {
@@ -385,3 +398,3 @@ void NetworkSettings::SLOT_Connect( void ) {
// others no change
- return;
+ break;
}
@@ -393,3 +406,2 @@ void NetworkSettings::SLOT_Connect( void ) {
tr( "Cannot enable profile" ) );
- return;
}