Add Lock all tracks but current

Ref: T1961
parent 6c1552c9
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="kdenlive" version="115" translationDomain="kdenlive">
<kpartgui name="kdenlive" version="116" translationDomain="kdenlive">
<ToolBar name="extraToolBar" >
<text>Extra Toolbar</text>
<Action name="project_render" />
......@@ -135,6 +135,7 @@
<Action name="send_library" />
<Menu name="timeline_tracks" ><text>Tracks</text>
<Action name="switch_track_lock" />
<Action name="switch_all_track_lock" />
<Action name="switch_track_target" />
</Menu>
<Separator />
......
......@@ -1335,6 +1335,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("switch_track_lock"), i18n("Switch Track Lock"), pCore->projectManager(), SLOT(slotSwitchTrackLock()), QIcon(), Qt::SHIFT + Qt::Key_L);
addAction(QStringLiteral("switch_all_track_lock"), i18n("Switch All Track Lock"), pCore->projectManager(), SLOT(slotSwitchAllTrackLock()), QIcon(), Qt::CTRL + Qt::SHIFT + Qt::Key_L);
addAction(QStringLiteral("switch_track_target"), i18n("Switch Track Target"), pCore->projectManager(), SLOT(slotSwitchTrackTarget()), QIcon(), Qt::SHIFT + Qt::Key_T);
QHash <QString, QAction*> actions;
......
......@@ -708,6 +708,11 @@ void ProjectManager::slotSwitchTrackLock()
m_trackView->projectView()->switchTrackLock();
}
void ProjectManager::slotSwitchAllTrackLock()
{
m_trackView->projectView()->switchAllTrackLock();
}
void ProjectManager::slotSwitchTrackTarget()
{
m_trackView->switchTrackTarget();
......
......@@ -109,6 +109,7 @@ public slots:
/** @brief Un/Lock current timeline track */
void slotSwitchTrackLock();
void slotSwitchAllTrackLock();
/** @brief Un/Set current track as target */
void slotSwitchTrackTarget();
......
......@@ -3709,9 +3709,20 @@ void CustomTrackView::slotSwitchTrackAudio(int ix, bool enable)
m_document->renderer()->doRefresh();
}
void CustomTrackView::slotSwitchTrackLock(int ix, bool enable)
void CustomTrackView::slotSwitchTrackLock(int ix, bool enable, bool applyToAll)
{
LockTrackCommand *command = new LockTrackCommand(this, ix, enable);
QUndoCommand *command = NULL;
if (!applyToAll) {
command = new LockTrackCommand(this, ix, enable);
} else {
command = new QUndoCommand;
command->setText(i18n("Switch All Track Lock"));
for (int i = 1; i <= m_timeline->visibleTracksCount(); ++i) {
if (i == ix)
continue;
new LockTrackCommand(this, i, enable, command);
}
}
m_commandStack->push(command);
}
......@@ -8588,3 +8599,11 @@ void CustomTrackView::switchTrackLock()
slotSwitchTrackLock(m_selectedTrack, !m_timeline->getTrackInfo(m_selectedTrack).isLocked);
}
void CustomTrackView::switchAllTrackLock()
{
if (m_selectedTrack > 1)
slotSwitchTrackLock(m_selectedTrack, !m_timeline->getTrackInfo(1).isLocked, true);
else if (m_timeline->visibleTracksCount() > 1)
slotSwitchTrackLock(m_selectedTrack, !m_timeline->getTrackInfo(2).isLocked, true);
}
......@@ -254,6 +254,7 @@ public:
void dropTransitionGeometry(Transition *trans, const QString &geometry);
/** @brief Switch current track lock state */
void switchTrackLock();
void switchAllTrackLock();
void insertTimelineSpace(GenTime startPos, GenTime duration);
public slots:
......@@ -275,7 +276,7 @@ public slots:
void slotTransitionUpdated(Transition *, QDomElement);
void slotSwitchTrackAudio(int ix, bool enable);
void slotSwitchTrackVideo(int ix, bool enable);
void slotSwitchTrackLock(int ix, bool enable);
void slotSwitchTrackLock(int ix, bool enable, bool applyToAll = false);
void slotUpdateClip(const QString &clipId, bool reload = true);
bool addGuide(const GenTime &pos, const QString &comment, bool loadingProject = false);
......
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