Add keyboard shortcuts to set track active/inactive

parent 79762b5d
......@@ -988,5 +988,9 @@
<label>color titler guides.</label>
<default>#ff0000</default>
</entry>
<entry name="titlerbg" type="Int">
<label>Default background for titler.</label>
<default>0</default>
</entry>
</group>
</kcfg>
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="kdenlive" version="158" translationDomain="kdenlive">
<kpartgui name="kdenlive" version="159" translationDomain="kdenlive">
<MenuBar>
<Menu name="file" >
<Action name="dvd_wizard" />
......@@ -135,6 +135,7 @@
<Action name="switch_track_lock" />
<Action name="switch_all_track_lock" />
<Action name="switch_track_target" />
<Action name="switch_active_target" />
</Menu>
<Separator />
<Menu name="video_effects_menu" ><text>Add Effect</text>
......
......@@ -1474,7 +1474,8 @@ void MainWindow::setupActions()
Qt::CTRL + Qt::SHIFT + Qt::Key_L);
addAction(QStringLiteral("switch_track_target"), i18n("Toggle Track Target"), pCore->projectManager(), SLOT(slotSwitchTrackTarget()), QIcon(),
Qt::SHIFT + Qt::Key_T);
addAction(QStringLiteral("switch_active_target"), i18n("Toggle Track Active"), pCore->projectManager(), SLOT(slotSwitchTrackActive()), QIcon(),
Qt::Key_A);
addAction(QStringLiteral("add_project_note"), i18n("Add Project Note"), pCore->projectManager(), SLOT(slotAddProjectNote()),
QIcon::fromTheme(QStringLiteral("bookmark")));
......
......@@ -752,6 +752,11 @@ void ProjectManager::slotSwitchTrackLock()
pCore->window()->getMainTimeline()->controller()->switchTrackLock();
}
void ProjectManager::slotSwitchTrackActive()
{
pCore->window()->getMainTimeline()->controller()->switchTrackActive();
}
void ProjectManager::slotSwitchAllTrackLock()
{
pCore->window()->getMainTimeline()->controller()->switchTrackLock(true);
......
......@@ -136,6 +136,10 @@ public slots:
/** @brief Un/Lock current timeline track */
void slotSwitchTrackLock();
void slotSwitchAllTrackLock();
/** @brief Make current timeline track active/inactive*/
void slotSwitchTrackActive();
/** @brief Un/Set current track as target */
void slotSwitchTrackTarget();
......
......@@ -1517,6 +1517,9 @@ void TimelineController::alignAudio(int clipId)
void TimelineController::switchTrackActive(int trackId)
{
if (trackId == -1) {
trackId = m_activeTrack;
}
bool active = m_model->getTrackById_const(trackId)->isTimelineActive();
m_model->setTrackProperty(trackId, QStringLiteral("kdenlive:timeline_active"), active ? QStringLiteral("0") : QStringLiteral("1"));
}
......
......@@ -314,7 +314,7 @@ public:
Q_INVOKABLE void removeEffectKeyframe(int cid, int frame);
Q_INVOKABLE void updateEffectKeyframe(int cid, int oldFrame, int newFrame, const QVariant &normalizedValue = QVariant());
Q_INVOKABLE void switchTrackActive(int trackId);
Q_INVOKABLE void switchTrackActive(int trackId = -1);
void switchTrackLock(bool applyToAll = false);
void switchTargetTrack();
......
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