Diffstat (limited to 'noncore/settings/networksettings2/editconnection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/editconnection.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/noncore/settings/networksettings2/editconnection.cpp b/noncore/settings/networksettings2/editconnection.cpp index bda9d7e..a9bef65 100644 --- a/noncore/settings/networksettings2/editconnection.cpp +++ b/noncore/settings/networksettings2/editconnection.cpp | |||
@@ -432,51 +432,55 @@ void EditNetworkSetup::SLOT_SelectNode( QListViewItem * it ) { | |||
432 | ANetNode * NN; | 432 | ANetNode * NN; |
433 | if( it == 0 || it->depth() == 0 ) { | 433 | if( it == 0 || it->depth() == 0 ) { |
434 | Description_LBL->setText( | 434 | Description_LBL->setText( |
435 | NSResources->netNode2Description( "fullsetup" ) ); | 435 | NSResources->netNode2Description( "fullsetup" ) ); |
436 | // topevel or no selection | 436 | // topevel or no selection |
437 | return; | 437 | return; |
438 | } | 438 | } |
439 | 439 | ||
440 | // store conversion from lvitem to node | 440 | // store conversion from lvitem to node |
441 | NN = (*Mapping)[ it ]; | 441 | NN = (*Mapping)[ it ]; |
442 | 442 | ||
443 | if( ! NN ) { | 443 | if( ! NN ) { |
444 | // intermediate node | 444 | // intermediate (controller) node |
445 | NN = (*Mapping)[ it->parent() ]; | 445 | NN = (*Mapping)[ it->parent() ]; |
446 | if( NN ) { | 446 | if( NN ) { |
447 | // figure out type of this node -> produce mesage | 447 | // figure out type of this node -> produce message |
448 | Description_LBL->setText( NSResources->netNode2Description( | 448 | Description_LBL->setText( NSResources->netNode2Description( |
449 | NN->needs()[0]) ); | 449 | NN->needs()[0]) ); |
450 | } else { | 450 | } else { |
451 | Description_LBL->setText( "" ); | 451 | Description_LBL->setText( "" ); |
452 | } | 452 | } |
453 | return; | 453 | return; |
454 | } | 454 | } |
455 | 455 | ||
456 | // clicked on regular node | ||
456 | Description_LBL->setText( NN->nodeDescription() ); | 457 | Description_LBL->setText( NN->nodeDescription() ); |
457 | 458 | ||
458 | if( ! it->isSelectable() ) { | 459 | if( ! it->isSelectable() ) { |
459 | return; | 460 | return; |
460 | } | 461 | } |
461 | 462 | ||
462 | ANetNode::NetNodeList & NNL = NN->alternatives(); | 463 | ANetNode::NetNodeList & NNL = NN->alternatives(); |
463 | 464 | ||
464 | if( NNL.size() != 1 ) { | 465 | if( NNL.size() == 0 ) { |
465 | if( NNL.size() == 0 || | 466 | // this item has no alternatives -> end node |
466 | ! ((MyQCheckListItem *)it)->isOn() | 467 | TmpIsValid = 0; |
467 | ) { | 468 | updateGUI( it, NN ); |
468 | // not clicked on Check or Radio item | 469 | return; |
469 | return; | 470 | } |
470 | } | 471 | |
472 | if( ! ((MyQCheckListItem *)it)->isOn() ) { | ||
473 | // not clicked on Check or Radio item | ||
474 | return; | ||
471 | } | 475 | } |
472 | 476 | ||
473 | // item has really changed -> update | 477 | // item has really changed -> update |
474 | TmpIsValid = 0; | 478 | TmpIsValid = 0; |
475 | updateGUI( it, NN ); | 479 | updateGUI( it, NN ); |
476 | } | 480 | } |
477 | 481 | ||
478 | // cliecked on TAB to go to setup | 482 | // cliecked on TAB to go to setup |
479 | void EditNetworkSetup::SLOT_AlterTab( const QString & S ) { | 483 | void EditNetworkSetup::SLOT_AlterTab( const QString & S ) { |
480 | if( S == tr( "Setup" ) && Setup_FRM->isEnabled() ) { | 484 | if( S == tr( "Setup" ) && Setup_FRM->isEnabled() ) { |
481 | // switched to setup -> update CB and populate ws with | 485 | // switched to setup -> update CB and populate ws with |
482 | // forms for devices | 486 | // forms for devices |
@@ -520,24 +524,25 @@ void EditNetworkSetup::SLOT_AlterTab( const QString & S ) { | |||
520 | } | 524 | } |
521 | } | 525 | } |
522 | Setup_WS->raiseWidget( 0 ); | 526 | Setup_WS->raiseWidget( 0 ); |
523 | } // still valid | 527 | } // still valid |
524 | } | 528 | } |
525 | } | 529 | } |
526 | 530 | ||
527 | // update visual feedback of selection state | 531 | // update visual feedback of selection state |
528 | void EditNetworkSetup::updateGUI( QListViewItem * it, ANetNode * NN ) { | 532 | void EditNetworkSetup::updateGUI( QListViewItem * it, ANetNode * NN ) { |
529 | 533 | ||
530 | bool HCC = haveCompleteConfig( it ); | 534 | bool HCC = haveCompleteConfig( it ); |
531 | Tab_TB->setTabEnabled( Setup_FRM, HCC ); | 535 | Tab_TB->setTabEnabled( Setup_FRM, HCC ); |
536 | Log(( "COMPLETE CONFIG %d\n", HCC )); | ||
532 | Setup_FRM->setEnabled( HCC ); | 537 | Setup_FRM->setEnabled( HCC ); |
533 | 538 | ||
534 | // disable children of all siblings at same level | 539 | // disable children of all siblings at same level |
535 | QListViewItem * Sbl = it->parent()->firstChild(); | 540 | QListViewItem * Sbl = it->parent()->firstChild(); |
536 | while( Sbl ) { | 541 | while( Sbl ) { |
537 | if ( Sbl != it ) { | 542 | if ( Sbl != it ) { |
538 | disableTree( Sbl->firstChild(), FALSE ); | 543 | disableTree( Sbl->firstChild(), FALSE ); |
539 | Sbl->setSelectable( TRUE ); | 544 | Sbl->setSelectable( TRUE ); |
540 | if( AutoCollapse ) | 545 | if( AutoCollapse ) |
541 | Sbl->setOpen( FALSE ); | 546 | Sbl->setOpen( FALSE ); |
542 | } | 547 | } |
543 | Sbl = Sbl->nextSibling(); | 548 | Sbl = Sbl->nextSibling(); |
@@ -617,24 +622,25 @@ bool EditNetworkSetup::haveCompleteConfig( QListViewItem * it ) { | |||
617 | Found = 0; | 622 | Found = 0; |
618 | while( it ) { | 623 | while( it ) { |
619 | if( ((QCheckListItem *)it)->isOn() ) { | 624 | if( ((QCheckListItem *)it)->isOn() ) { |
620 | Found = 1; | 625 | Found = 1; |
621 | // go deeper | 626 | // go deeper |
622 | it = it->firstChild(); | 627 | it = it->firstChild(); |
623 | break; | 628 | break; |
624 | } | 629 | } |
625 | it = it->nextSibling(); | 630 | it = it->nextSibling(); |
626 | } | 631 | } |
627 | 632 | ||
628 | if( ! Found ) { | 633 | if( ! Found ) { |
634 | Log(( "Setup not complete\n" )); | ||
629 | return 0; // no not complete -> a radio should have been chkd | 635 | return 0; // no not complete -> a radio should have been chkd |
630 | } | 636 | } |
631 | 637 | ||
632 | // it now contains selected radio | 638 | // it now contains selected radio |
633 | NN = (*Mapping)[it]; | 639 | NN = (*Mapping)[it]; |
634 | } else { | 640 | } else { |
635 | // automatic selection | 641 | // automatic selection |
636 | it = it->firstChild(); | 642 | it = it->firstChild(); |
637 | } | 643 | } |
638 | } | 644 | } |
639 | return 1; | 645 | return 1; |
640 | } | 646 | } |