changeset 89:803830f186ef

* Move matrix/fft file code to fileio (from base) * Add right-button menu to panes
author Chris Cannam
date Fri, 05 May 2006 13:06:47 +0000
parents 6b864e6864cb
children 7d06e7cf5d5a
files layer/SpectrogramLayer.cpp widgets/Pane.cpp widgets/Pane.h widgets/PaneStack.cpp widgets/PaneStack.h
diffstat 5 files changed, 31 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/layer/SpectrogramLayer.cpp	Thu May 04 16:03:02 2006 +0000
+++ b/layer/SpectrogramLayer.cpp	Fri May 05 13:06:47 2006 +0000
@@ -20,8 +20,7 @@
 #include "base/AudioLevel.h"
 #include "base/Window.h"
 #include "base/Pitch.h"
-#include "base/FFTCache.h"
-#include "base/FFTFileCache.h"
+#include "fileio/FFTFileCache.h"
 
 #include <QPainter>
 #include <QImage>
--- a/widgets/Pane.cpp	Thu May 04 16:03:02 2006 +0000
+++ b/widgets/Pane.cpp	Fri May 05 13:06:47 2006 +0000
@@ -479,6 +479,11 @@
 void
 Pane::mousePressEvent(QMouseEvent *e)
 {
+    if (e->buttons() & Qt::RightButton) {
+        emit rightButtonMenuRequested(mapToGlobal(e->pos()));
+        return;
+    }
+
     m_clickPos = e->pos();
     m_clickedInRange = true;
     m_editingSelection = Selection();
@@ -566,6 +571,10 @@
 void
 Pane::mouseReleaseEvent(QMouseEvent *e)
 {
+    if (e->buttons() & Qt::RightButton) {
+        return;
+    }
+
     ViewManager::ToolMode mode = ViewManager::NavigateMode;
     if (m_manager) mode = m_manager->getToolMode();
 
@@ -661,6 +670,10 @@
 void
 Pane::mouseMoveEvent(QMouseEvent *e)
 {
+    if (e->buttons() & Qt::RightButton) {
+        return;
+    }
+
     ViewManager::ToolMode mode = ViewManager::NavigateMode;
     if (m_manager) mode = m_manager->getToolMode();
 
@@ -814,6 +827,10 @@
 void
 Pane::mouseDoubleClickEvent(QMouseEvent *e)
 {
+    if (e->buttons() & Qt::RightButton) {
+        return;
+    }
+
     std::cerr << "mouseDoubleClickEvent" << std::endl;
 
     m_clickPos = e->pos();
--- a/widgets/Pane.h	Thu May 04 16:03:02 2006 +0000
+++ b/widgets/Pane.h	Fri May 05 13:06:47 2006 +0000
@@ -50,6 +50,7 @@
 
 signals:
     void paneInteractedWith();
+    void rightButtonMenuRequested(QPoint position);
 
 public slots:
     virtual void toolModeChanged();
--- a/widgets/PaneStack.cpp	Thu May 04 16:03:02 2006 +0000
+++ b/widgets/PaneStack.cpp	Fri May 05 13:06:47 2006 +0000
@@ -83,6 +83,8 @@
 	    this, SLOT(propertyContainerRemoved(PropertyContainer *)));
     connect(pane, SIGNAL(paneInteractedWith()),
 	    this, SLOT(paneInteractedWith()));
+    connect(pane, SIGNAL(rightButtonMenuRequested(QPoint)),
+            this, SLOT(rightButtonMenuRequested(QPoint)));
 
     if (!m_currentPane) {
 	setCurrentPane(pane);
@@ -325,6 +327,14 @@
 }
 
 void
+PaneStack::rightButtonMenuRequested(QPoint position)
+{
+    Pane *pane = dynamic_cast<Pane *>(sender());
+    if (!pane) return;
+    emit rightButtonMenuRequested(pane, position);
+}
+
+void
 PaneStack::sizePropertyStacks()
 {
     int maxMinWidth = 0;
--- a/widgets/PaneStack.h	Thu May 04 16:03:02 2006 +0000
+++ b/widgets/PaneStack.h	Fri May 05 13:06:47 2006 +0000
@@ -54,12 +54,14 @@
 signals:
     void currentPaneChanged(Pane *pane);
     void currentLayerChanged(Pane *pane, Layer *layer);
+    void rightButtonMenuRequested(Pane *pane, QPoint position);
 
 public slots:
     void propertyContainerAdded(PropertyContainer *);
     void propertyContainerRemoved(PropertyContainer *);
     void propertyContainerSelected(View *client, PropertyContainer *);
     void paneInteractedWith();
+    void rightButtonMenuRequested(QPoint);
 
 protected:
     Pane *m_currentPane;