* MeasureGui: Store measure type in TaskMeasure
* MeasureGui: Avoid adding measurement to document during command interaction
* [Gui] Add check for document in VPDocumentObject::getActiveView
* MeasureGui: Track the document when adding objects
* MeasureGui: Cleanup python measurement creation
* [Gui] Add isAnnotationViewProvider method
* [Gui] Check if viewprovider is added as an annotation in getActiveView
* [Gui] Add takeAnnotationViewprovider method to Gui::Document
* [Gui] Make addViewProvider public
* [MeasureGui] Add existing view provider to document when storing measurement
* [MeasureGui] Fix invocation of initial label placement
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.
* Add unit system to Project Information and store with document.
* Remove the project unit system
* Restore correct document activation signalling to fix test fail
* Remove commented out dead lines
* Restore ignore option for project unit schemas
* Whitespace fix
* Refresh after changing units
* Remove field label
* Property editor changes applied to unit system
===========================================================================
The former system of autoclosing messageboxes is removed in favour of the Notification Area.
==============================
This commit provides specific behaviour on how to handle user messages signalled by App::Document for the different types of notifications.
For critical messages DURING a user initiated restore (i.e. only if the user clicked in the UI, not applicable for macros or Python initiated):
- The first critical message during restore requires user confirmation by clicking a button in a modal dialog box. The user has the choice to
request to be asked for confirmation for any subsequent critical message during restore or to forgo confirmation.
- If he chooses to forgo confirmation, subsequent critical messages are shown as auto-closing non-modal dialogs in a non-intrusive way. The user
can continue working while this information is shown. There is a maximum of auto-closing non-modal dialgos that can be enqueued. Over this maximum,
A warning pop up indicates this situation, referring to the Report View. No further auto-closing messages are enqueued until all existing messages
have disappeared. This is done to prevent overwhelming the user with notifications in cases where malfunction causes too many notifications to be
generated.
For any type of message OUTSIDE a user initiated restore:
- Messages are shown as non-intrusive non-modal auto-closing messages (it is not possible to generate modal/blocking messages outside a user
initiated restore).
- Messages are enqueued respecting a limit as above.
* 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
* Use multi-arg instead [-Wclazy-qstring-arg]
* Use an empty QLatin1String instead of an empty QStringLiteral [-Wclazy-empty-qstringliteral]
* getter Gui::ProgressBar::canAbort possibly mismarked as a slot [-Wclazy-const-signal-or-slot]
* Missing emit keyword on signal call [-Wclazy-incorrect-emit]