changeset 394:592d692b4f8b

* A bit more work on the data editor
author Chris Cannam
date Wed, 11 Jun 2008 12:54:18 +0000
parents 6671eb37d6d6
children 33c2f268c950
files view/ViewManager.cpp view/ViewManager.h widgets/ModelDataTableDialog.cpp widgets/ModelDataTableDialog.h
diffstat 4 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/view/ViewManager.cpp	Mon Jun 09 16:01:50 2008 +0000
+++ b/view/ViewManager.cpp	Wed Jun 11 12:54:18 2008 +0000
@@ -474,6 +474,8 @@
 {
     View *v = dynamic_cast<View *>(sender());
 
+    std::cerr << "ViewManager::viewCentreFrameChanged(" << f << ", " << locked << ", " << mode << "), view is " << v << std::endl;
+
     if (locked) {
         m_globalCentreFrame = f;
         emit globalCentreFrameChanged(f);
--- a/view/ViewManager.h	Mon Jun 09 16:01:50 2008 +0000
+++ b/view/ViewManager.h	Wed Jun 11 12:54:18 2008 +0000
@@ -59,12 +59,10 @@
 
     bool isPlaying() const;
 
-    unsigned long getGlobalCentreFrame() const;
-    void setGlobalCentreFrame(unsigned long);
+    unsigned long getGlobalCentreFrame() const; // the set method is a slot
     unsigned long getGlobalZoom() const;
 
-    unsigned long getPlaybackFrame() const;
-    void setPlaybackFrame(unsigned long frame);
+    unsigned long getPlaybackFrame() const; // the set method is a slot
 
     // Only meaningful in solo mode, and used for optional alignment feature
     Model *getPlaybackModel() const;
@@ -240,6 +238,8 @@
 public slots:
     void viewCentreFrameChanged(unsigned long, bool, PlaybackFollowMode);
     void viewZoomLevelChanged(unsigned long, bool);
+    void setGlobalCentreFrame(unsigned long);
+    void setPlaybackFrame(unsigned long);
 
 protected slots:
     void checkPlayStatus();
--- a/widgets/ModelDataTableDialog.cpp	Mon Jun 09 16:01:50 2008 +0000
+++ b/widgets/ModelDataTableDialog.cpp	Wed Jun 11 12:54:18 2008 +0000
@@ -90,7 +90,7 @@
 }
 
 void
-ModelDataTableDialog::scrollToFrame(unsigned long frame)
+ModelDataTableDialog::scrollToFrameRequested(unsigned long frame)
 {
     m_tableView->scrollTo(m_table->getModelIndexForFrame(frame));
 }
@@ -99,6 +99,7 @@
 ModelDataTableDialog::viewClicked(const QModelIndex &index)
 {
     std::cerr << "ModelDataTableDialog::viewClicked: " << index.row() << ", " << index.column() << std::endl;
+    emit scrollToFrame(m_table->getFrameForModelIndex(index));
 }
 
 void
--- a/widgets/ModelDataTableDialog.h	Mon Jun 09 16:01:50 2008 +0000
+++ b/widgets/ModelDataTableDialog.h	Wed Jun 11 12:54:18 2008 +0000
@@ -32,8 +32,11 @@
     ModelDataTableDialog(Model *model, QWidget *parent = 0);
     ~ModelDataTableDialog();
 
+signals:
+    void scrollToFrame(unsigned long frame);
+
 public slots:
-    void scrollToFrame(unsigned long frame);
+    void scrollToFrameRequested(unsigned long frame);
     void executeCommand(Command *);
 
 protected slots: