author | wimpie <wimpie> | 2004-04-04 11:42:05 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-04-04 11:42:05 (UTC) |
commit | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (patch) (unidiff) | |
tree | 3e3764f82d52f8c32b0ed9d92c13ec483dc34114 /noncore/settings/networksettings2/networksettings.cpp | |
parent | 321f82bb3d43cbab358434fef52fe76f17e7d1e3 (diff) | |
download | opie-8d2d2664e5f544b8292806e617deb7a0e4170dc0.zip opie-8d2d2664e5f544b8292806e617deb7a0e4170dc0.tar.gz opie-8d2d2664e5f544b8292806e617deb7a0e4170dc0.tar.bz2 |
Error in generation of files
Diffstat (limited to 'noncore/settings/networksettings2/networksettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings.cpp | 86 |
1 files changed, 49 insertions, 37 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,32 +170,50 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { | |||
170 | UpdateTimer->stop(); | 170 | UpdateTimer->stop(); |
171 | if( EC.exec() == QDialog::Accepted ) { | 171 | // we need to retry |
172 | // toplevel item -> store | 172 | while( 1 ) { |
173 | NodeCollection * NC = EC.connection(); | 173 | if( EC.exec() == QDialog::Accepted ) { |
174 | if( NC->isModified() ) { | 174 | // toplevel item -> store |
175 | setModified( 1 ); | 175 | NodeCollection * NC = EC.connection(); |
176 | if( NC->isModified() ) { | ||
177 | setModified( 1 ); | ||
178 | if( LBI ) { | ||
179 | if( NC->name() != OldName ) { | ||
180 | // find if new name is free | ||
181 | NodeCollection * LCN = NSResources->findConnection( | ||
182 | NC->name() ); | ||
183 | if( LCN ) { | ||
184 | QMessageBox::warning( | ||
185 | 0, | ||
186 | tr( "Generating system configuration" ), | ||
187 | tr( "Name %1 already exists" ).arg(NC->name()) | ||
188 | ); | ||
189 | continue; // restart exec | ||
190 | } // else new name | ||
191 | // new name -> remove item | ||
192 | NSResources->removeConnection( OldName ); | ||
193 | NSResources->addConnection( NC ); | ||
194 | } // else not changed | ||
195 | |||
196 | // must add it here since change will trigger event | ||
197 | Profiles_LB->changeItem( NC->devicePixmap(), | ||
198 | NC->name(), | ||
199 | Profiles_LB->index( LBI ) | ||
200 | ); | ||
201 | } else { | ||
202 | // new item | ||
203 | int ci = Profiles_LB->count(); | ||
204 | NSResources->addConnection( NC ); | ||
205 | NC->setNumber( NC->maxConnectionNumber()+1 ); | ||
206 | Profiles_LB->insertItem( NC->devicePixmap(), NC->name() ); | ||
207 | Profiles_LB->setSelected( ci, TRUE ); | ||
208 | } | ||
209 | updateProfileState( LBI ); | ||
210 | } | ||
211 | } else { | ||
212 | // cancelled : reset connection | ||
176 | if( LBI ) { | 213 | if( LBI ) { |
177 | // new name -> remove item | 214 | NodeCollection * NC = NSResources->findConnection( LBI->text() ); |
178 | NSResources->removeConnection( OldName ); | 215 | NC->reassign(); |
179 | // must add it here since change will trigger event | ||
180 | NSResources->addConnection( NC ); | ||
181 | Profiles_LB->changeItem( NC->devicePixmap(), | ||
182 | NC->name(), | ||
183 | Profiles_LB->index( LBI ) | ||
184 | ); | ||
185 | } else { | ||
186 | // new item | ||
187 | int ci = Profiles_LB->count(); | ||
188 | NSResources->addConnection( NC ); | ||
189 | NC->setNumber( NC->maxConnectionNumber()+1 ); | ||
190 | Profiles_LB->insertItem( NC->devicePixmap(), NC->name() ); | ||
191 | Profiles_LB->setSelected( ci, TRUE ); | ||
192 | } | 216 | } |
193 | updateProfileState( LBI ); | ||
194 | } | ||
195 | } else { | ||
196 | // cancelled : reset connection | ||
197 | if( LBI ) { | ||
198 | NodeCollection * NC = NSResources->findConnection( LBI->text() ); | ||
199 | NC->reassign(); | ||
200 | } | 217 | } |
218 | break; | ||
201 | } | 219 | } |
@@ -335,11 +353,6 @@ void NetworkSettings::SLOT_On( void ) { | |||
335 | break; | 353 | break; |
336 | case Available : | 354 | case Available : // deactivate |
337 | // deactivate | 355 | case IsUp : // deactivate (will also bring down if needed) |
338 | rv = NC->setState( Deactivate ); | 356 | rv = NC->setState( Deactivate ); |
339 | break; | 357 | break; |
340 | case IsUp : | ||
341 | // bring down and deactivate | ||
342 | rv = ( NC->setState( Down ) && | ||
343 | NC->setState( Deactivate ) ); | ||
344 | break; | ||
345 | default : | 358 | default : |
@@ -368,3 +381,3 @@ void NetworkSettings::SLOT_Connect( void ) { | |||
368 | 381 | ||
369 | bool rv; | 382 | bool rv = 1 ; |
370 | switch( NC->state() ) { | 383 | switch( NC->state() ) { |
@@ -385,3 +398,3 @@ void NetworkSettings::SLOT_Connect( void ) { | |||
385 | // others no change | 398 | // others no change |
386 | return; | 399 | break; |
387 | } | 400 | } |
@@ -393,3 +406,2 @@ void NetworkSettings::SLOT_Connect( void ) { | |||
393 | tr( "Cannot enable profile" ) ); | 406 | tr( "Cannot enable profile" ) ); |
394 | return; | ||
395 | } | 407 | } |