aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2016-05-01 12:42:52 +0200
committerJean-Baptiste Mardelle <[email protected]>2016-05-01 12:42:52 +0200
commitfa8a72604d212fa9163a79c6101509e4bd7394f9 (patch)
treea57a0eadb196bcfbfe7a4f55d5b4d6a06ca61278
parent6c1552c945fdbbfccc937ec140736b414fec4033 (diff)
Add Lock all tracks but current
Ref: T1961
-rw-r--r--src/kdenliveui.rc3
-rw-r--r--src/mainwindow.cpp1
-rw-r--r--src/project/projectmanager.cpp5
-rw-r--r--src/project/projectmanager.h1
-rw-r--r--src/timeline/customtrackview.cpp23
-rw-r--r--src/timeline/customtrackview.h3
6 files changed, 32 insertions, 4 deletions
diff --git a/src/kdenliveui.rc b/src/kdenliveui.rc
index e0f21eb..0e7eb13 100644
--- a/src/kdenliveui.rc
+++ b/src/kdenliveui.rc
@@ -1,5 +1,5 @@
<!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 />
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index c71e5c5..b39dce8 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -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;
diff --git a/src/project/projectmanager.cpp b/src/project/projectmanager.cpp
index 97f0a7e..77a7b41 100644
--- a/src/project/projectmanager.cpp
+++ b/src/project/projectmanager.cpp
@@ -708,6 +708,11 @@ void ProjectManager::slotSwitchTrackLock()
m_trackView->projectView()->switchTrackLock();
}
+void ProjectManager::slotSwitchAllTrackLock()
+{
+ m_trackView->projectView()->switchAllTrackLock();
+}
+
void ProjectManager::slotSwitchTrackTarget()
{
m_trackView->switchTrackTarget();
diff --git a/src/project/projectmanager.h b/src/project/projectmanager.h
index fd7e594..fe3b24b 100644
--- a/src/project/projectmanager.h
+++ b/src/project/projectmanager.h
@@ -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();
diff --git a/src/timeline/customtrackview.cpp b/src/timeline/customtrackview.cpp
index 98b53a5..09adee5 100644
--- a/src/timeline/customtrackview.cpp
+++ b/src/timeline/customtrackview.cpp
@@ -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);
+}
+
diff --git a/src/timeline/customtrackview.h b/src/timeline/customtrackview.h
index fc60760..0d4ff1b 100644
--- a/src/timeline/customtrackview.h
+++ b/src/timeline/customtrackview.h
@@ -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);