Commit Graph

29 Commits

Author SHA1 Message Date
bofdahof
ba2c2ca5ad Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Benjamin Bræstrup Sayoc
8d2d0a47f4 Gui: Use QStringLiteral 2025-02-10 18:34:57 +01:00
Tobias Frost
460da406f8 spelling fixes (#18688)
* Fixes spelling of "Allow to" to "Allow one to"

and those variants:
Allows to -> Allows one to
allow to -> allow one to
allows to -> allows one to

* Fix "Let's -> Lets"

(and lower case variant.)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update src/3rdParty/salomesmesh/inc/MED_Wrapper.hxx

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Base/PyObjectBase.cpp
Update src/App/ExtensionContainer.h
Update src/App/PropertyContainer.h

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Use gerund in user-facing texts.

* Use gerund for two more user-facing strings.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

---------

Co-authored-by: Tobias Frost <tobi@debian.org>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-01-13 11:22:20 -06:00
Johannes Wüller
33e91421b5 Fix backwards-compatible Qt6 warnings 2024-05-13 11:39:24 -05:00
Chris Hennes
9bf772ca67 Gui: Remove trailing spaces from translations 2024-03-12 22:42:19 -05:00
Abdullah Tahiri
56377cd09e NotificationArea: Fix Lints 2023-12-09 11:06:04 +01:00
Abdullah Tahiri
a63540e845 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
ff1981fcdc Lint: fix several issues discovered by clazy 2023-08-18 08:44:49 -05:00
wmayer
fa8978ce99 Gui: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
wmayer
948cbfccd9 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
52e1c7c33b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
wmayer
4d4267481f Gui: modernize C++: use override 2023-08-04 17:09:53 +02:00
Abdullah Tahiri
28b7176691 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
5e5d863968 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
3097892d08 App: NotificationArea adaptation to the new messages 2023-05-23 14:24:45 +02:00
Abdullah Tahiri
9d9f928b2d 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
77799d5ec4 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
8608c6a845 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
36a35c6c37 NotificationArea: Clang format 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
f0077e5f8a NotificationArea: Change Icon color to indicate missed notifications 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
c5710055b5 NotificationArea: Parameters to control inactive notification show behaviour 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
6e3bdd8f2a NotificationBox: Convert options to enum class 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
1e3b728f35 NotificationBox: Add option to hide notification if reference widget is deactivated 2023-03-22 19:13:32 +01:00
Abdullah Tahiri
2f8be2c77b 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
b04ef3a351 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
a2bd55109d NotificationArea: Convert plain text to HTML to perserve format 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
4b7a44739f NotificationArea: Use fixed size notifications 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
3ece84fd9d NotificationArea: Allow wrapping of message text to avoid rendering issues with long messages 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
b2ef6f3f43 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