Start restoring use timeline zone to edit

parent f9a2a14d
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="kdenlive" version="150" translationDomain="kdenlive">
<kpartgui name="kdenlive" version="151" translationDomain="kdenlive">
<MenuBar>
<Menu name="file" >
<Action name="dvd_wizard" />
......@@ -229,6 +229,7 @@
<Action name="timeline_compositing" />
<Action name="timeline_mode" />
<Separator />
<Action name="use_timeline_zone_in_edit" />
<Action name="select_tool" />
<Action name="razor_tool" />
<Action name="spacer_tool" />
......
......@@ -981,6 +981,9 @@ 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);
ac->setActive(KdenliveSettings::useTimelineZoneToEdit());
ac->setAutoToggle(true);
connect(ac, &KDualAction::activeChangedByUser, this, &MainWindow::slotSwitchTimelineZone);
addAction(QStringLiteral("use_timeline_zone_in_edit"), ac);
m_compositeAction = new KSelectAction(KoIconUtils::themedIcon(QStringLiteral("composite-track-off")), i18n("Track compositing"), this);
......@@ -1250,6 +1253,14 @@ void MainWindow::setupActions()
KoIconUtils::themedIcon(QStringLiteral("media-record")));
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()));
......@@ -4185,6 +4196,12 @@ void MainWindow::slotChangeSpeed(int speed)
}
}
void MainWindow::slotSwitchTimelineZone(bool toggled)
{
KdenliveSettings::setUseTimelineZoneToEdit(toggled);
getCurrentTimeline()->controller()->useRulerChanged();
}
#ifdef DEBUG_MAINW
#undef DEBUG_MAINW
#endif
......@@ -286,6 +286,7 @@ private slots:
/** @brief Turns automatic splitting of audio and video on/off. */
void slotSwitchSplitAudio(bool enable);
void slotSwitchTimelineZone(bool toggled);
void slotSwitchMarkersComments();
void slotSwitchSnap();
void slotSwitchAutomaticTransition();
......
......@@ -190,7 +190,7 @@ bool TimelineFunctions::insertZone(std::shared_ptr<TimelineItemModel> timeline,
result = TimelineFunctions::insertSpace(timeline, trackId, QPoint(insertFrame, insertFrame + (zone.y() - zone.x())), undo, redo);
}
int newId = -1;
QString binClipId = QString("%1#%2#%3").arg(binId).arg(zone.x()).arg(zone.y() - 1);
QString binClipId = QString("%1/%2/%3").arg(binId).arg(zone.x()).arg(zone.y() - 1);
timeline->requestClipInsertion(binClipId, trackId, insertFrame, newId, true, true, undo, redo);
pCore->pushUndo(undo, redo, overwrite ? i18n("Overwrite zone") : i18n("Insert zone"));
return result;
......
......@@ -29,6 +29,7 @@ Rectangle {
property real fontUnit: root.baseUnit * 0.9
property alias rulerZone : zone
property int workingPreview : timeline.workingPreview
property bool useTimelineRuler : timeline.useRuler
SystemPalette { id: activePalette }
function adjustStepSize() {
......@@ -119,7 +120,7 @@ Rectangle {
width: (timeline.zoneOut - timeline.zoneIn) * rulerRoot.timeScale
anchors.bottom: parent.bottom
height: parent.height / 3
opacity: 0.4
opacity: useTimelineRuler ? 0.4 : 0.1
Rectangle {
id: trimIn
anchors.left: parent.left
......
......@@ -1134,6 +1134,11 @@ int TimelineController::workingPreview() const
return m_timelinePreview ? m_timelinePreview->workingPreview : -1;
}
bool TimelineController::useRuler() const
{
return KdenliveSettings::useTimelineZoneToEdit();
}
void TimelineController::loadPreview(QString chunks, QString dirty, const QDateTime &documentDate, int enable)
{
if (chunks.isEmpty() && dirty.isEmpty()) {
......@@ -1342,6 +1347,10 @@ bool TimelineController::insertZone(const QString &binId, QPoint zone, bool over
if (targetTrack == -1) {
targetTrack = m_activeTrack;
}
qDebug()<<" // / /INSERTING BIN CLIP: "<<binId;
if (KdenliveSettings::useTimelineZoneToEdit()) {
return TimelineFunctions::insertZone(m_model, targetTrack, binId, m_zone.x(), QPoint(zone.x(), zone.x() + m_zone.y() - m_zone.x()), overwrite);
}
return TimelineFunctions::insertZone(m_model, targetTrack, binId, timelinePosition(), zone, overwrite);
}
......
......@@ -57,6 +57,7 @@ class TimelineController : public QObject
Q_PROPERTY(QVariantList dirtyChunks READ dirtyChunks NOTIFY dirtyChunksChanged)
Q_PROPERTY(QVariantList renderedChunks READ renderedChunks NOTIFY renderedChunksChanged)
Q_PROPERTY(int workingPreview READ workingPreview NOTIFY workingPreviewChanged)
Q_PROPERTY(bool useRuler READ useRuler NOTIFY useRulerChanged)
Q_PROPERTY(int activeTrack READ activeTrack WRITE setActiveTrack NOTIFY activeTrackChanged)
Q_PROPERTY(int audioTarget READ audioTarget WRITE setAudioTarget NOTIFY audioTargetChanged)
Q_PROPERTY(int videoTarget READ videoTarget WRITE setVideoTarget NOTIFY videoTargetChanged)
......@@ -298,6 +299,7 @@ public:
/* @brief returns the frame currently processed by timeline preview, -1 if none
*/
int workingPreview() const;
bool useRuler() const;
/* @brief Load timeline preview from saved doc
*/
void loadPreview(QString chunks, QString dirty, const QDateTime &documentDate, int enable);
......@@ -394,6 +396,7 @@ signals:
void dirtyChunksChanged();
void renderedChunksChanged();
void workingPreviewChanged();
void useRulerChanged();
};
#endif
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