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

Commit 9aed5d6d authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Add some feedback if an insert operation fails.

CCBUG: 413661
parent b93ac812
Pipeline #9818 passed with stage
in 13 minutes and 25 seconds
......@@ -123,17 +123,16 @@
<label>Default OpenGL backend.</label>
<default>0</default>
</entry>
<entry name="showEffectSearchBar" type="Bool">
<label>Show effect search bar by default.</label>
<default>true</default>
</entry>
<entry name="showCompoSearchBar" type="Bool">
<label>Show composition search bar by default.</label>
<default>true</default>
</entry>
</group>
......
......@@ -2485,6 +2485,7 @@ void MainWindow::slotInsertClipInsert()
const QString &binId = m_clipMonitor->activeClipId();
if (binId.isEmpty()) {
// No clip in monitor
pCore->displayMessage(i18n("No clip selected in project bin"), InformationMessage);
return;
}
int pos = getMainTimeline()->controller()->insertZone(binId, m_clipMonitor->getZoneInfo(), false);
......
......@@ -353,6 +353,7 @@ bool TimelineFunctions::insertZone(const std::shared_ptr<TimelineItemModel> &tim
}
}
if (affectedTracks.isEmpty()) {
pCore->displayMessage(i18n("Please activate a track by clicking on a track's label"), InformationMessage);
return false;
}
result = breakAffectedGroups(timeline, affectedTracks, QPoint(insertFrame, insertFrame + (zone.y() - zone.x())), undo, redo);
......
......@@ -1677,6 +1677,9 @@ void TimelineController::extractZone(QPoint zone, bool liftOnly)
}
++it;
}
if (tracks.isEmpty()) {
pCore->displayMessage(i18n("Please activate a track for this operation by clicking on its label"), InformationMessage);
}
if (m_zone == QPoint()) {
// Use current timeline position and clip zone length
zone.setY(timelinePosition() + zone.y() - zone.x());
......@@ -1740,6 +1743,7 @@ bool TimelineController::insertClipZone(const QString &binId, int tid, int posit
if (aTrack > -1) {
target_tracks << aTrack;
}
return TimelineFunctions::insertZone(m_model, target_tracks, binId, position, QPoint(in, out + 1), m_model->m_editMode == TimelineMode::OverwriteEdit, false);
}
......@@ -1782,6 +1786,10 @@ int TimelineController::insertZone(const QString &binId, QPoint zone, bool overw
if (aTrack > -1) {
target_tracks << aTrack;
}
if (target_tracks.isEmpty()) {
pCore->displayMessage(i18n("Please select a target track by clicking on a track's target zone"), InformationMessage);
return -1;
}
return TimelineFunctions::insertZone(m_model, target_tracks, binId, insertPoint, sourceZone, overwrite) ? insertPoint + (sourceZone.y() - sourceZone.x())
: -1;
}
......
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