Commit c92da259 authored by Pushkar Kukde's avatar Pushkar Kukde Committed by Jean-Baptiste Mardelle

Fixed ui dsiplay box and undo redo stack

parent 970df391
Pipeline #38528 passed with stage
in 35 minutes and 10 seconds
......@@ -649,6 +649,9 @@ void TimelineController::addTrack(int tid)
void TimelineController::deleteMultipleTracks(int tid)
{
Fun undo = []() { return true; };
Fun redo = []() { return true; };
bool result = true;
QPointer<TrackDialog> d = new TrackDialog(m_model, tid, qApp->activeWindow(), true,m_activeTrack);
if (tid == -1) {
tid = m_activeTrack;
......@@ -656,11 +659,17 @@ void TimelineController::deleteMultipleTracks(int tid)
if (d->exec() == QDialog::Accepted) {
QList<int> allIds = d->toDeleteTrackIds();
for (int selectedTrackIx : allIds) {
m_model->requestTrackDeletion(selectedTrackIx);
result = m_model->requestTrackDeletion(selectedTrackIx, undo, redo);
if (!result) {
break;
}
if (m_activeTrack == -1) {
setActiveTrack(m_model->getTrackIndexFromPosition(m_model->getTracksCount() - 1));
}
}
if (result) {
pCore->pushUndo(undo, redo, allIds.count() > 1 ? i18n("Delete Tracks") : i18n("Delete Track"));
}
}
}
......
......@@ -85,9 +85,6 @@
</property>
</spacer>
</item>
<item row="1" column="1" colspan="2" alignment="Qt::AlignVCenter">
<widget class="QListWidget" name="deleteTracks"/>
</item>
<item row="2" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
......@@ -136,6 +133,9 @@
</item>
</layout>
</item>
<item row="1" column="0" colspan="4">
<widget class="QListWidget" name="deleteTracks"/>
</item>
</layout>
</widget>
<customwidgets>
......
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