The functions `getDefaultUnit`, `makeFormatSpec`, `displayExternal`
are used to get the default unit schema for lengths and angles,
and display a string with a particular format.
They aren't used in `DraftGui.py`, but are used by the
viewprovider of the Dimension objects. Therefore, they are moved
into a separate module, so that they can be imported without
using the entire `DraftGui` module.
Changed snap toolbar behaviour:
- create a list of available snaps (Gui.Snapper.snaps)
- make it consistent with Snap Gui Commands (in gui_snaps module)
- create a list of active snaps (Gui.Snapper.active_snaps)
- refactor the isEnabled() method to allow it to check if the given snap is in Gui.Snapper.active_snaps and not if the snap toolbar button isChecked()
- updated and reordered the new list of gui snap commands in draftutils.init_tools and used it as a base to refactor the creation of draft toolbar
- updated all the draft snap gui tools to make them control the toolbar buttons directly
.
.
.
And do not load the `Snapper` in `DraftGui`.
The Snapper should be initialized by the module
that imports `DraftGui`, most probably `DraftTools`
or even by the `InitGui` of the workbench.
Single returnPressed to accept point if cursor is parallel to xyz axis for bot setfocus on x and on length inputfields.
[Draft] Edit_updated tooltip
[Draft] DraftGui Further cleanup and bugfix
The `Taskview` mode (value 1) is set fixed in `DraftGui.py`
even if the widget shows the other value `Toolbar` (value 0),
as this mode is unmaintained and obsolete.
At the same time, clarify the behavior with a new tooltip.
The translate mechanism in Draft depends on the `QtCore`
`translate` function. This is defined in its own module
so that `DraftGui.py` is not as big and hard to manage.
Other modules in Draft can import the translate function
without needing to import the entire interface, which
often causes errors and circular dependencies.
We can import `QtCore.QT_TRANSLATE_NOOP` at the top level
in `Draft.py` because it does not depend on the graphical
interface.
Many auxiliary tools used by `Draft.py` can be defined
in another module. Many functions are moved to this module
so that `Draft.py` isn't as big and hard to maintain.
The following is a list of functions and attributes that were moved:
`stringencodecoin`, `arrowtypes`, `typecheck`,
`getParamType`, `getParam`, `setParam`, `precision`,
`tolerance`, `epsilon`, `getRealName`, `getType`,
`getObjectsOfType`, `isClone`, `getGroupNames`,
`ungroup`, `shapify`, `getGroupContents`,
`printShape`, `compareObjects`, `loadSvgPatterns`,
`svgpatterns`, `getMovableChildren`, `getWindows`,
`utf8_decode`.
Moreover, many of these functions were renamed
to comply better with PEP8 guidelines, particularly
the use of `snake_case`. For example, `getGroupNames`
is now `get_group_names`; `getMovableChildren`
is now `get_movable_children`.
Aliases are provided for the old names so that
other functions and classes that depend on these
won't break. The new names should be the official
programming interface, while the old names
should be deprecated at some point in the future.
....Users to view Font Files without the need to modify permissions on the Fonts folder. Also keeping the rest of FreeCAD file dialog boxes as standard.