comparison view/PaneStack.cpp @ 1374:631897ba9fca zoom

Merge from default branch
author Chris Cannam
date Tue, 06 Nov 2018 08:59:03 +0000
parents d79e21855aef
children c8a6fd3f9dff
comparison
equal deleted inserted replaced
1360:e848ea0850fe 1374:631897ba9fca
284 } 284 }
285 285
286 void 286 void
287 PaneStack::deletePane(Pane *pane) 287 PaneStack::deletePane(Pane *pane)
288 { 288 {
289 cerr << "PaneStack::deletePane(" << pane << ")" << endl; 289 #ifdef DEBUG_PANE_STACK
290 SVCERR << "PaneStack::deletePane(" << pane << ")" << endl;
291 #endif
290 292
291 std::vector<PaneRec>::iterator i; 293 std::vector<PaneRec>::iterator i;
292 bool found = false; 294 bool found = false;
293 295
294 QWidget *stack = 0; 296 QWidget *stack = 0;
320 } 322 }
321 323
322 emit paneAboutToBeDeleted(pane); 324 emit paneAboutToBeDeleted(pane);
323 unlinkAlignmentViews(); 325 unlinkAlignmentViews();
324 326
325 cerr << "PaneStack::deletePane: about to delete parent " << pane->parent() << " of pane " << pane << endl; 327 #ifdef DEBUG_PANE_STACK
328 SVCERR << "PaneStack::deletePane: about to delete parent " << pane->parent() << " of pane " << pane << endl;
329 #endif
326 330
327 // The property stack associated with the parent was initially 331 // The property stack associated with the parent was initially
328 // created with the same parent as it, so it would be deleted when 332 // created with the same parent as it, so it would be deleted when
329 // we delete the pane's parent in a moment -- but it may have been 333 // we delete the pane's parent in a moment -- but it may have been
330 // reparented depending on the layout. We'd better delete it 334 // reparented depending on the layout. We'd better delete it
351 } 355 }
352 356
353 void 357 void
354 PaneStack::showOrHidePaneAccessories() 358 PaneStack::showOrHidePaneAccessories()
355 { 359 {
356 cerr << "PaneStack::showOrHidePaneAccessories: count == " << getPaneCount() << endl; 360 #ifdef DEBUG_PANE_STACK
361 SVCERR << "PaneStack::showOrHidePaneAccessories: count == " << getPaneCount() << endl;
362 #endif
357 363
358 bool multi = (getPaneCount() > 1); 364 bool multi = (getPaneCount() > 1);
359 for (std::vector<PaneRec>::iterator i = m_panes.begin(); 365 for (std::vector<PaneRec>::iterator i = m_panes.begin();
360 i != m_panes.end(); ++i) { 366 i != m_panes.end(); ++i) {
361 i->xButton->setVisible(multi && m_showAccessories); 367 i->xButton->setVisible(multi && m_showAccessories);
405 ++i; 411 ++i;
406 } 412 }
407 413
408 relinkAlignmentViews(); 414 relinkAlignmentViews();
409 415
410 cerr << "WARNING: PaneStack::hidePane(" << pane << "): Pane not found in visible panes" << endl; 416 SVCERR << "WARNING: PaneStack::hidePane(" << pane << "): Pane not found in visible panes" << endl;
411 } 417 }
412 418
413 void 419 void
414 PaneStack::showPane(Pane *pane) 420 PaneStack::showPane(Pane *pane)
415 { 421 {
431 ++i; 437 ++i;
432 } 438 }
433 439
434 relinkAlignmentViews(); 440 relinkAlignmentViews();
435 441
436 cerr << "WARNING: PaneStack::showPane(" << pane << "): Pane not found in hidden panes" << endl; 442 SVCERR << "WARNING: PaneStack::showPane(" << pane << "): Pane not found in hidden panes" << endl;
437 } 443 }
438 444
439 void 445 void
440 PaneStack::setCurrentPane(Pane *pane) // may be null 446 PaneStack::setCurrentPane(Pane *pane) // may be null
441 { 447 {
470 476
471 if (found || pane == 0) { 477 if (found || pane == 0) {
472 m_currentPane = pane; 478 m_currentPane = pane;
473 emit currentPaneChanged(m_currentPane); 479 emit currentPaneChanged(m_currentPane);
474 } else { 480 } else {
475 cerr << "WARNING: PaneStack::setCurrentPane(" << pane << "): pane is not a visible pane in this stack" << endl; 481 SVCERR << "WARNING: PaneStack::setCurrentPane(" << pane << "): pane is not a visible pane in this stack" << endl;
476 } 482 }
477 } 483 }
478 484
479 void 485 void
480 PaneStack::setCurrentLayer(Pane *pane, Layer *layer) // may be null 486 PaneStack::setCurrentLayer(Pane *pane, Layer *layer) // may be null