Skip to content

Commit

Permalink
Open demo graph only if no files specified on command line.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlyongemallo committed Nov 10, 2023
1 parent acc5506 commit 1d5f06a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions zxlive/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ def __init__(self) -> None:
parser.addVersionOption()
parser.addPositionalArgument("files", "File(s) to open.", "[files...]")
parser.process(self)
for f in parser.positionalArguments():
self.main_window.open_file_from_path(f)
if not parser.positionalArguments():
self.main_window.open_demo_graph()
else:
for f in parser.positionalArguments():
self.main_window.open_file_from_path(f)


def main() -> None:
Expand Down
1 change: 1 addition & 0 deletions zxlive/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def __init__(self) -> None:

self._reset_menus(False)

def open_demo_graph(self) -> None:
graph = construct_circuit()
self.new_graph(graph)

Expand Down

0 comments on commit 1d5f06a

Please sign in to comment.