Mercurial > hg > svapp
comparison framework/MainWindowBase.cpp @ 47:d97a7ed7aa39
* Add auto-alignment toggle to Document
* Make MainWindowBase cope if there is no time ruler layer
author | Chris Cannam |
---|---|
date | Thu, 25 Oct 2007 11:32:54 +0000 |
parents | 7fbe1c99d5d8 |
children | 73f682a551dc |
comparison
equal
deleted
inserted
replaced
46:7fbe1c99d5d8 | 47:d97a7ed7aa39 |
---|---|
895 AddPaneCommand *command = new AddPaneCommand(this); | 895 AddPaneCommand *command = new AddPaneCommand(this); |
896 CommandHistory::getInstance()->addCommand(command); | 896 CommandHistory::getInstance()->addCommand(command); |
897 | 897 |
898 Pane *pane = command->getPane(); | 898 Pane *pane = command->getPane(); |
899 | 899 |
900 if (!m_timeRulerLayer) { | 900 if (m_timeRulerLayer) { |
901 m_timeRulerLayer = m_document->createMainModelLayer | 901 m_document->addLayerToView(pane, m_timeRulerLayer); |
902 (LayerFactory::TimeRuler); | 902 } |
903 } | |
904 | |
905 m_document->addLayerToView(pane, m_timeRulerLayer); | |
906 | 903 |
907 Layer *newLayer = m_document->createImportedLayer(newModel); | 904 Layer *newLayer = m_document->createImportedLayer(newModel); |
908 | 905 |
909 if (newLayer) { | 906 if (newLayer) { |
910 m_document->addLayerToView(pane, newLayer); | 907 m_document->addLayerToView(pane, newLayer); |
1863 | 1860 |
1864 void | 1861 void |
1865 MainWindowBase::layerAboutToBeDeleted(Layer *layer) | 1862 MainWindowBase::layerAboutToBeDeleted(Layer *layer) |
1866 { | 1863 { |
1867 // std::cerr << "MainWindowBase::layerAboutToBeDeleted(" << layer << ")" << std::endl; | 1864 // std::cerr << "MainWindowBase::layerAboutToBeDeleted(" << layer << ")" << std::endl; |
1868 if (layer == m_timeRulerLayer) { | 1865 if (m_timeRulerLayer && (layer == m_timeRulerLayer)) { |
1869 // std::cerr << "(this is the time ruler layer)" << std::endl; | 1866 // std::cerr << "(this is the time ruler layer)" << std::endl; |
1870 m_timeRulerLayer = 0; | 1867 m_timeRulerLayer = 0; |
1871 } | 1868 } |
1872 } | 1869 } |
1873 | 1870 |