Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 438:868f73825b37
Seems to be a bad idea to use plain DEBUG symbol on OS/X (system wants it)
author | Chris Cannam |
---|---|
date | Tue, 14 Jun 2011 15:27:30 +0100 |
parents | 9de86c1b980e |
children | 6d5ee6860682 4bccf2014f80 |
comparison
equal
deleted
inserted
replaced
437:9de86c1b980e | 438:868f73825b37 |
---|---|
308 this, SLOT(newerVersionAvailable(QString))); | 308 this, SLOT(newerVersionAvailable(QString))); |
309 } | 309 } |
310 | 310 |
311 MainWindow::~MainWindow() | 311 MainWindow::~MainWindow() |
312 { | 312 { |
313 // DEBUG << "MainWindow::~MainWindow" << endl; | 313 // SVDEBUG << "MainWindow::~MainWindow" << endl; |
314 delete m_keyReference; | 314 delete m_keyReference; |
315 delete m_preferencesDialog; | 315 delete m_preferencesDialog; |
316 delete m_layerTreeDialog; | 316 delete m_layerTreeDialog; |
317 Profiles::getInstance()->dump(); | 317 Profiles::getInstance()->dump(); |
318 // DEBUG << "MainWindow::~MainWindow finishing" << endl; | 318 // SVDEBUG << "MainWindow::~MainWindow finishing" << endl; |
319 } | 319 } |
320 | 320 |
321 void | 321 void |
322 MainWindow::setupMenus() | 322 MainWindow::setupMenus() |
323 { | 323 { |
1646 void | 1646 void |
1647 MainWindow::setupExistingLayersMenus() | 1647 MainWindow::setupExistingLayersMenus() |
1648 { | 1648 { |
1649 if (!m_existingLayersMenu) return; // should have been created by setupMenus | 1649 if (!m_existingLayersMenu) return; // should have been created by setupMenus |
1650 | 1650 |
1651 // DEBUG << "MainWindow::setupExistingLayersMenu" << endl; | 1651 // SVDEBUG << "MainWindow::setupExistingLayersMenu" << endl; |
1652 | 1652 |
1653 m_existingLayersMenu->clear(); | 1653 m_existingLayersMenu->clear(); |
1654 m_existingLayerActions.clear(); | 1654 m_existingLayerActions.clear(); |
1655 | 1655 |
1656 m_sliceMenu->clear(); | 1656 m_sliceMenu->clear(); |
2815 } | 2815 } |
2816 | 2816 |
2817 void | 2817 void |
2818 MainWindow::closeEvent(QCloseEvent *e) | 2818 MainWindow::closeEvent(QCloseEvent *e) |
2819 { | 2819 { |
2820 // DEBUG << "MainWindow::closeEvent" << endl; | 2820 // SVDEBUG << "MainWindow::closeEvent" << endl; |
2821 | 2821 |
2822 if (m_openingAudioFile) { | 2822 if (m_openingAudioFile) { |
2823 // std::cerr << "Busy - ignoring close event" << std::endl; | 2823 // std::cerr << "Busy - ignoring close event" << std::endl; |
2824 e->ignore(); | 2824 e->ignore(); |
2825 return; | 2825 return; |
2826 } | 2826 } |
2827 | 2827 |
2828 if (!m_abandoning && !checkSaveModified()) { | 2828 if (!m_abandoning && !checkSaveModified()) { |
2829 // DEBUG << "Ignoring close event" << endl; | 2829 // SVDEBUG << "Ignoring close event" << endl; |
2830 e->ignore(); | 2830 e->ignore(); |
2831 return; | 2831 return; |
2832 } | 2832 } |
2833 | 2833 |
2834 QSettings settings; | 2834 QSettings settings; |
3032 } | 3032 } |
3033 | 3033 |
3034 void | 3034 void |
3035 MainWindow::propertyStacksResized(int width) | 3035 MainWindow::propertyStacksResized(int width) |
3036 { | 3036 { |
3037 // DEBUG << "MainWindow::propertyStacksResized(" << width << ")" << endl; | 3037 // SVDEBUG << "MainWindow::propertyStacksResized(" << width << ")" << endl; |
3038 | 3038 |
3039 if (!m_playControlsSpacer) return; | 3039 if (!m_playControlsSpacer) return; |
3040 | 3040 |
3041 int spacerWidth = width - m_playControlsWidth - 4; | 3041 int spacerWidth = width - m_playControlsWidth - 4; |
3042 | 3042 |
3043 // DEBUG << "resizing spacer from " << m_playControlsSpacer->width() << " to " << spacerWidth << endl; | 3043 // SVDEBUG << "resizing spacer from " << m_playControlsSpacer->width() << " to " << spacerWidth << endl; |
3044 | 3044 |
3045 m_playControlsSpacer->setFixedSize(QSize(spacerWidth, 2)); | 3045 m_playControlsSpacer->setFixedSize(QSize(spacerWidth, 2)); |
3046 } | 3046 } |
3047 | 3047 |
3048 void | 3048 void |
3091 // std::cerr << "no time ruler layer, creating one" << std::endl; | 3091 // std::cerr << "no time ruler layer, creating one" << std::endl; |
3092 m_timeRulerLayer = m_document->createMainModelLayer | 3092 m_timeRulerLayer = m_document->createMainModelLayer |
3093 (LayerFactory::TimeRuler); | 3093 (LayerFactory::TimeRuler); |
3094 } | 3094 } |
3095 | 3095 |
3096 // DEBUG << "adding time ruler layer " << m_timeRulerLayer << endl; | 3096 // SVDEBUG << "adding time ruler layer " << m_timeRulerLayer << endl; |
3097 | 3097 |
3098 m_document->addLayerToView(pane, m_timeRulerLayer); | 3098 m_document->addLayerToView(pane, m_timeRulerLayer); |
3099 } | 3099 } |
3100 | 3100 |
3101 Layer *newLayer = m_document->createLayer(configuration.layer); | 3101 Layer *newLayer = m_document->createLayer(configuration.layer); |
3131 m_document->addLayerToView(pane, newLayer); | 3131 m_document->addLayerToView(pane, newLayer); |
3132 | 3132 |
3133 m_paneStack->setCurrentPane(pane); | 3133 m_paneStack->setCurrentPane(pane); |
3134 m_paneStack->setCurrentLayer(pane, newLayer); | 3134 m_paneStack->setCurrentLayer(pane, newLayer); |
3135 | 3135 |
3136 // DEBUG << "MainWindow::addPane: global centre frame is " | 3136 // SVDEBUG << "MainWindow::addPane: global centre frame is " |
3137 // << m_viewManager->getGlobalCentreFrame() << endl; | 3137 // << m_viewManager->getGlobalCentreFrame() << endl; |
3138 // pane->setCentreFrame(m_viewManager->getGlobalCentreFrame()); | 3138 // pane->setCentreFrame(m_viewManager->getGlobalCentreFrame()); |
3139 | 3139 |
3140 CommandHistory::getInstance()->endCompoundOperation(); | 3140 CommandHistory::getInstance()->endCompoundOperation(); |
3141 | 3141 |
3338 duration, | 3338 duration, |
3339 &configurator); | 3339 &configurator); |
3340 | 3340 |
3341 if (!input.getModel()) return; | 3341 if (!input.getModel()) return; |
3342 | 3342 |
3343 // DEBUG << "MainWindow::addLayer: Input model is " << input.getModel() << " \"" << input.getModel()->objectName() << "\"" << endl << "transform:" << endl << transform.toXmlString() << endl; | 3343 // SVDEBUG << "MainWindow::addLayer: Input model is " << input.getModel() << " \"" << input.getModel()->objectName() << "\"" << endl << "transform:" << endl << transform.toXmlString() << endl; |
3344 | 3344 |
3345 Layer *newLayer = m_document->createDerivedLayer(transform, input); | 3345 Layer *newLayer = m_document->createDerivedLayer(transform, input); |
3346 | 3346 |
3347 if (newLayer) { | 3347 if (newLayer) { |
3348 m_document->addLayerToView(pane, newLayer); | 3348 m_document->addLayerToView(pane, newLayer); |
3882 } | 3882 } |
3883 | 3883 |
3884 void | 3884 void |
3885 MainWindow::rightButtonMenuRequested(Pane *pane, QPoint position) | 3885 MainWindow::rightButtonMenuRequested(Pane *pane, QPoint position) |
3886 { | 3886 { |
3887 // DEBUG << "MainWindow::rightButtonMenuRequested(" << pane << ", " << position.x() << ", " << position.y() << ")" << endl; | 3887 // SVDEBUG << "MainWindow::rightButtonMenuRequested(" << pane << ", " << position.x() << ", " << position.y() << ")" << endl; |
3888 m_paneStack->setCurrentPane(pane); | 3888 m_paneStack->setCurrentPane(pane); |
3889 m_rightButtonMenu->popup(position); | 3889 m_rightButtonMenu->popup(position); |
3890 } | 3890 } |
3891 | 3891 |
3892 void | 3892 void |