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

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) ...@@ -649,6 +649,9 @@ void TimelineController::addTrack(int tid)
void TimelineController::deleteMultipleTracks(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); QPointer<TrackDialog> d = new TrackDialog(m_model, tid, qApp->activeWindow(), true,m_activeTrack);
if (tid == -1) { if (tid == -1) {
tid = m_activeTrack; tid = m_activeTrack;
...@@ -656,11 +659,17 @@ void TimelineController::deleteMultipleTracks(int tid) ...@@ -656,11 +659,17 @@ void TimelineController::deleteMultipleTracks(int tid)
if (d->exec() == QDialog::Accepted) { if (d->exec() == QDialog::Accepted) {
QList<int> allIds = d->toDeleteTrackIds(); QList<int> allIds = d->toDeleteTrackIds();
for (int selectedTrackIx : allIds) { for (int selectedTrackIx : allIds) {
m_model->requestTrackDeletion(selectedTrackIx); result = m_model->requestTrackDeletion(selectedTrackIx, undo, redo);
if (!result) {
break;
}
if (m_activeTrack == -1) { if (m_activeTrack == -1) {
setActiveTrack(m_model->getTrackIndexFromPosition(m_model->getTracksCount() - 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 @@ ...@@ -85,9 +85,6 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="1" colspan="2" alignment="Qt::AlignVCenter">
<widget class="QListWidget" name="deleteTracks"/>
</item>
<item row="2" column="0" colspan="4"> <item row="2" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
...@@ -136,6 +133,9 @@ ...@@ -136,6 +133,9 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="0" colspan="4">
<widget class="QListWidget" name="deleteTracks"/>
</item>
</layout> </layout>
</widget> </widget>
<customwidgets> <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