Files
create/src/Mod/Draft/draftutils
Roy-043 6082a0844c Draft: close task panels on doc close
Related: #17952.

This PR introduces a document observer to close task panels on doc close.

For now it is for the Draft Workbench only. The BIM Workbench will be dealt with in a future PR.

The basic code is simple, but to make things works some additional things were addressed:
* gui_base.py: the GuiCommandBase class was enhanced to handle App.activeDraftCommand, self.doc, self.view and self.planetracker. Strictly speaking only the first 2 are required for this PR.
* gui_base.py: self.command_name was changed to self.featureName for compatibility with gui_base_original.py. Not required for this PR.
* gui_arcs.py, gui_circulararray.py, gui_polararray.py and gui_orthoarray.py: updated in relation to the GuiCommandBase class.
* gui_arcs.py Arc_3Points: The command now has a ui property and shows a plane tracker. Only the first is required for this PR.
* gui_shapestrings.py: This command had two ui attributes: self.ui and self.task. This was problematic. To fix this the base class of the command was changed from gui_base_original.Creator to gui_base.GuiCommandBase. As a result the getStrings method is no longer available meaning that the useSupport parameter is ignored when creating a ShapeString. But since that mechanism does not work properly anyway, I feel that this is acceptable. Should many user complain the functionality can of course be reintroduced.
2025-04-20 22:53:52 -05:00
..
2025-04-05 22:59:33 -05:00
2024-01-25 14:27:38 +01:00
2021-09-30 23:38:54 +02:00

2020 May

These files provide auxiliary functions used by the Draft workbench.

Previously most of these functions were defined in Draft.py, DraftTools.py, and DraftGui.py. However, due to being defined in these big modules, it was impossible to use them individually without importing the entire modules. So a decision was made to split the functions into smaller modules.

In here we want modules with generic functions that can be used everywhere in the workbench. We want these tools to depend only on standard Python modules and basic FreeCAD methods so that there are no circular dependencies, and so that they can be used by all functions and graphical commands in this workbench, and others if possible.

  • utils: basic functions
  • messages: used to print messages
  • translate: used to translate texts
  • init_tools: used to initialize the workbench (toolbars and menus)
  • todo: used to delay execution of certain graphical commands

Some auxiliary functions require that the graphical interface is loaded as they deal with scripted objects' view providers or the 3D view.

  • gui_utils: basic functions dealing with the graphical interface
  • init_draft_statusbar: functions to initialize the status bar

For more information see the thread: [Discussion] Splitting Draft tools into their own modules