Commit 8796b4f9 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Delete all selected markers in clip properties dialog when requested.

Related to #660
parent 6d2db4bb
......@@ -77,7 +77,6 @@ public:
/* @brief Delete all the markers of the model */
bool removeAllMarkers();
protected:
/* @brief Same function but accumulates undo/redo */
bool removeMarker(GenTime pos, Fun &undo, Fun &redo);
......
......@@ -1099,10 +1099,22 @@ void ClipPropertiesController::slotEditMarker()
void ClipPropertiesController::slotDeleteMarker()
{
auto markerModel = m_controller->getMarkerModel();
auto current = m_markerTree->currentIndex();
if (!current.isValid()) return;
GenTime pos(markerModel->data(current, MarkerListModel::PosRole).toDouble());
markerModel->removeMarker(pos);
QModelIndexList indexes = m_markerTree->selectionModel()->selectedIndexes();
QList <GenTime> positions;
for (auto &ix : indexes) {
if (ix.isValid()) {
positions << GenTime(markerModel->data(ix, MarkerListModel::PosRole).toDouble());
}
}
if (!positions.isEmpty()) {
Fun undo = []() { return true; };
Fun redo = []() { return true; };
for (GenTime pos : positions) {
markerModel->removeMarker(pos, undo, redo);
}
pCore->pushUndo(undo, redo, i18n("Delete marker"));
}
}
void ClipPropertiesController::slotAddMarker()
......
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