Commit Graph

16 Commits

Author SHA1 Message Date
Max Wilfinger
a9cd5a4982 Draft: Update UI strings for consistency (#22331)
* Draft: Update UI strings for consistency

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Apply suggestions from code review

---------

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2025-08-06 23:02:16 +02:00
Roy-043
98d4222253 Draft: Revise close task panels on doc close solution (#21546)
Use built-in feature to close the task panels. See #21253.
2025-05-24 10:25:40 +02:00
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
Roy-043
0ae35d6bab Include other Draft commands 2024-11-30 16:48:41 +01:00
Roy-043
ca1a10585a Draft: fix wrong selection after commands (improved)
The previous fix was not correct. Some commands would cause a crash and several files were missed.

Forum topic reporting a crash:
https://forum.freecad.org/viewtopic.php?t=85243
2024-02-16 10:56:10 +01:00
Yorik van Havre
b1bcfec271 Draft: Added a preference to turn on/off tool messages (off by default) - fixes #7078 2023-11-23 16:27:36 +01:00
Roy-043
ee872dbc76 Draft: Escape should not switch off continue mode 2022-10-15 12:14:51 +02:00
Roy
93a41d2941 Draft: Fix translation issues 2022-01-10 10:17:53 +01:00
Yorik van Havre
43feb585ad Draft: Fixed broken translations everywhere 2021-02-12 14:44:58 +01:00
vocx-fc
e3da572072 Draft: add modules of draftguitools to the proper Doxygen group
This includes `gui_annotationstyleeditor`, `gui_arcs`, `gui_array_simple`,
`gui_arrays`, `gui_base`, `gui_base_original`, `gui_beziers`,
`gui_circles`, `gui_circulararray`, `gui_clone`, `gui_circulararray`,
`gui_clone`, `gui_dimension_ops`, `gui_dimensions`, `gui_downgrade`,
`gui_draft2sketch`, `gui_drawing`, `gui_edit`, `gui_edit_arch_objects`,
`gui_edit_draft_objects`, `gui_edit_part_objects`, `gui_edit_sketcher_objects`,
`gui_ellipses`, `gui_facebinders`, `gui_fillets`, `gui_grid`,
`gui_groups`, `gui_heal`, `gui_join`, `gui_labels`, `gui_line_add_delete`,
`gui_lineops`, `gui_lines`, `gui_lineslope`, `gui_mirror`,
`gui_move`, `gui_offset`, `gui_orthoarray`, `gui_patharray`,
`gui_planeproxy`, `gui_pointarray`, `gui_points`, `gui_polararray`,
`gui_polygons`, `gui_rectangles`, `gui_rotate`, `gui_scale`,
`gui_selectplane`, `gui_shape2dview`, `gui_shapestrings`, `gui_snapper`,
`gui_snaps`, `gui_splines`, `gui_split`, `gui_stretch`, `gui_styles`,
`gui_subeleemnts`, `gui_texts`, `gui_togglemodes`, `gui_tools_utils`,
`gui_trackers`, `gui_trimex`, `gui_upgrade`, `gui_wire2spline`.

These are added to the `draftguitools` Doxygen group
so that the functions and classes contained in each module
are listed appropriately in the automatically generated
documentation.
2020-07-17 13:01:45 +02:00
vocx-fc
66959b2688 Draft: clean up CircularArray code
Avoid `Draft.py` in the `make_circular_array` function because
it creates a circular dependency.

Use function to find the object in `make_circular_array`.

Now the make function accepts as input a `"String"` which must be
the `Label` of an object in the document, so it is easier to create
arrays interactively from the Python console.

Clean up the GuiCommand and task panel code, and avoid printing
messages to the terminal, as this is already done
by the make function.
2020-06-03 14:46:15 +02:00
vocx-fc
cc75bf91d7 Draft: change super() so it is compatible with Python 2
In Python 3 `super()` can be used without an argument
in order to get the parent class, `super()`.
In Python 2 the present class must be used as an argument,
`super(ThisClass, self)`.

This commit is done to support Python 2,
as without it all Gui Command tools will be broken
and will fail to launch, even if the unit tests pass.

Also, set the `__metaclass__` variable to `type`.
This is done to turn all classes into "new style" classes
in Python 2. This is required so `super()` works correctly
in this version of Pyton.

This commit can be reverted once Python 2 support
is completely dropped, and only Python 3 compatible code
is used.
2020-04-27 11:05:51 +02:00
vocx-fc
dc2c103fe6 Draft: rename Circular, Ortho, and Polar arrays
The internal GuiCommand classes are renamed to `CircularArray`,
`OrthoArray`, and `PolarArray`. This is a shorter name than the
previous `GuiCommandCircularArray`, `GuiCommandOrthoArray`,
and `GuiCommandPolarArray`.

These classes are not part of the scripting interface of Draft
so we don't risk breaking previous files.
2020-04-24 13:49:13 +02:00
vocx-fc
13cc36e73d Draft: gui_ and task_circulararray cleanup 2020-04-10 13:19:22 +02:00
vocx-fc
dd9b694422 Draft: gui_circulararray cleanup
Small spacing fixes like imports in separate lines
for more clarity, the module docstring,
and the position of the license.

Remove unnecessary check for the graphical interface
as this command should be imported when the interface
is already up and running.

Use proper `ToDo` class instead of importing `DraftGui`.
2020-04-07 18:12:06 +02:00
vocx-fc
5143369fc9 Draft: add new command for Draft CircularArray
Added object, viewprovider, icon; gui command definition, task panel,
add command to InitGui; add callbacks, and delay system.
2020-01-08 15:16:07 +01:00