| 441 | } |
| 442 | |
| 443 | void |
| 444 | ViewerTab::removeTrackerInterface(const NodeGuiPtr& n, |
| 445 | bool permanently, |
| 446 | bool removeAndDontSetAnother) |
| 447 | { |
| 448 | std::map<NodeGuiWPtr, TrackerGui*>::iterator it = _imp->trackerNodes.find(n); |
| 449 | |
| 450 | if ( it != _imp->trackerNodes.end() ) { |
| 451 | if ( !getGui() ) { |
| 452 | if (permanently) { |
| 453 | delete it->second; |
| 454 | } |
| 455 | |
| 456 | return; |
| 457 | } |
| 458 | |
| 459 | if (_imp->currentTracker.first.lock() == n) { |
| 460 | ///Remove the widgets of the current tracker node |
| 461 | |
| 462 | int buttonsBarIndex = _imp->mainLayout->indexOf( _imp->currentTracker.second->getButtonsBar() ); |
| 463 | assert(buttonsBarIndex >= 0); |
| 464 | if (buttonsBarIndex >= 0) { |
| 465 | QLayoutItem* buttonsBar = _imp->mainLayout->itemAt(buttonsBarIndex); |
| 466 | assert(buttonsBar); |
| 467 | if (buttonsBar) { |
| 468 | _imp->mainLayout->removeItem(buttonsBar); |
| 469 | buttonsBar->widget()->hide(); |
| 470 | } |
| 471 | } |
| 472 | if (!removeAndDontSetAnother) { |
| 473 | ///If theres another tracker node, set it as the current tracker interface |
| 474 | std::map<NodeGuiWPtr, TrackerGui*>::iterator newTracker = _imp->trackerNodes.end(); |
| 475 | for (std::map<NodeGuiWPtr, TrackerGui*>::iterator it2 = _imp->trackerNodes.begin(); it2 != _imp->trackerNodes.end(); ++it2) { |
| 476 | if ( (it2->second != it->second) && it2->first.lock()->isSettingsPanelVisible() ) { |
| 477 | newTracker = it2; |
| 478 | break; |
| 479 | } |
| 480 | } |
| 481 | |
| 482 | _imp->currentTracker.first.reset(); |
| 483 | _imp->currentTracker.second = 0; |
| 484 | |
| 485 | if ( newTracker != _imp->trackerNodes.end() ) { |
| 486 | setTrackerInterface( newTracker->first.lock() ); |
| 487 | } |
| 488 | } |
| 489 | } |
| 490 | |
| 491 | if (permanently) { |
| 492 | delete it->second; |
| 493 | _imp->trackerNodes.erase(it); |
| 494 | } |
| 495 | } |
| 496 | } // ViewerTab::removeTrackerInterface |
| 497 | |
| 498 | #endif // if 0 |
| 499 |
nothing calls this directly
no test coverage detected