Commit 717121c4 authored by Julius Künzel's avatar Julius Künzel
Browse files

Monitor: add possiblity to use shortcut for show/hide edit mode

BUG: 434405
parent 813cd149
......@@ -129,7 +129,6 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
, m_dragStarted(false)
, m_recManager(nullptr)
, m_loopClipAction(nullptr)
, m_sceneVisibilityAction(nullptr)
, m_contextMenu(nullptr)
, m_markerMenu(nullptr)
, m_audioChannels(nullptr)
......@@ -439,11 +438,7 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
connect(m_glMonitor->getControllerProxy(), &MonitorProxy::addRemoveKeyframe, this, &Monitor::addRemoveKeyframe);
connect(m_glMonitor->getControllerProxy(), &MonitorProxy::seekToKeyframe, this, &Monitor::slotSeekToKeyFrame);
m_sceneVisibilityAction = new QAction(QIcon::fromTheme(QStringLiteral("transform-crop")), i18n("Show/Hide edit mode"), this);
m_sceneVisibilityAction->setCheckable(true);
m_sceneVisibilityAction->setChecked(KdenliveSettings::showOnMonitorScene());
connect(m_sceneVisibilityAction, &QAction::triggered, this, &Monitor::slotEnableEffectScene);
m_toolbar->addAction(m_sceneVisibilityAction);
m_toolbar->addAction(manager->getAction(QStringLiteral("monitor_editmode")));
m_toolbar->addSeparator();
m_toolbar->addWidget(m_timePos);
......@@ -1849,7 +1844,7 @@ QPoint Monitor::getZoneInfo() const
return m_glMonitor->getControllerProxy()->zone();
}
void Monitor::slotEnableEffectScene(bool enable)
void Monitor::enableEffectScene(bool enable)
{
KdenliveSettings::setShowOnMonitorScene(enable);
MonitorSceneType sceneType = enable ? m_lastMonitorSceneType : MonitorSceneDefault;
......@@ -2213,7 +2208,7 @@ void Monitor::loadQmlScene(MonitorSceneType type, QVariant sceneData)
return;
}
bool sceneWithEdit = type == MonitorSceneGeometry || type == MonitorSceneCorners || type == MonitorSceneRoto;
if ((m_sceneVisibilityAction != nullptr) && !m_sceneVisibilityAction->isChecked() && sceneWithEdit) {
if (!m_monitorManager->getAction(QStringLiteral("monitor_editmode"))->isChecked() && sceneWithEdit) {
// User doesn't want effect scenes
pCore->displayMessage(i18n("Enable edit mode in monitor to edit effect"), InformationMessage, 500);
type = MonitorSceneDefault;
......
......@@ -154,6 +154,8 @@ public:
void normalizeAudioThumbs();
/** @brief Returns true if monitor is playing */
bool isPlaying() const;
/** @brief Enables / disables effect scene*/
void enableEffectScene(bool enable);
protected:
......@@ -200,7 +202,6 @@ private:
KSelectAction *m_forceSize;
/** Has to be available so we can enable and disable it. */
QAction *m_loopClipAction;
QAction *m_sceneVisibilityAction;
QAction *m_zoomVisibilityAction;
QMenu *m_contextMenu;
QMenu *m_configMenu;
......@@ -247,7 +248,6 @@ private slots:
void onFrameDisplayed(const SharedFrame &frame);
void slotStartDrag();
void setZoom();
void slotEnableEffectScene(bool enable);
void slotAdjustEffectCompare();
void slotShowMenu(const QPoint pos);
void slotForceSize(QAction *a);
......
......@@ -331,6 +331,13 @@ void MonitorManager::resetConsumers(bool fullReset)
}
}
void MonitorManager::slotToggleEffectScene(bool enable)
{
if (m_activeMonitor) {
static_cast<Monitor *>(m_activeMonitor)->enableEffectScene(enable);
}
}
void MonitorManager::slotUpdateAudioMonitoring()
{
if (m_clipMonitor) {
......@@ -422,6 +429,12 @@ void MonitorManager::setupActions()
});
pCore->window()->addAction(QStringLiteral("monitor_multitrack"), m_multiTrack);
QAction *enableEditmode = new QAction(QIcon::fromTheme(QStringLiteral("transform-crop")), i18n("Show/Hide edit mode"), this);
enableEditmode->setCheckable(true);
enableEditmode->setChecked(KdenliveSettings::showOnMonitorScene());
connect(enableEditmode, &QAction::triggered, this, &MonitorManager::slotToggleEffectScene);
pCore->window()->addAction(QStringLiteral("monitor_editmode"), enableEditmode);
QAction *projectEnd = new QAction(QIcon::fromTheme(QStringLiteral("go-last")), i18n("Go to Project End"), this);
connect(projectEnd, &QAction::triggered, this, &MonitorManager::slotEnd);
pCore->window()->addAction(QStringLiteral("seek_end"), projectEnd, Qt::CTRL + Qt::Key_End);
......
......@@ -128,6 +128,8 @@ private slots:
void slotZoomOut();
/** @brief Trigger refresh of both monitors */
void forceProjectMonitorRefresh();
/** @brief Enables / disables effect scene*/
void slotToggleEffectScene(bool enable);
private:
/** @brief Make sure 2 monitors cannot be activated simultaneously*/
......
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