Commit f97fff5b authored by Maxime Perrotin's avatar Maxime Perrotin

keep nested content of states in branches

parent 0231fbae
......@@ -6,7 +6,7 @@
SDL is the Specification and Description Language (Z100 standard from ITU)
Copyright (c) 2012-2018 European Space Agency
Copyright (c) 2012-2019 European Space Agency
Designed and implemented by Maxime Perrotin
......@@ -148,6 +148,13 @@ def paste(parent, scene):
each.double_click()
else:
new_symbols = paste_below_item(parent, scene)
def rec_double_click(next):
if next is not None:
next.double_click()
rec_double_click(next.next_aligned_symbol())
for each in new_symbols:
# Make sure nested scenes are set properly
rec_double_click(each)
if remove_after_paste:
# Remove from local clipboard if it came from system clipboard
......@@ -221,6 +228,7 @@ def paste_below_item(parent, scene):
symbols = []
for item_list, _ in COPY_PASTE:
states = [i for i in item_list if isinstance(i, ogAST.State)]
print [state.inputString for state in states]
for i in [c for c in item_list if not isinstance
(c, (ogAST.State, ogAST.TextArea, ogAST.Start))]:
LOG.debug('PASTE ' + str(i))
......
......@@ -6,7 +6,7 @@
SDL is the Specification and Description Language (Z100 standard from ITU)
Copyright (c) 2012-2013 European Space Agency
Copyright (c) 2012-2019 European Space Agency
Designed and implemented by Maxime Perrotin
......
......@@ -1736,7 +1736,7 @@ class SDL_View(QtGui.QGraphicsView, object):
QtGui.QMessageBox.about(self, 'About OpenGEODE',
'OpenGEODE - a tiny SDL editor for TASTE\n\n'
'Version {}\n\n'
'Copyright (c) 2012-2018 European Space Agency\n\n'
'Copyright (c) 2012-2019 Maxime Perrotin / European Space Agency\n\n'
'Contact: Maxime.Perrotin@esa.int\n\n'.format(__version__))
# pylint: disable=C0103
......
......@@ -78,7 +78,10 @@ class ReplaceText(QUndoCommand):
pass
else:
# scene was created with redo, delete reference
self.scene.composite_states.pop(self.new_text.lower())
try:
self.scene.composite_states.pop(self.new_text.lower())
except KeyError:
pass
def redo(self):
self.text.setPlainText(self.new_text)
......
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