Diffstat (limited to 'noncore/settings/networksettings2/editconnection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/editconnection.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/settings/networksettings2/editconnection.cpp b/noncore/settings/networksettings2/editconnection.cpp index 4bbe502..77826d1 100644 --- a/noncore/settings/networksettings2/editconnection.cpp +++ b/noncore/settings/networksettings2/editconnection.cpp | |||
@@ -124,25 +124,25 @@ NodeCollection * EditConnection::getTmpCollection( void ) { | |||
124 | 124 | ||
125 | while ( it ) { | 125 | while ( it ) { |
126 | NN = (*Mapping)[it]; | 126 | NN = (*Mapping)[it]; |
127 | if( NN == 0 ) { | 127 | if( NN == 0 ) { |
128 | // child is controller -> has sub radio | 128 | // child is controller -> has sub radio |
129 | // check if one radio is selected | 129 | // check if one radio is selected |
130 | it = it->firstChild(); | 130 | it = it->firstChild(); |
131 | while( it ) { | 131 | while( it ) { |
132 | if( ((QCheckListItem *)it)->isOn() ) { | 132 | if( ((QCheckListItem *)it)->isOn() ) { |
133 | // this radio is selected -> go deeper | 133 | // this radio is selected -> go deeper |
134 | if( SelectedNodes == 0 || | 134 | if( SelectedNodes == 0 || |
135 | NNI == 0 || | 135 | NNI == 0 || |
136 | NNI->nodeClass()->nodeName() != it->text(0) ) { | 136 | it->text(0) != NNI->nodeClass()->name() ) { |
137 | // new item not in previous collection | 137 | // new item not in previous collection |
138 | ANetNodeInstance * NNI = (*Mapping)[it]->createInstance(); | 138 | ANetNodeInstance * NNI = (*Mapping)[it]->createInstance(); |
139 | NNI->initialize(); | 139 | NNI->initialize(); |
140 | // this node type not in collection | 140 | // this node type not in collection |
141 | TmpCollection.append( NNI ); | 141 | TmpCollection.append( NNI ); |
142 | // master collection changed because new item in it | 142 | // master collection changed because new item in it |
143 | TmpCollection.setModified( 1 ); | 143 | TmpCollection.setModified( 1 ); |
144 | // no more valid items in old list | 144 | // no more valid items in old list |
145 | NNI = 0; | 145 | NNI = 0; |
146 | } else { | 146 | } else { |
147 | // already in list -> copy pointer | 147 | // already in list -> copy pointer |
148 | TmpCollection.append( NNI ); | 148 | TmpCollection.append( NNI ); |
@@ -187,25 +187,25 @@ void EditConnection::setConnection( NodeCollection * NC ) { | |||
187 | TmpIsValid = 0; | 187 | TmpIsValid = 0; |
188 | 188 | ||
189 | while ( it ) { | 189 | while ( it ) { |
190 | // listitem corresponds to netnode | 190 | // listitem corresponds to netnode |
191 | NN = (*Mapping)[it]; | 191 | NN = (*Mapping)[it]; |
192 | if( NN == 0 ) { | 192 | if( NN == 0 ) { |
193 | // child is controller -> has sub radio | 193 | // child is controller -> has sub radio |
194 | QString Ctr = it->text(0); | 194 | QString Ctr = it->text(0); |
195 | // check if one radio is selected | 195 | // check if one radio is selected |
196 | it = it->firstChild(); | 196 | it = it->firstChild(); |
197 | Found = 0; | 197 | Found = 0; |
198 | while( it ) { | 198 | while( it ) { |
199 | if( NNI && NNI->nodeClass()->nodeName() == it->text(0) ) { | 199 | if( NNI && it->text(0) == NNI->nodeClass()->name() ) { |
200 | // this radio is part of the collection | 200 | // this radio is part of the collection |
201 | ((QCheckListItem *)it)->setOn( 1 ); | 201 | ((QCheckListItem *)it)->setOn( 1 ); |
202 | updateGUI( it, NNI->nodeClass() ); | 202 | updateGUI( it, NNI->nodeClass() ); |
203 | // check its children | 203 | // check its children |
204 | Found = 1; | 204 | Found = 1; |
205 | it = it->firstChild(); | 205 | it = it->firstChild(); |
206 | NNI = SelectedNodes->next(); | 206 | NNI = SelectedNodes->next(); |
207 | // do not bother to check other items | 207 | // do not bother to check other items |
208 | break; | 208 | break; |
209 | } | 209 | } |
210 | it = it->nextSibling(); | 210 | it = it->nextSibling(); |
211 | } | 211 | } |
@@ -273,25 +273,25 @@ void EditConnection::buildFullTree( void ) { | |||
273 | // TCP/IP Connection | 273 | // TCP/IP Connection |
274 | for( QDictIterator<NetNode_t> Iter(NSResources->netNodes()); | 274 | for( QDictIterator<NetNode_t> Iter(NSResources->netNodes()); |
275 | Iter.current(); | 275 | Iter.current(); |
276 | ++Iter ) { | 276 | ++Iter ) { |
277 | 277 | ||
278 | NN = Iter.current()->NetNode; | 278 | NN = Iter.current()->NetNode; |
279 | 279 | ||
280 | if( ! NN->isToplevel() ) { | 280 | if( ! NN->isToplevel() ) { |
281 | continue; | 281 | continue; |
282 | } | 282 | } |
283 | 283 | ||
284 | MyQCheckListItem * it = new MyQCheckListItem( TheTop, | 284 | MyQCheckListItem * it = new MyQCheckListItem( TheTop, |
285 | NN->nodeName(), | 285 | NN->name(), |
286 | QCheckListItem::RadioButton ); | 286 | QCheckListItem::RadioButton ); |
287 | it->setPixmap( 0, NSResources->getPixmap( "Devices/commprofile" ) ); | 287 | it->setPixmap( 0, NSResources->getPixmap( "Devices/commprofile" ) ); |
288 | // remember that this node maps to this listitem | 288 | // remember that this node maps to this listitem |
289 | Mapping->insert( it, NN ); | 289 | Mapping->insert( it, NN ); |
290 | buildSubTree( it, NN ); | 290 | buildSubTree( it, NN ); |
291 | } | 291 | } |
292 | } | 292 | } |
293 | 293 | ||
294 | // Build device tree -> help function | 294 | // Build device tree -> help function |
295 | void EditConnection::buildSubTree( QListViewItem * it, ANetNode *NN ) { | 295 | void EditConnection::buildSubTree( QListViewItem * it, ANetNode *NN ) { |
296 | ANetNode::NetNodeList & NNL = NN->alternatives(); | 296 | ANetNode::NetNodeList & NNL = NN->alternatives(); |
297 | 297 | ||
@@ -301,32 +301,32 @@ void EditConnection::buildSubTree( QListViewItem * it, ANetNode *NN ) { | |||
301 | it, | 301 | it, |
302 | NSResources->netNode2Name(NNL[0]->provides()), | 302 | NSResources->netNode2Name(NNL[0]->provides()), |
303 | QCheckListItem::Controller ); | 303 | QCheckListItem::Controller ); |
304 | it->setSelectable( FALSE ); | 304 | it->setSelectable( FALSE ); |
305 | } | 305 | } |
306 | 306 | ||
307 | for ( unsigned int i=0; i < NNL.size(); i++ ) { | 307 | for ( unsigned int i=0; i < NNL.size(); i++ ) { |
308 | QListViewItem * CI; | 308 | QListViewItem * CI; |
309 | if( NNL.size() > 1 ) { | 309 | if( NNL.size() > 1 ) { |
310 | // generate radio buttons | 310 | // generate radio buttons |
311 | CI = new MyQCheckListItem( | 311 | CI = new MyQCheckListItem( |
312 | (QCheckListItem *)it, | 312 | (QCheckListItem *)it, |
313 | NNL[i]->nodeName(), QCheckListItem::RadioButton ); | 313 | NNL[i]->name(), QCheckListItem::RadioButton ); |
314 | // remember that this node maps to this listitem | 314 | // remember that this node maps to this listitem |
315 | CI->setPixmap( 0, NSResources->getPixmap( NNL[i]->pixmapName() ) ); | 315 | CI->setPixmap( 0, NSResources->getPixmap( NNL[i]->pixmapName() ) ); |
316 | Mapping->insert( CI, NNL[i] ); | 316 | Mapping->insert( CI, NNL[i] ); |
317 | CI->setSelectable( FALSE ); | 317 | CI->setSelectable( FALSE ); |
318 | } else { | 318 | } else { |
319 | // Single item | 319 | // Single item |
320 | CI = new MyQListViewItem( it, NNL[i]->nodeName() ); | 320 | CI = new MyQListViewItem( it, NNL[i]->name() ); |
321 | // remember that this node maps to this listitem | 321 | // remember that this node maps to this listitem |
322 | Mapping->insert( CI, NNL[i] ); | 322 | Mapping->insert( CI, NNL[i] ); |
323 | CI->setSelectable( FALSE ); | 323 | CI->setSelectable( FALSE ); |
324 | CI->setPixmap( 0, NSResources->getPixmap( NNL[i]->pixmapName() ) ); | 324 | CI->setPixmap( 0, NSResources->getPixmap( NNL[i]->pixmapName() ) ); |
325 | } | 325 | } |
326 | buildSubTree( CI, NNL[i] ); | 326 | buildSubTree( CI, NNL[i] ); |
327 | } | 327 | } |
328 | } | 328 | } |
329 | 329 | ||
330 | // Clicked ok OK button | 330 | // Clicked ok OK button |
331 | void EditConnection::accept( void ) { | 331 | void EditConnection::accept( void ) { |
332 | if( ! haveCompleteConfig( 0 ) || Name_LE->text().isEmpty() ) { | 332 | if( ! haveCompleteConfig( 0 ) || Name_LE->text().isEmpty() ) { |
@@ -435,25 +435,25 @@ void EditConnection::SLOT_AlterTab( const QString & S ) { | |||
435 | 435 | ||
436 | // update CB | 436 | // update CB |
437 | // and populate WidgetStack | 437 | // and populate WidgetStack |
438 | { ANetNodeInstance * NNI; | 438 | { ANetNodeInstance * NNI; |
439 | QListIterator<ANetNodeInstance> it(TmpCollection); | 439 | QListIterator<ANetNodeInstance> it(TmpCollection); |
440 | int i = 0; | 440 | int i = 0; |
441 | QWidget * W; | 441 | QWidget * W; |
442 | 442 | ||
443 | for ( ; it.current(); ++it ) { | 443 | for ( ; it.current(); ++it ) { |
444 | NNI = it.current(); | 444 | NNI = it.current(); |
445 | Devices_CB->insertItem( | 445 | Devices_CB->insertItem( |
446 | NSResources->getPixmap( NNI->nodeClass()->pixmapName() ), | 446 | NSResources->getPixmap( NNI->nodeClass()->pixmapName() ), |
447 | NNI->nodeClass()->nodeName() | 447 | NNI->nodeClass()->name() |
448 | ); | 448 | ); |
449 | 449 | ||
450 | // add edit widget | 450 | // add edit widget |
451 | W = NNI->edit( Setup_WS ); | 451 | W = NNI->edit( Setup_WS ); |
452 | if( ! W) { | 452 | if( ! W) { |
453 | W = new QLabel( Setup_WS, | 453 | W = new QLabel( Setup_WS, |
454 | tr("No configuration required")); | 454 | tr("No configuration required")); |
455 | } | 455 | } |
456 | Setup_WS->addWidget( W , i ); | 456 | Setup_WS->addWidget( W , i ); |
457 | i ++; | 457 | i ++; |
458 | } | 458 | } |
459 | } | 459 | } |