Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Save timeline zone & disable it on project opening

parent 1e271eb8
......@@ -981,6 +981,7 @@ void MainWindow::setupActions()
ac->setActiveIcon(KoIconUtils::themedIcon(QStringLiteral("timeline-use-zone-on")));
ac->setInactiveIcon(KoIconUtils::themedIcon(QStringLiteral("timeline-use-zone-off")));
ac->setShortcut(Qt::Key_G);
KdenliveSettings::setUseTimelineZoneToEdit(false);
ac->setActive(KdenliveSettings::useTimelineZoneToEdit());
ac->setAutoToggle(true);
connect(ac, &KDualAction::activeChangedByUser, this, &MainWindow::slotSwitchTimelineZone);
......@@ -1225,12 +1226,6 @@ void MainWindow::setupActions()
addAction(QStringLiteral("project_clean"), i18n("Clean Project"), this, SLOT(slotCleanProject()), KoIconUtils::themedIcon(QStringLiteral("edit-clear")));
/*QAction *timelineZone = new QAction(KoIconUtils::themedIcon(QStringLiteral("insert-horizontal-rule")), i18n("Use Timeline Zone in Edit"), this);
timelineZone->setCheckable(true);
timelineZone->setChecked(KdenliveSettings::useTimelineZoneToEdit());
addAction(QStringLiteral("use_timeline_zone_in_edit"), timelineZone);
connect(timelineZone, &QAction::toggled, this, &MainWindow::slotSwitchTimelineZone);*/
// TODO
// addAction("project_adjust_profile", i18n("Adjust Profile to Current Clip"), pCore->bin(), SLOT(adjustProjectProfileToItem()));
......@@ -4126,6 +4121,11 @@ void MainWindow::slotSwitchTimelineZone(bool toggled)
{
KdenliveSettings::setUseTimelineZoneToEdit(toggled);
getCurrentTimeline()->controller()->useRulerChanged();
QAction *action = actionCollection()->action(QStringLiteral("use_timeline_zone_in_edit"));
if (action) {
QSignalBlocker blocker(action);
static_cast<KDualAction *>(action)->setActive(toggled);
}
}
#ifdef DEBUG_MAINW
......
......@@ -270,6 +270,8 @@ public slots:
void slotZoomIn(bool zoomOnMouse = false);
/** @brief Increases the timeline zoom level by 1. */
void slotZoomOut(bool zoomOnMouse = false);
/** @brief Enable or disable the use of timeline zone for edits. */
void slotSwitchTimelineZone(bool toggled);
private slots:
/** @brief Shows the shortcut dialog. */
......@@ -282,8 +284,6 @@ private slots:
void slotUpdateProjectDuration(int pos);
void slotAddEffect(const QDomElement &effect);
void slotEditProjectSettings();
void slotSwitchTimelineZone(bool toggled);
void slotSwitchMarkersComments();
void slotSwitchSnap();
void slotSwitchAutomaticTransition();
......
......@@ -825,6 +825,7 @@ void ProjectManager::updateTimeline(int pos)
stream << m_project->getProjectXml() << endl;
}*/
pCore->window()->getMainTimeline()->loading = true;
pCore->window()->slotSwitchTimelineZone(false);
QScopedPointer<Mlt::Producer> xmlProd(new Mlt::Producer(pCore->getCurrentProfile()->profile(), "xml-string", m_project->getProjectXml().constData()));
Mlt::Service s(*xmlProd);
Mlt::Tractor tractor(s);
......
......@@ -1183,6 +1183,8 @@ QMap<QString, QString> TimelineController::documentProperties()
props.insert(QStringLiteral("videoTarget"), QString::number(videoTarget));
props.insert(QStringLiteral("activeTrack"), QString::number(activeTrack));
props.insert(QStringLiteral("position"), QString::number(timelinePosition()));
props.insert(QStringLiteral("zonein"), QString::number(m_zone.x()));
props.insert(QStringLiteral("zoneout"), QString::number(m_zone.y()));
if (m_timelinePreview) {
QPair<QStringList, QStringList> chunks = m_timelinePreview->previewChunks();
props.insert(QStringLiteral("previewchunks"), chunks.first.join(QLatin1Char(',')));
......
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