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.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
@@ -64,10 +64,10 @@ NetworkSettings::NetworkSettings( QWidget *parent,
64 SIGNAL(rightButtonPressed(QListBoxItem*,const QPoint&)), 64 SIGNAL(rightButtonPressed(QListBoxItem*,const QPoint&)),
65 this, SLOT(SLOT_EditNode(QListBoxItem*)) ); 65 this, SLOT(SLOT_EditNode(QListBoxItem*)) );
66 66
67 { Name2Connection_t & M = NSResources->connections(); 67 { Name2NetworkSetup_t & M = NSResources->networkSetups();
68 NodeCollection * NC; 68 NetworkSetup * NC;
69 // for all connections 69 // for all NetworkSetups
70 for( QDictIterator<NodeCollection> it(M); 70 for( QDictIterator<NetworkSetup> it(M);
71 it.current(); 71 it.current();
72 ++it ) { 72 ++it ) {
73 NC = it.current(); 73 NC = it.current();
@@ -81,7 +81,7 @@ NetworkSettings::NetworkSettings( QWidget *parent,
81 } 81 }
82 82
83 // if no profiles -> auto popup editing 83 // if no profiles -> auto popup editing
84 if( NSResources->connections().count() == 0 ) { 84 if( NSResources->networkSetups().count() == 0 ) {
85 QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) ); 85 QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) );
86 } 86 }
87 87
@@ -136,10 +136,10 @@ void NetworkSettings::SLOT_RefreshStates( void ) {
136 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); // remember 136 QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() ); // remember
137 137
138 if( LBI ) { 138 if( LBI ) {
139 NodeCollection * NC; 139 NetworkSetup * NC;
140 NSResources->system().probeInterfaces(); 140 NSResources->system().probeInterfaces();
141 // update current selection only 141 // update current selection only
142 NC = NSResources->findConnection( LBI->text() ); 142 NC = NSResources->findNetworkSetup( LBI->text() );
143 if( NC ) { 143 if( NC ) {
144 State_t OldS = NC->state(); 144 State_t OldS = NC->state();
145 State_t NewS = NC->state(1); 145 State_t NewS = NC->state(1);
@@ -152,10 +152,10 @@ void NetworkSettings::SLOT_RefreshStates( void ) {
152 152
153 /* -> LATER !! 153 /* -> LATER !!
154 bool is; 154 bool is;
155 NodeCollection * NC; 155 NetworkSetup * NC;
156 156
157 for( unsigned int i = 0; i < Profiles_LB->count() ; i ++ ) { 157 for( unsigned int i = 0; i < Profiles_LB->count() ; i ++ ) {
158 NC = NSResources->findConnection( Profiles_LB->text(i) ); 158 NC = NSResources->findNetworkSetup( Profiles_LB->text(i) );
159 if( NC ) { 159 if( NC ) {
160 State_t OldS = NC->state(); 160 State_t OldS = NC->state();
161 State_t NewS = NC->state(1); 161 State_t NewS = NC->state(1);
@@ -190,7 +190,7 @@ void NetworkSettings::SLOT_DeleteNode( void ) {
190 tr( "Removing profile" ), 190 tr( "Removing profile" ),
191 tr( "Remove selected profile ?" ), 191 tr( "Remove selected profile ?" ),
192 1, 0 ) == 1 ) { 192 1, 0 ) == 1 ) {
193 NSResources->removeConnection( LBI->text() ); 193 NSResources->removeNetworkSetup( LBI->text() );
194 delete LBI; 194 delete LBI;
195 NSD.setModified( 1 ); 195 NSD.setModified( 1 );
196 } 196 }
@@ -199,15 +199,15 @@ void NetworkSettings::SLOT_DeleteNode( void ) {
199void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { 199void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
200 QString OldName = ""; 200 QString OldName = "";
201 201
202 EditConnection EC( this ); 202 EditNetworkSetup EC( this );
203 203
204 if( LBI ) { 204 if( LBI ) {
205 NodeCollection * NC = NSResources->findConnection( LBI->text() ); 205 NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
206 if( ! NC ) { 206 if( ! NC ) {
207 return; 207 return;
208 } 208 }
209 OldName = NC->name(); 209 OldName = NC->name();
210 EC.setConnection( NC ); 210 EC.setNetworkSetup( NC );
211 } 211 }
212 212
213 EC.showMaximized(); 213 EC.showMaximized();
@@ -218,12 +218,12 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
218 while( 1 ) { 218 while( 1 ) {
219 if( EC.exec() == QDialog::Accepted ) { 219 if( EC.exec() == QDialog::Accepted ) {
220 // toplevel item -> store 220 // toplevel item -> store
221 NodeCollection * NC = EC.connection(); 221 NetworkSetup * NC = EC.networkSetup();
222 if( NC->isModified() ) { 222 if( NC->isModified() ) {
223 if( LBI ) { 223 if( LBI ) {
224 if( NC->name() != OldName ) { 224 if( NC->name() != OldName ) {
225 // find if new name is free 225 // find if new name is free
226 NodeCollection * LCN = NSResources->findConnection( 226 NetworkSetup * LCN = NSResources->findNetworkSetup(
227 NC->name() ); 227 NC->name() );
228 if( LCN ) { 228 if( LCN ) {
229 QMessageBox::warning( 229 QMessageBox::warning(
@@ -234,8 +234,8 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
234 continue; // restart exec 234 continue; // restart exec
235 } // else new name 235 } // else new name
236 // new name -> remove item 236 // new name -> remove item
237 NSResources->removeConnection( OldName ); 237 NSResources->removeNetworkSetup( OldName );
238 NSResources->addConnection( NC, 0 ); 238 NSResources->addNetworkSetup( NC, 0 );
239 } // else not changed 239 } // else not changed
240 240
241 // must add it here since change will trigger event 241 // must add it here since change will trigger event
@@ -246,17 +246,17 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
246 } else { 246 } else {
247 // new item 247 // new item
248 int ci = Profiles_LB->count(); 248 int ci = Profiles_LB->count();
249 NSResources->addConnection( NC, 0 ); 249 NSResources->addNetworkSetup( NC, 0 );
250 NC->setNumber( NSResources->assignConnectionNumber() ); 250 NC->setNumber( NSResources->assignNetworkSetupNumber() );
251 Profiles_LB->insertItem( NC->devicePixmap(), NC->name() ); 251 Profiles_LB->insertItem( NC->devicePixmap(), NC->name() );
252 Profiles_LB->setSelected( ci, TRUE ); 252 Profiles_LB->setSelected( ci, TRUE );
253 } 253 }
254 updateProfileState( LBI ); 254 updateProfileState( LBI );
255 } 255 }
256 } else { 256 } else {
257 // cancelled : reset connection 257 // cancelled : reset NetworkSetup
258 if( LBI ) { 258 if( LBI ) {
259 NodeCollection * NC = NSResources->findConnection( LBI->text() ); 259 NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
260 NC->reassign(); 260 NC->reassign();
261 } 261 }
262 } 262 }
@@ -270,7 +270,7 @@ void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) {
270 if( LBI == 0 ) 270 if( LBI == 0 )
271 return; 271 return;
272 272
273 NodeCollection * NC = NSResources->findConnection( LBI->text() ); 273 NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
274 274
275 if( NC->description().isEmpty() ) { 275 if( NC->description().isEmpty() ) {
276 Description_LBL->setText( tr( "<<No description>>" ) ); 276 Description_LBL->setText( tr( "<<No description>>" ) );
@@ -353,7 +353,7 @@ void NetworkSettings::SLOT_Disable( bool T ) {
353 if ( ! LBI ) 353 if ( ! LBI )
354 return; 354 return;
355 355
356 NodeCollection * NC = NSResources->findConnection( LBI->text() ); 356 NetworkSetup * NC = NSResources->findNetworkSetup( LBI->text() );
357 357
358 Log(( "Prepare to %sable\n", (T) ? "en" : "dis" )); 358 Log(( "Prepare to %sable\n", (T) ? "en" : "dis" ));
359 Msg = NC->setState( (T) ? Disable : Enable ); 359 Msg = NC->setState( (T) ? Disable : Enable );
@@ -382,8 +382,8 @@ void NetworkSettings::SLOT_Up( void ) {
382 if ( ! LBI ) 382 if ( ! LBI )
383 return; 383 return;
384 384
385 NodeCollection * NC = 385 NetworkSetup * NC =
386 NSResources->findConnection( LBI->text() ); 386 NSResources->findNetworkSetup( LBI->text() );
387 387
388 switch( NC->state() ) { 388 switch( NC->state() ) {
389 case Disabled : // cannot modify this state 389 case Disabled : // cannot modify this state
@@ -438,8 +438,8 @@ void NetworkSettings::SLOT_Down( void ) {
438 if ( ! LBI ) 438 if ( ! LBI )
439 return; 439 return;
440 440
441 NodeCollection * NC = 441 NetworkSetup * NC =
442 NSResources->findConnection( LBI->text() ); 442 NSResources->findNetworkSetup( LBI->text() );
443 443
444 switch( NC->state() ) { 444 switch( NC->state() ) {
445 case Disabled : // cannot modify this state 445 case Disabled : // cannot modify this state