========================================================================
The NotificationBox is extended to take the QRect in global coordinates. Then
it will try to dimension the label within this area. If a fixed width is provided, that
is enforced (take precedence).
The NotificationArea passes the QRect of the main window to the NotificationBox.
This is intended to fix:
https://github.com/FreeCAD/FreeCAD/issues/8940
Due to a flaw in the QUiLoader, UiLoader were loading all designer plugins
it can find in QApplication::libraryPaths(). This in general a bad
practice and leads to bugs due to some plugins may perform some unexpected
actions upon load which may interfere with FreeCAD's functionality.
To avoid such problems reset the libraryPaths before creation of a
UiLoader object.
Also move setLanguageChangeEnabled(true) into constructor due to it's
called every time it's being instanced anyway.
See: https://github.com/FreeCAD/FreeCAD/issues/8708
===============================================================
For translated notifications now the caption is included in the
message, as the translation is already done, and this improves
the semantics of existing messages.
========================================================================================
Functions to transparently send errors, warnings, notifications and translatednotifications, either
as intrusive messages (modal pop-up QMessageBox style) or as non-intrusive messages (notificationarea),
depending on the preferences of the user.
It is intended to substitute calls to QMessageBox with these functions in WBs, including the Sketcher WB.
Example:
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Cannot add a constraint between two external geometries."));
Can be rewritten as:
Gui::TranslatedNotification(obj,
QObject::tr("Wrong selection"),
QObject::tr("Cannot add a constraint between two external geometries."));
or
Gui::TranslatedNotification("Sketcher",
QObject::tr("Wrong selection"),
QObject::tr("Cannot add a constraint between two external geometries."));
where the first parameter (obj or "Sketcher") is the notifier string. If obj is an App::DocumentObject
(or a derived class of it), internally the function transparently calls getFullLabel() to get the notifier
string.
===========================================================================
The former system of autoclosing messageboxes is removed in favour of the Notification Area.
========================================
Parameter "NotificationAreaEnabled" can be used to completely disable the Notification Area.
If disabled it won't appear on the UI at all and no non-intrusive notification will be generated.
======================
A notification area consisting of one area for non-intrusive notifications, and a widget showing previous
errors, warnings, critical messages and notifications.
Notifications being marked with QT_TRANSLATION_NOOP with context "Notifications" are translated.
Messages are shown during a minimum show time, unless pop up (clicked inside). Messages stay until
a maximum show time. Between the minimum and the maximum show times left mouse button events make
the non-intrusive notification disappear.
The widget stores a configurable amount of messages after which old messages are removed to make room for
new ones.
Unread messages are shown in bold.
======================
QToolTip removed the Windows specific behaviour of passing a screen widget as parent for QLabel
in 44fb925f50471ebc23dcccfaa4e9d9873b05d205. NotificationBox code is simplified not to use a
parent widget at all.
A inappropriate review fix actually causing a bug is fixed.
https://github.com/FreeCAD/FreeCAD/pull/8352#discussion_r1111342024