Skip to content

Commit e7254f3

Browse files
authored
Group all 'add to timeline' updates in a single undo/redo transaction (#5145)
1 parent 921a56a commit e7254f3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/windows/add_to_timeline.py

+8
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"""
2828

2929
import os
30+
import uuid
3031
from operator import itemgetter
3132
from random import shuffle, randint, uniform
3233

@@ -152,6 +153,10 @@ def accept(self):
152153
""" Ok button clicked """
153154
log.info('accept')
154155

156+
# Transaction id to group all updates together
157+
tid = str(uuid.uuid4())
158+
get_app().updates.transaction_id = tid
159+
155160
# Get settings from form
156161
start_position = self.txtStartTime.value()
157162
track_num = self.cmbTrack.currentData()
@@ -376,6 +381,9 @@ def accept(self):
376381
# Increment position by length of clip
377382
position += (end_time - start_time)
378383

384+
# Clear transaction
385+
get_app().updates.transaction_id = None
386+
379387
# Accept dialog
380388
super(AddToTimeline, self).accept()
381389

0 commit comments

Comments
 (0)