comparison framework/MainWindowBase.cpp @ 175:366f044c20e4 sv-v1.6

* Back out change from r1565, which may have been appropriate for "Sonic Segmenter" but isn't approprate for SV -- fixes #2812040 The r1565 version is going into the MainWindow subclass for Sonic Segmenter instead.
author Chris Cannam
date Mon, 29 Jun 2009 13:06:49 +0000
parents 5a2845883dd6
children 7dae51741cc9
comparison
equal deleted inserted replaced
174:e109e432b5c5 175:366f044c20e4
2634 if (!inAView) removeLayerEditDialog(layer); 2634 if (!inAView) removeLayerEditDialog(layer);
2635 2635
2636 // Check whether we need to add or remove model from play source 2636 // Check whether we need to add or remove model from play source
2637 Model *model = layer->getModel(); 2637 Model *model = layer->getModel();
2638 if (model) { 2638 if (model) {
2639 Model *source = model->getSourceModel();
2640 if (inAView) { 2639 if (inAView) {
2641 m_playSource->addModel(model); 2640 m_playSource->addModel(model);
2642 if (source && source != model) {
2643 m_playSource->addModel(source);
2644 }
2645 } else { 2641 } else {
2646 bool found = false; 2642 bool found = false;
2647 for (int i = 0; i < m_paneStack->getPaneCount(); ++i) { 2643 for (int i = 0; i < m_paneStack->getPaneCount(); ++i) {
2648 Pane *pane = m_paneStack->getPane(i); 2644 Pane *pane = m_paneStack->getPane(i);
2649 if (!pane) continue; 2645 if (!pane) continue;
2650 for (int j = 0; j < pane->getLayerCount(); ++j) { 2646 for (int j = 0; j < pane->getLayerCount(); ++j) {
2651 Layer *pl = pane->getLayer(j); 2647 Layer *pl = pane->getLayer(j);
2652 if (pl && (pl->getModel() == model || 2648 if (pl && (pl->getModel() == model)) {
2653 pl->getModel() == source)) {
2654 found = true; 2649 found = true;
2655 break; 2650 break;
2656 } 2651 }
2657 } 2652 }
2658 if (found) break; 2653 if (found) break;
2659 } 2654 }
2660 if (!found) { 2655 if (!found) {
2661 m_playSource->removeModel(model); 2656 m_playSource->removeModel(model);
2662 if (source && source != model) {
2663 m_playSource->removeModel(source);
2664 }
2665 } 2657 }
2666 } 2658 }
2667 } 2659 }
2668 2660
2669 updateMenuStates(); 2661 updateMenuStates();