Skip to content
Snippets Groups Projects
Commit 312e261e authored by Oscar Gustafsson's avatar Oscar Gustafsson :bicyclist:
Browse files

Better SFG editing (return SFG dict)

parent 03beee18
Branches
No related tags found
1 merge request!302Better SFG editing (return SFG dict)
Pipeline #95283 passed
......@@ -803,13 +803,14 @@ class SFGMainWindow(QMainWindow):
self._keybindings_page.show()
def start_editor(sfg: Optional[SFG] = None):
def start_editor(sfg: Optional[SFG] = None) -> Dict[str, SFG]:
app = QApplication(sys.argv)
window = SFGMainWindow()
if sfg:
window._load_sfg(sfg)
window.show()
sys.exit(app.exec_())
app.exec_()
return window._sfg_dict
if __name__ == "__main__":
......
......@@ -1468,11 +1468,11 @@ class SFG(AbstractOperation):
"""
raise NotImplementedError()
def edit(self) -> None:
def edit(self) -> Dict[str, "SFG"]:
"""Edit SFG in GUI."""
from b_asic.GUI.main_window import start_editor
start_editor(self)
return start_editor(self)
def unfold(self, factor: int) -> "SFG":
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment