Commit c94604d3 authored by Simon Eugster's avatar Simon Eugster
Browse files

AbstractColorItem: disconnecting slots correctly to avoid multiple slots on one signal.

svn path=/trunk/kdenlive/; revision=4604
parent d96ef19b
......@@ -49,6 +49,7 @@ AbstractScopeWidget::AbstractScopeWidget(Monitor *projMonitor, Monitor *clipMoni
m_aAutoRefresh->setCheckable(true);
m_aRealtime = new QAction(i18n("Realtime (with precision loss)"), this);
m_aRealtime->setCheckable(true);
m_aRealtime->setEnabled(false);
m_menu = new QMenu(this);
m_menu->setPalette(m_scopePalette);
......@@ -179,17 +180,15 @@ void AbstractScopeWidget::slotBackgroundRenderingFinished(uint)
void AbstractScopeWidget::slotActiveMonitorChanged(bool isClipMonitor)
{
qDebug() << "Active monitor has changed in " << widgetName() << ". Is the clip monitor active now? " << isClipMonitor;
if (isClipMonitor) {
m_activeRender = m_clipMonitor->render;
disconnect(this, SLOT(slotRenderZoneUpdated()));
connect(m_activeRender, SIGNAL(rendererPosition(int)), this, SLOT(slotRenderZoneUpdated()));
qDebug() << "Connected to clip monitor.";
} else {
m_activeRender = m_projMonitor->render;
disconnect(this, SLOT(slotRenderZoneUpdated()));
connect(m_activeRender, SIGNAL(rendererPosition(int)), this, SLOT(slotRenderZoneUpdated()));
qDebug() << "Connected to project monitor.";
}
bool disconnected = m_activeRender->disconnect(this);
Q_ASSERT(disconnected);
m_activeRender = (isClipMonitor) ? m_clipMonitor->render : m_projMonitor->render;
connect(m_activeRender, SIGNAL(rendererPosition(int)), this, SLOT(slotRenderZoneUpdated()));
connect(m_activeRender, SIGNAL(rendererPositionBefore0()), this, SLOT(slotRenderZoneUpdated()));
// Update the scope for the new monitor.
prodHUDThread();
prodScopeThread();
......
......@@ -40,6 +40,9 @@
The custom context menu already contains entries, like for enabling auto-
refresh. It can certainly be extended in the implementation of the widget.
Note: Widgets deriving from this class should connect slotActiveMonitorChanged
to the appropriate signal.
If you intend to write an own widget inheriting from this one, please read
the comments on the unimplemented methods carefully. They are not only here
for optical amusement, but also contain important information.
......
......@@ -82,6 +82,8 @@ Vectorscope::Vectorscope(Monitor *projMonitor, Monitor *clipMonitor, QWidget *pa
{
setupUi(this);
//TODO don't draw circle when mouseLeaved
m_colorTools = new ColorTools();
m_colorPlaneExport = new ColorPlaneExport(this);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment