Commit fa8808fe authored by Thibault Saunier's avatar Thibault Saunier

timeline: Reindent some code

Making it simpler to read
Reviewed-by: Alexandru Băluț's avatarAlex Băluț <alexandru.balut@gmail.com>
Differential Revision: https://phabricator.freedesktop.org/D623
parent 1a475da3
......@@ -1551,44 +1551,48 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
self.timeline.selection.setSelection([], SELECT)
def _ungroupSelected(self, unused_action, unused_parameter):
if self.bTimeline:
self.app.action_log.begin("ungroup")
if not self.bTimeline:
self.info("No bTimeline set yet!")
return
for obj in self.timeline.selection:
toplevel = obj.get_toplevel_parent()
if toplevel == self.timeline.current_group:
for child in toplevel.get_children(False):
child.ungroup(False)
else:
toplevel.ungroup(False)
self.app.action_log.begin("ungroup")
self.timeline.resetSelectionGroup()
for obj in self.timeline.selection:
toplevel = obj.get_toplevel_parent()
if toplevel == self.timeline.current_group:
for child in toplevel.get_children(False):
child.ungroup(False)
else:
toplevel.ungroup(False)
self.app.action_log.commit()
self._project.pipeline.commit_timeline()
self.timeline.resetSelectionGroup()
def _groupSelected(self, unused_action, unused_parameter):
if self.bTimeline:
self.app.action_log.begin("group")
self.app.action_log.commit()
self._project.pipeline.commit_timeline()
containers = set({})
def _groupSelected(self, unused_action, unused_parameter):
if not self.bTimeline:
self.error("No timeline set yet?")
return
for obj in self.timeline.selection:
toplevel = obj.get_toplevel_parent()
if toplevel == self.timeline.current_group:
for child in toplevel.get_children(False):
containers.add(child)
toplevel.ungroup(False)
else:
containers.add(toplevel)
self.app.action_log.begin("group")
containers = set({})
for obj in self.timeline.selection:
toplevel = obj.get_toplevel_parent()
if toplevel == self.timeline.current_group:
for child in toplevel.get_children(False):
containers.add(child)
toplevel.ungroup(False)
else:
containers.add(toplevel)
if containers:
GES.Container.group(list(containers))
if containers:
GES.Container.group(list(containers))
self.timeline.resetSelectionGroup()
self.timeline.resetSelectionGroup()
self._project.pipeline.commit_timeline()
self.app.action_log.commit()
self._project.pipeline.commit_timeline()
self.app.action_log.commit()
def __copyClipsCb(self, unused_action, unused_parameter):
if self.timeline.current_group:
......
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