author | wimpie <wimpie> | 2005-01-12 02:21:58 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-12 02:21:58 (UTC) |
commit | 551fd59bc878f0f95aac939a5a9fdedd14707d17 (patch) (unidiff) | |
tree | af49b228e04da59895ad77ae691ce9f900ef3d83 /noncore/settings/networksettings2/editconnection.cpp | |
parent | c48160f6ac67b2f2fc4b6f982b641861ad078237 (diff) | |
download | opie-551fd59bc878f0f95aac939a5a9fdedd14707d17.zip opie-551fd59bc878f0f95aac939a5a9fdedd14707d17.tar.gz opie-551fd59bc878f0f95aac939a5a9fdedd14707d17.tar.bz2 |
Fixed problem with selection of lowest node level
Diffstat (limited to 'noncore/settings/networksettings2/editconnection.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/editconnection.cpp | 20 |
1 files changed, 13 insertions, 7 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 | |||
@@ -440,35 +440,39 @@ void EditNetworkSetup::SLOT_SelectNode( QListViewItem * it ) { | |||
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; |
@@ -528,8 +532,9 @@ void EditNetworkSetup::SLOT_AlterTab( const QString & S ) { | |||
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(); |
@@ -625,8 +630,9 @@ bool EditNetworkSetup::haveCompleteConfig( QListViewItem * it ) { | |||
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 |