Skip to content

Activity diagram: opening one path

[[[activity-open-document]]]

The same flow as sequence-open-document.md, reframed around its decision points rather than which object calls which. The fork/join reflects DocumentWidget.__init__ (document_widget.py:38-40): the viewer and editor forms are both built, from the same RehuDocumentModel, regardless of which dock ends up visible. Traces the same [[plugins#dock-shell]] flow described in prose.

receive a path to openforward path to the primaryover the local socketexit process (return 0)nothis process is the single-instance primary?yesMainWindow.open_file(path)a dock is already open for this path?yesnofocus the existing dockRehuDocument.load(path)new RehuDocumentModel(document)build viewer form (read-only)build editor form (writes back through the model)wrap both in a new DocumentWidgetadd its dock to DocumentsDock's CDockManager, focus itraise_and_activate() the MainWindow
receive a path to openforward path to the primaryover the local socketexit process (return 0)nothis process is the single-instance primary?yesMainWindow.open_file(path)a dock is already open for this path?yesnofocus the existing dockRehuDocument.load(path)new RehuDocumentModel(document)build viewer form (read-only)build editor form (writes back through the model)wrap both in a new DocumentWidgetadd its dock to DocumentsDock's CDockManager, focus itraise_and_activate() the MainWindow