BIM: close task panels on doc close

Fixes #17952.

This PR is a continuation of #20719.

It mainly involves adding `self.doc`. This new attribute is then also used in the rest of the modified classes. In some cases code was slightly reordered for consistency.

The `_finish_command_on_doc_close` function has been modifief to also handle `Gui.Snapper.ui.escape` and the code in gui_arcs.py has been updated accordingly.

Additionally:
Removed the `done` and `spacedone` variables in BimWall.py by tweaking the code.
This commit is contained in:
Roy-043
2025-04-30 10:17:13 +02:00
committed by Yorik van Havre
parent 8340737e86
commit 24e15ecb61
12 changed files with 138 additions and 106 deletions

View File

@@ -498,11 +498,10 @@ class Arc_3Points(gui_base.GuiCommandBase):
Gui.Snapper.getPoint(callback=self.getPoint,
movecallback=self.drawArc)
self.ui = Gui.Snapper.ui ## self must have a ui for _finish_command_on_doc_close in doc_observer.py.
self.ui.sourceCmd = self
self.ui.setTitle(title=translate("draft", "Arc by 3 points"),
icon="Draft_Arc_3Points")
self.ui.continueCmd.show()
Gui.Snapper.ui.sourceCmd = self
Gui.Snapper.ui.setTitle(title=translate("draft", "Arc by 3 points"),
icon="Draft_Arc_3Points")
Gui.Snapper.ui.continueCmd.show()
def getPoint(self, point, info):
"""Get the point by clicking on the 3D view.
@@ -543,11 +542,10 @@ class Arc_3Points(gui_base.GuiCommandBase):
Gui.Snapper.getPoint(last=self.points[-1],
callback=self.getPoint,
movecallback=self.drawArc)
self.ui = Gui.Snapper.ui
self.ui.sourceCmd = self
self.ui.setTitle(title=translate("draft", "Arc by 3 points"),
icon="Draft_Arc_3Points")
self.ui.continueCmd.show()
Gui.Snapper.ui.sourceCmd = self
Gui.Snapper.ui.setTitle(title=translate("draft", "Arc by 3 points"),
icon="Draft_Arc_3Points")
Gui.Snapper.ui.continueCmd.show()
else:
# If three points were already picked in the 3D view