Commit 601e5177 authored by Rusty Striker's avatar Rusty Striker Committed by Jean-Baptiste Mardelle
Browse files

add zone-in/zone-out to contextual mouse menu for clip monitor(issue 1508)

parent fa73c4a5
Pipeline #265207 failed with stage
in 20 minutes and 34 seconds
......@@ -698,9 +698,9 @@ void MainWindow::init(const QString &mltPath)
connect(monitorOverlay, &QMenu::triggered, this, &MainWindow::slotSwitchMonitorOverlay);
m_projectMonitor->setupMenu(static_cast<QMenu *>(factory()->container(QStringLiteral("monitor_go"), this)), monitorOverlay, m_playZone, m_loopZone, nullptr,
m_loopClip);
m_loopClip, pCore->monitorManager());
m_clipMonitor->setupMenu(static_cast<QMenu *>(factory()->container(QStringLiteral("monitor_go"), this)), monitorOverlay, m_playZone, m_loopZone,
static_cast<QMenu *>(factory()->container(QStringLiteral("marker_menu"), this)));
static_cast<QMenu *>(factory()->container(QStringLiteral("marker_menu"), this)), nullptr, pCore->monitorManager());
QMenu *clipInTimeline = static_cast<QMenu *>(factory()->container(QStringLiteral("clip_in_timeline"), this));
clipInTimeline->setIcon(QIcon::fromTheme(QStringLiteral("go-jump")));
......@@ -995,9 +995,9 @@ void MainWindow::saveNewToolbarConfig()
QMenu *monitorOverlay = static_cast<QMenu *>(factory()->container(QStringLiteral("monitor_config_overlay"), this));
if (monitorOverlay) {
m_projectMonitor->setupMenu(static_cast<QMenu *>(factory()->container(QStringLiteral("monitor_go"), this)), monitorOverlay, m_playZone, m_loopZone,
nullptr, m_loopClip);
nullptr, m_loopClip, pCore->monitorManager());
m_clipMonitor->setupMenu(static_cast<QMenu *>(factory()->container(QStringLiteral("monitor_go"), this)), monitorOverlay, m_playZone, m_loopZone,
static_cast<QMenu *>(factory()->container(QStringLiteral("marker_menu"), this)));
static_cast<QMenu *>(factory()->container(QStringLiteral("marker_menu"), this)), nullptr, pCore->monitorManager());
}
}
......
......@@ -557,7 +557,7 @@ void Monitor::slotLockMonitor(bool lock)
m_monitorManager->lockMonitor(m_id, lock);
}
void Monitor::setupMenu(QMenu *goMenu, QMenu *overlayMenu, QAction *playZone, QAction *loopZone, QMenu *markerMenu, QAction *loopClip)
void Monitor::setupMenu(QMenu *goMenu, QMenu *overlayMenu, QAction *playZone, QAction *loopZone, QMenu *markerMenu, QAction *loopClip, MonitorManager *manager)
{
delete m_contextMenu;
m_contextMenu = new QMenu(this);
......@@ -597,6 +597,19 @@ void Monitor::setupMenu(QMenu *goMenu, QMenu *overlayMenu, QAction *playZone, QA
m_contextMenu->addAction(m_monitorManager->getAction(QStringLiteral("extract_frame_to_project")));
m_contextMenu->addAction(m_monitorManager->getAction(QStringLiteral("add_project_note")));
QAction *markIn = new QAction(QIcon::fromTheme(QStringLiteral("zone-in")), i18n("Set Zone In"), this);
QAction *markOut = new QAction(QIcon::fromTheme(QStringLiteral("zone-out")), i18n("Set Zone Out"), this);
m_contextMenu->addAction(markIn);
m_contextMenu->addAction(markOut);
connect(markIn, &QAction::triggered, this, [&, manager]() {
m_monitorManager->activateMonitor(m_id);
manager->getAction(QStringLiteral("mark_in"))->trigger();
});
connect(markOut, &QAction::triggered, this, [&, manager]() {
m_monitorManager->activateMonitor(m_id);
manager->getAction(QStringLiteral("mark_out"))->trigger();
});
if (m_id == Kdenlive::ProjectMonitor) {
m_contextMenu->addAction(m_monitorManager->getAction(QStringLiteral("monitor_multitrack")));
} else if (m_id == Kdenlive::ClipMonitor) {
......
......@@ -67,7 +67,8 @@ public:
void resetProfile();
/** @brief Rebuild consumers after a property change */
void resetConsumer(bool fullReset);
void setupMenu(QMenu *goMenu, QMenu *overlayMenu, QAction *playZone, QAction *loopZone, QMenu *markerMenu = nullptr, QAction *loopClip = nullptr);
void setupMenu(QMenu *goMenu, QMenu *overlayMenu, QAction *playZone, QAction *loopZone, QMenu *markerMenu = nullptr, QAction *loopClip = nullptr,
MonitorManager *manager = nullptr);
const QString activeClipId();
int position();
void updateTimecodeFormat();
......
Supports Markdown
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