This adds isNullOrEmpty string helper that cheks if string is... well
null or empty. It is done to improve readability of the code and better
express intent.
Implemented set shortcut in the group command's Setup function.
This change allows the group command icon to display the tool's shortcut,
but the shortcut appears only after the tool is selected once.
Uses new material system for appearance
Each feature object now has a property called ShapeMaterial that
describes its physical properties. If it has a shape, it has a
material.
The ShapeColor attribute is replaced by a ShapeAppearance attribute.
This is a material list that describes all appearance properties, not
just diffuse color. As a list in can be used for all elements of a
shape, such as edges and faces.
A new widget is provided to allow the user to select materials in a
consistent fashion. It can also launch the material editor with its
more advanced capabilities.
This is fix to issue mentioned in the #11717, on discord and forum that
for smart dimension tool the chosen tool should not be remembered. This
will ensure that the "smart" tool is always visible on the toolbar and
other tools are accessible in case that such explicit choice is needed.
This patch substitutes by isAttachedToDocument() (almost) everywhere where
getNameInDocument() is used for this purpose.
The very few places not touched by this patch demand a (just a little) less trivial change.
When we change the returning type of getNameInDocument() to std::string,
those places will be easily found, because they shall generate a compiler error
(converting std::string to bool).
Rationale:
The fact that getNameInDocument() return nullptr to indicate
that the object is not attached to a document is responsible for lots of bugs
where the developer does not check for "nullptr".
The idea is to eliminate all those uses of getNameInDocument() and, in the near future,
make getNameInDocument() return always a valid std::string.
Currently the GroupCommand by default sets the action group as non-exclusive, checkable and having a drop-down menu which isn't always the desired behaviour in sub-classes.
Thus, some new methods are added to let a sub-class in its constructor decide how it should behave.
Add API Command::initAction() to force create action for all commands
with shortcut in order to register with ShortcutManager to obtain a
complete list of actions with the same shortcut.
Support longest key sequence match with user defined delay (configurable
through 'Customize -> Keyboard -> Key sequence delay').
Support user defined priority to resolve shortcut conflict through
'Customize -> Keyboard')
Add 'All' category in 'Customize -> Keyboard' to list all command and
showing their shortcuts
Unify macro command shortcut setting (BaseApp/Preferences/Shortcut).
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto.
* When possible use a ranged for loop instead of begin() and end() iterators