Clicking on timeline preview while it is running aborts rendering

Ref: T1949
parent ff1787c9
......@@ -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);
......
......@@ -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)
......
......@@ -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);
......
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