Add action to restore current clip target tracks to default

parent ef43322a
Pipeline #23713 passed with stage
in 9 minutes and 32 seconds
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="kdenlive" version="185" translationDomain="kdenlive">
<kpartgui name="kdenlive" version="186" translationDomain="kdenlive">
<MenuBar>
<Menu name="file" >
<Action name="file_save"/>
......@@ -153,6 +153,7 @@
<Action name="switch_active_target" />
<Action name="switch_all_targets" />
<Action name="activate_all_targets" />
<Action name="restore_all_sources" />
</Menu>
<Separator />
<Menu name="video_effects_menu" ><text>Add Effect</text>
......
......@@ -1729,6 +1729,7 @@ void MainWindow::setupActions()
Qt::SHIFT + Qt::Key_A);
addAction(QStringLiteral("activate_all_targets"), i18n("Switch All Tracks Active"), pCore->projectManager(), SLOT(slotMakeAllTrackActive()), QIcon(),
Qt::SHIFT + Qt::ALT + Qt::Key_A);
addAction(QStringLiteral("restore_all_sources"), i18n("Restore Current Clip Target Tracks"), pCore->projectManager(), SLOT(slotRestoreTargetTracks()));
addAction(QStringLiteral("add_project_note"), i18n("Add Project Note"), pCore->projectManager(), SLOT(slotAddProjectNote()),
QIcon::fromTheme(QStringLiteral("bookmark-new")));
......
......@@ -804,6 +804,11 @@ void ProjectManager::slotMakeAllTrackActive()
pCore->window()->getMainTimeline()->controller()->makeAllTrackActive();
}
void ProjectManager::slotRestoreTargetTracks()
{
pCore->window()->getMainTimeline()->controller()->restoreTargetTracks();
}
void ProjectManager::slotSwitchAllTrackLock()
{
pCore->window()->getMainTimeline()->controller()->switchTrackLock(true);
......
......@@ -154,6 +154,8 @@ public slots:
void slotSwitchAllTrackActive();
/** @brief Make all tracks active or inactive */
void slotMakeAllTrackActive();
/** @brief Restore current clip target tracks */
void slotRestoreTargetTracks();
/** @brief Un/Set current track as target */
void slotSwitchTrackTarget();
......
......@@ -117,6 +117,11 @@ void TimelineController::setModel(std::shared_ptr<TimelineItemModel> model)
connect(m_model.get(), &TimelineModel::checkTrackDeletion, this, &TimelineController::checkTrackDeletion, Qt::DirectConnection);
}
void TimelineController::restoreTargetTracks()
{
setTargetTracks(m_hasVideoTarget, m_model->m_binAudioTargets);
}
void TimelineController::setTargetTracks(bool hasVideo, QMap <int, QString> audioTargets)
{
int videoTrack = -1;
......
......@@ -512,6 +512,8 @@ public:
void resetPreview();
/** @brief Set target tracks (video, audio) */
void setTargetTracks(bool hasVideo, QMap <int, QString> audioTargets);
/** @brief Restore Bin Clip original target tracks (video, audio) */
void restoreTargetTracks();
/** @brief Return asset's display name from it's id (effect or composition) */
Q_INVOKABLE const QString getAssetName(const QString &assetId, bool isTransition);
/** @brief Set keyboard grabbing on current selection */
......
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