aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2016-07-26 22:14:10 +0200
committerJean-Baptiste Mardelle <[email protected]>2016-07-26 22:14:10 +0200
commitb94bfa96ec749aae2dedb3f6324bbe96b9dcaf72 (patch)
tree34811eab8d818d566ce8581e35c6daa8b53ba326
parentff1787c962b99ad933715d24d3d7419d912a0105 (diff)
Clicking on timeline preview while it is running aborts rendering
Ref: T1949
-rw-r--r--src/mainwindow.cpp10
-rw-r--r--src/utils/progressbutton.cpp6
-rw-r--r--src/utils/progressbutton.h2
3 files changed, 10 insertions, 8 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 59ce526..f6e6dae 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -562,7 +562,8 @@ MainWindow::MainWindow(const QString &MltPath, const QUrl &Url, const QString &
connect(m_timelineToolBar, &QWidget::customContextMenuRequested, this, &MainWindow::showTimelineToolbarMenu);
QAction *prevRender = actionCollection()->action(QStringLiteral("prerender_timeline_zone"));
- tlMenu->addAction(actionCollection()->action(QStringLiteral("stop_prerender_timeline")));
+ QAction *stopPrevRender = actionCollection()->action(QStringLiteral("stop_prerender_timeline"));
+ tlMenu->addAction(stopPrevRender);
tlMenu->addAction(actionCollection()->action(QStringLiteral("set_render_timeline_zone")));
tlMenu->addAction(actionCollection()->action(QStringLiteral("unset_render_timeline_zone")));
tlMenu->addAction(actionCollection()->action(QStringLiteral("unset_render_timeline_zone")));
@@ -576,12 +577,13 @@ MainWindow::MainWindow(const QString &MltPath, const QUrl &Url, const QString &
tlMenu->addSeparator();
tlMenu->addAction(actionCollection()->action(QStringLiteral("disable_preview")));
tlMenu->addAction(actionCollection()->action(QStringLiteral("manage_cache")));
- timelinePreview->defineDefaultAction(prevRender, false);
+ timelinePreview->defineDefaultAction(prevRender, stopPrevRender);
timelinePreview->setAutoRaise(true);
- tlrMenu->addAction(actionCollection()->action(QStringLiteral("project_render")));
+ QAction *showRender = actionCollection()->action(QStringLiteral("project_render"));
+ tlrMenu->addAction(showRender);
tlrMenu->addAction(actionCollection()->action(QStringLiteral("stop_project_render")));
- timelineRender->defineDefaultAction(actionCollection()->action(QStringLiteral("project_render")));
+ timelineRender->defineDefaultAction(showRender, showRender);
timelineRender->setAutoRaise(true);
diff --git a/src/utils/progressbutton.cpp b/src/utils/progressbutton.cpp
index 740341b..bc67b4f 100644
--- a/src/utils/progressbutton.cpp
+++ b/src/utils/progressbutton.cpp
@@ -45,12 +45,12 @@ ProgressButton::~ProgressButton()
delete m_dummyAction;
}
-void ProgressButton::defineDefaultAction(QAction *action, bool activateOnProgress)
+void ProgressButton::defineDefaultAction(QAction *action, QAction *actionInProgress)
{
setDefaultAction(action);
m_defaultAction = action;
- if (activateOnProgress)
- connect(m_dummyAction, &QAction::triggered, m_defaultAction, &QAction::trigger);
+ if (actionInProgress)
+ connect(m_dummyAction, &QAction::triggered, actionInProgress, &QAction::trigger);
}
void ProgressButton::setProgress(int progress)
diff --git a/src/utils/progressbutton.h b/src/utils/progressbutton.h
index 363cec8..dd20a71 100644
--- a/src/utils/progressbutton.h
+++ b/src/utils/progressbutton.h
@@ -43,7 +43,7 @@ public:
~ProgressButton();
int progress() const;
void setProgress(int);
- void defineDefaultAction(QAction *action, bool activateOnProgress = true);
+ void defineDefaultAction(QAction *action, QAction *actionInProgress);
protected:
virtual void paintEvent(QPaintEvent *event);