Commit Graph

26 Commits

Author SHA1 Message Date
Johannes Wüller
0e24e121eb Fix backwards-compatible Qt6 warnings 2024-05-13 11:39:24 -05:00
Chris Hennes
918bcb7f5b Gui: Remove trailing spaces from translations 2024-03-12 22:42:19 -05:00
Abdullah Tahiri
05585a6e73 NotificationArea: Fix Lints 2023-12-09 11:06:04 +01:00
Abdullah Tahiri
719986c62a Notification Area: Group same message under a single line
=========================================================

issue #11183

Feature request.

Instead of repeating over and over again the same message, indicate the number of consecutive repetitions in a single message.
2023-12-09 11:06:04 +01:00
wmayer
8f08d8c7cd Lint: fix several issues discovered by clazy 2023-08-18 08:44:49 -05:00
wmayer
54bb9c9c62 Gui: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
wmayer
d150fa7164 modernize C++: avoid bind
In many cases std::bind() is kept because the code is much simpler
2023-08-08 21:10:16 +02:00
wmayer
68d22d864b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
wmayer
e72da4d4c4 Gui: modernize C++: use override 2023-08-04 17:09:53 +02:00
Abdullah Tahiri
12a7f3b236 NotificationArea/Preferences: Allow Opt-in for Developer warnings and errors
============================================================================

The old preferences had errors and warnings ON by default and allowed to opt-out.
It was not possible to separate errors/warnings intended for users from those intended for developers.

The new version has developer errors and warnings OFF by default. User intended ones are ON.
It is possible to opt-in for developer errors and warnings from the preferences dialog.

As developer errors and warnings are NOT translated, if opting-in, they won't be localised.

User errors and warnings should be translated. If they are not, it is a bug.
2023-05-23 14:24:45 +02:00
Abdullah Tahiri
cc13da5470 Console: Remove Translated Notification message
===============================================

With the new console extension, the translation state is coded separatedly.

Therefore, it is possible to code a Notification as translated without needing a specific type.

Additionally, any other message, such as Error of Warning can be translated.

It does not make sense to leave this message, if only for reasons of coherence and to simplify
maintainance of code.
2023-05-23 14:24:45 +02:00
Abdullah Tahiri
98f3163a7a App: NotificationArea adaptation to the new messages 2023-05-23 14:24:45 +02:00
Abdullah Tahiri
e3702ac2d8 Console: Extend framework with intended recipient and content type metainformation
==================================================================================

Limitations of the current framework:
- Codes the translated state only for TranslatedNotification as part of the type.
- Does not code the intended recipient (user, developer, ...)

Problems:
- Some errors are intended for developers, some errors may only be intended for users,
if, for example, there is another developer error which already contains all the information.
The current framework may lead to information duplication or to showing to the user developer
information, which is perceived as annoying.
- Logs shall be in English (report view), while every message to the user (UI) shall be translated.
The current framework can only differentiate where to report based on subscription (legacy logs do not
subscribe to notifications), and for notifications, whether it is translated or not depends on the type.
It is not possible to code errors or warnings that are already translated.

Solution:
- To extend the ILogger interface with additional metainformation, indicating the intended recipient
(User, Developer, All), and the content of the message (translated, untranslated, untranslatable). The latter
is useful for dynamic strings that won't find a match in the translation framework.

Bonus:
- This extended version allows to do away with translatednotification, as now any message can be independently
marked as translated or untranslated or untraslatable.
- It is now possible to provide the right icon of severity (error, warning, info), even when it is only user intended
and already translated.
2023-05-23 14:24:45 +02:00
Abdullah Tahiri
da76caa13e NotificationArea: Correct painting position
===========================================

QT has a open bug regarding filling the contents of a QMenu in aboutShow:
https://bugreports.qt.io/browse/QTBUG-54421

This commit presents a work-around this bug.

The two step procedure of this commit, forces a recalculation of the size
from the slot and then manually moves the widget to the right position.
2023-03-26 20:26:20 +02:00
Abdullah Tahiri
ddd9a97211 NotificationArea: subscription to errors and warnings
=====================================================

Subscription to errors and warnings is controlled by parameters.
2023-03-26 11:33:57 +02:00
Abdullah Tahiri
26e48cb63a NotificationArea: Clang format 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
23739bc2d0 NotificationArea: Change Icon color to indicate missed notifications 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
83eca46308 NotificationArea: Parameters to control inactive notification show behaviour 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
76892d918d NotificationBox: Convert options to enum class 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
49966ac84d NotificationBox: Add option to hide notification if reference widget is deactivated 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
f0883512d5 NotificationBox: Enable options to not show if reference widget is not active and refactor restricttoarea 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
37eeccf705 NotificationBox/NotificationArea: Restrict rendering area to main frame
========================================================================

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
2023-03-20 15:43:42 +01:00
Abdullah Tahiri
f00e6d93dc NotificationArea: Convert plain text to HTML to perserve format 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
2de5076b74 NotificationArea: Use fixed size notifications 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
6376250ea7 NotificationArea: Allow wrapping of message text to avoid rendering issues with long messages 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
60cb06e20c Gui: Notification Area
======================

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.
2023-03-12 06:06:29 +01:00