Add shortcut for locking current track, trash ripple delete

Ref: T1961
parent 1a5261c4
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="kdenlive" version="113" translationDomain="kdenlive">
<kpartgui name="kdenlive" version="114" translationDomain="kdenlive">
<ToolBar name="extraToolBar" >
<text>Extra Toolbar</text>
<Action name="project_render" />
......@@ -119,9 +119,6 @@
<Action name="clip_in_project_tree" />
<Action name="expand_timeline_clip" />
</Menu>
<Menu name="all_clips" ><text>All clips</text>
<Action name="ripple_delete" />
</Menu>
<Menu name="guide_menu" ><text>Guides</text>
<Action name="add_guide" />
<Action name="edit_guide" />
......@@ -137,6 +134,8 @@
<Action name="save_selection" />
<Action name="send_library" />
<Separator />
<Action name="switch_track_lock" />
<Separator />
<Menu name="video_effects_menu" ><text>Add Effect</text>
<ActionList name="add_effect" />
</Menu>
......
......@@ -1334,7 +1334,7 @@ void MainWindow::setupActions()
//TODO: port stopmotion to new Monitor code
//addAction("stopmotion", i18n("Stop Motion Capture"), this, SLOT(slotOpenStopmotion()), KoIconUtils::themedIcon("image-x-generic"));
addAction(QStringLiteral("ripple_delete"), i18n("Ripple Delete"), this, SLOT(slotRippleDelete()), QIcon(), Qt::CTRL + Qt::Key_X);
addAction(QStringLiteral("switch_track_lock"), i18n("Switch Track Lock"), pCore->projectManager(), SLOT(slotSwitchTrackLock()), QIcon(), Qt::SHIFT + Qt::Key_L);
QHash <QString, QAction*> actions;
actions.insert(QStringLiteral("reload"), reloadClip);
......@@ -2054,45 +2054,6 @@ void MainWindow::slotRemoveSpace()
pCore->projectManager()->currentTimeline()->projectView()->slotRemoveSpace();
}
void MainWindow::slotRippleDelete()
{
if (!m_projectMonitor->isActive() || !pCore->projectManager()->currentTimeline()) return;
int zoneStart = m_projectMonitor->getZoneStart();
int zoneEnd = m_projectMonitor->getZoneEnd();
if (!zoneStart && zoneEnd == (pCore->projectManager()->currentTimeline()->duration() - 1)) return;
int zoneFrameCount = zoneEnd - zoneStart;
m_projectMonitor->slotZoneStart();
pCore->projectManager()->currentTimeline()->projectView()->setCursorPos(zoneStart);
pCore->projectManager()->currentTimeline()->projectView()->slotSelectAllClips();
pCore->projectManager()->currentTimeline()->projectView()->cutSelectedClips();
pCore->projectManager()->currentTimeline()->projectView()->resetSelectionGroup(false);
m_projectMonitor->slotZoneEnd();
pCore->projectManager()->currentTimeline()->projectView()->setCursorPos(zoneEnd);
zoneEnd++;
pCore->projectManager()->currentTimeline()->projectView()->selectItemsRightOfFrame(zoneEnd);
pCore->projectManager()->currentTimeline()->projectView()->setInPoint();
pCore->projectManager()->currentTimeline()->projectView()->resetSelectionGroup(false);
zoneEnd++;
pCore->projectManager()->currentTimeline()->projectView()->selectItemsRightOfFrame(zoneEnd);
pCore->projectManager()->currentTimeline()->projectView()->spaceToolMoveToSnapPos((double) zoneEnd);
pCore->projectManager()->currentTimeline()->projectView()->spaceToolMoveToSnapPos((double) zoneStart);
GenTime timeOffset = GenTime(zoneFrameCount * -1, pCore->projectManager()->current()->fps());
pCore->projectManager()->currentTimeline()->projectView()->completeSpaceOperation(-1, timeOffset);
m_projectMonitor->slotZoneStart();
pCore->projectManager()->currentTimeline()->projectView()->setCursorPos(zoneStart);
pCore->projectManager()->currentTimeline()->projectView()->resetSelectionGroup(false);
return;
}
void MainWindow::slotInsertTrack()
{
pCore->monitorManager()->activateMonitor(Kdenlive::ProjectMonitor);
......
......@@ -425,8 +425,6 @@ private slots:
/** @brief Move playhead to mouse curser position if defined key is pressed */
void slotAlignPlayheadToMousePos();
// Ripple Edit
void slotRippleDelete();
void slotThemeChanged(const QString &);
void slotReloadTheme();
/** @brief Close Kdenlive and try to restart it */
......
......@@ -703,3 +703,9 @@ void ProjectManager::slotDisableTimelineEffects(bool disable)
pCore->monitorManager()->projectMonitor()->refreshMonitorIfActive();
}
void ProjectManager::slotSwitchTrackLock()
{
m_trackView->projectView()->switchTrackLock();
}
......@@ -107,6 +107,9 @@ public slots:
/** @brief Dis/enable all timeline effects */
void slotDisableTimelineEffects(bool disable);
/** @brief Un/Lock current timeline track */
void slotSwitchTrackLock();
private slots:
void slotRevert();
......
......@@ -8418,3 +8418,7 @@ void CustomTrackView::breakLockedGroups(QList<ItemInfo> clipsToMove, QList<ItemI
}
}
void CustomTrackView::switchTrackLock()
{
slotSwitchTrackLock(m_selectedTrack, !m_timeline->getTrackInfo(m_selectedTrack).isLocked);
}
......@@ -252,6 +252,8 @@ public:
bool createSplitOverlay(Mlt::Filter *filter);
void removeSplitOverlay();
void dropTransitionGeometry(Transition *trans, const QString &geometry);
/** @brief Switch current track lock state */
void switchTrackLock();
public slots:
/** @brief Send seek request to MLT. */
......
......@@ -1590,3 +1590,4 @@ bool Timeline::createOverlay(Mlt::Filter *filter, int tk, int startPos)
m_tractor->unlock();
return true;
}
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