comparison framework/MainWindowBase.cpp @ 124:bfa6b0582acb

* reorganise tabular data editor model support
author Chris Cannam
date Wed, 11 Jun 2008 16:13:25 +0000
parents 74dd55646f52
children e4635503a6d2
comparison
equal deleted inserted replaced
123:74dd55646f52 124:bfa6b0582acb
21 #include "view/PaneStack.h" 21 #include "view/PaneStack.h"
22 #include "data/model/WaveFileModel.h" 22 #include "data/model/WaveFileModel.h"
23 #include "data/model/SparseOneDimensionalModel.h" 23 #include "data/model/SparseOneDimensionalModel.h"
24 #include "data/model/NoteModel.h" 24 #include "data/model/NoteModel.h"
25 #include "data/model/Labeller.h" 25 #include "data/model/Labeller.h"
26 #include "data/model/TabularModel.h"
26 #include "view/ViewManager.h" 27 #include "view/ViewManager.h"
27 28
28 #include "layer/WaveformLayer.h" 29 #include "layer/WaveformLayer.h"
29 #include "layer/TimeRulerLayer.h" 30 #include "layer/TimeRulerLayer.h"
30 #include "layer/TimeInstantLayer.h" 31 #include "layer/TimeInstantLayer.h"
1932 if (!layer) return; 1933 if (!layer) return;
1933 1934
1934 Model *model = layer->getModel(); 1935 Model *model = layer->getModel();
1935 if (!model) return; 1936 if (!model) return;
1936 1937
1938 TabularModel *tabular = dynamic_cast<TabularModel *>(model);
1939 if (!tabular) {
1940 //!!! how to prevent this function from being active if not
1941 //appropriate model type? or will we ultimately support
1942 //tabular display for all editable models?
1943 std::cerr << "NOTE: Not a tabular model" << std::endl;
1944 return;
1945 }
1946
1937 if (m_layerDataDialogMap.find(layer) != m_layerDataDialogMap.end()) { 1947 if (m_layerDataDialogMap.find(layer) != m_layerDataDialogMap.end()) {
1938 m_layerDataDialogMap[layer]->show(); 1948 m_layerDataDialogMap[layer]->show();
1939 m_layerDataDialogMap[layer]->raise(); 1949 m_layerDataDialogMap[layer]->raise();
1940 return; 1950 return;
1941 } 1951 }
1942 1952
1943 ModelDataTableDialog *dialog = new ModelDataTableDialog(model); 1953 ModelDataTableDialog *dialog = new ModelDataTableDialog(tabular);
1944 // dialog->setAttribute(Qt::WA_DeleteOnClose); //!!! how to manage this? 1954 // dialog->setAttribute(Qt::WA_DeleteOnClose); //!!! how to manage this?
1945 1955
1946 connect(m_viewManager, 1956 connect(m_viewManager,
1947 SIGNAL(globalCentreFrameChanged(unsigned long)), 1957 SIGNAL(globalCentreFrameChanged(unsigned long)),
1948 dialog, 1958 dialog,