Mercurial > hg > sonic-visualiser
changeset 258:a31c65904a49
* Start adding a spreadsheet-style editor window for model data
author | Chris Cannam |
---|---|
date | Fri, 06 Jun 2008 15:26:27 +0000 (2008-06-06) |
parents | 6e8ebc86119a |
children | c64720483413 |
files | main/MainWindow.cpp main/MainWindow.h sv.pro |
diffstat | 3 files changed, 33 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/main/MainWindow.cpp Thu May 29 14:35:32 2008 +0000 +++ b/main/MainWindow.cpp Fri Jun 06 15:26:27 2008 +0000 @@ -43,6 +43,7 @@ #include "widgets/AudioDial.h" #include "widgets/IconLoader.h" #include "widgets/LayerTreeDialog.h" +#include "widgets/ModelDataTableDialog.h" #include "widgets/ListInputDialog.h" #include "widgets/SubdividingMenu.h" #include "widgets/NotifyingPushButton.h" @@ -1180,6 +1181,14 @@ menu->addAction(raction); m_rightButtonLayerMenu->addAction(raction); + QAction *eaction = new QAction(tr("Edit Layer Data"), this); + eaction->setShortcut(tr("E")); + eaction->setStatusTip(tr("Edit the currently active layer as a data grid")); + connect(eaction, SIGNAL(triggered()), this, SLOT(editCurrentLayer())); + connect(this, SIGNAL(canEditLayer(bool)), eaction, SLOT(setEnabled(bool))); + menu->addAction(eaction); + m_rightButtonLayerMenu->addAction(eaction); + action = new QAction(il.load("editdelete"), tr("&Delete Layer"), this); action->setShortcut(tr("Ctrl+D")); action->setStatusTip(tr("Delete the currently active layer")); @@ -1190,6 +1199,7 @@ m_rightButtonLayerMenu->addAction(action); m_keyReference->registerShortcut(raction); // rename after delete, so delete layer goes next to delete pane + m_keyReference->registerShortcut(eaction); // edit also after delete } void @@ -3035,6 +3045,27 @@ } void +MainWindow::editCurrentLayer() +{ + //!!! maintain one per layer only + + Pane *pane = m_paneStack->getCurrentPane(); + if (pane) { + Layer *layer = pane->getSelectedLayer(); + if (layer) { + Model *model = layer->getModel(); + if (model) { + + ModelDataTableDialog *dialog = new ModelDataTableDialog(model); + dialog->setAttribute(Qt::WA_DeleteOnClose); // see below + dialog->show(); + return; + } + } + } +} + +void MainWindow::playSoloToggled() { MainWindowBase::playSoloToggled();
--- a/main/MainWindow.h Thu May 29 14:35:32 2008 +0000 +++ b/main/MainWindow.h Fri Jun 06 15:26:27 2008 +0000 @@ -126,6 +126,7 @@ virtual void addPane(); virtual void addLayer(); virtual void renameCurrentLayer(); + virtual void editCurrentLayer(); virtual void paneAdded(Pane *); virtual void paneHidden(Pane *);
--- a/sv.pro Thu May 29 14:35:32 2008 +0000 +++ b/sv.pro Fri Jun 06 15:26:27 2008 +0000 @@ -17,7 +17,7 @@ contains(DEFINES, BUILD_STATIC):LIBS -= -ljack -LIBS = -lsvframework -lsvaudioio -lsvview -lsvlayer -lsvdata -lsvtransform -lsvwidgets -lsvplugin -lsvbase -lsvsystem $$LIBS +LIBS = -lsvframework -lsvaudioio -lsvview -lsvlayer -lsvtransform -lsvwidgets -lsvdata -lsvplugin -lsvbase -lsvsystem $$LIBS PRE_TARGETDEPS += ../view/libsvview.a \ ../layer/libsvlayer.a \