summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/networksettings.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/networksettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/networksettings.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp
index dca6631..9680a96 100644
--- a/noncore/settings/networksettings2/networksettings.cpp
+++ b/noncore/settings/networksettings2/networksettings.cpp
@@ -216,60 +216,60 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
216 // disable refresh timer 216 // disable refresh timer
217 UpdateTimer->stop(); 217 UpdateTimer->stop();
218 218
219 // we need to retry 219 // we need to retry
220 while( 1 ) { 220 while( 1 ) {
221 if( EC.exec() == QDialog::Accepted ) { 221 if( EC.exec() == QDialog::Accepted ) {
222 // toplevel item -> store 222 // toplevel item -> store
223 NodeCollection * NC = EC.connection(); 223 NodeCollection * NC = EC.connection();
224 if( NC->isModified() ) { 224 if( NC->isModified() ) {
225 if( LBI ) { 225 if( LBI ) {
226 if( NC->name() != OldName ) { 226 if( NC->name() != OldName ) {
227 // find if new name is free 227 // find if new name is free
228 NodeCollection * LCN = NSResources->findConnection( 228 NodeCollection * LCN = NSResources->findConnection(
229 NC->name() ); 229 NC->name() );
230 if( LCN ) { 230 if( LCN ) {
231 QMessageBox::warning( 231 QMessageBox::warning(
232 0, 232 0,
233 tr( "In System Config" ), 233 tr( "In System Config" ),
234 tr( "Name %1 already exists" ).arg(NC->name()) 234 tr( "Name %1 already exists" ).arg(NC->name())
235 ); 235 );
236 continue; // restart exec 236 continue; // restart exec
237 } // else new name 237 } // else new name
238 // new name -> remove item 238 // new name -> remove item
239 NSResources->removeConnection( OldName ); 239 NSResources->removeConnection( OldName );
240 NSResources->addConnection( NC ); 240 NSResources->addConnection( NC, 0 );
241 } // else not changed 241 } // else not changed
242 242
243 // must add it here since change will trigger event 243 // must add it here since change will trigger event
244 Profiles_LB->changeItem( NC->devicePixmap(), 244 Profiles_LB->changeItem( NC->devicePixmap(),
245 NC->name(), 245 NC->name(),
246 Profiles_LB->index( LBI ) 246 Profiles_LB->index( LBI )
247 ); 247 );
248 } else { 248 } else {
249 // new item 249 // new item
250 int ci = Profiles_LB->count(); 250 int ci = Profiles_LB->count();
251 NSResources->addConnection( NC ); 251 NSResources->addConnection( NC, 0 );
252 NC->setNumber( NSResources->assignConnectionNumber() ); 252 NC->setNumber( NSResources->assignConnectionNumber() );
253 Profiles_LB->insertItem( NC->devicePixmap(), NC->name() ); 253 Profiles_LB->insertItem( NC->devicePixmap(), NC->name() );
254 Profiles_LB->setSelected( ci, TRUE ); 254 Profiles_LB->setSelected( ci, TRUE );
255 } 255 }
256 updateProfileState( LBI ); 256 updateProfileState( LBI );
257 } 257 }
258 } else { 258 } else {
259 // cancelled : reset connection 259 // cancelled : reset connection
260 if( LBI ) { 260 if( LBI ) {
261 NodeCollection * NC = NSResources->findConnection( LBI->text() ); 261 NodeCollection * NC = NSResources->findConnection( LBI->text() );
262 NC->reassign(); 262 NC->reassign();
263 } 263 }
264 } 264 }
265 break; 265 break;
266 } 266 }
267 // reenable 267 // reenable
268 UpdateTimer->start( 5000 ); 268 UpdateTimer->start( 5000 );
269} 269}
270 270
271void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) { 271void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) {
272 if( LBI == 0 ) 272 if( LBI == 0 )
273 return; 273 return;
274 274
275 NodeCollection * NC = NSResources->findConnection( LBI->text() ); 275 NodeCollection * NC = NSResources->findConnection( LBI->text() );