Commit Graph

21 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
e92ed45df9 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-09-12 13:02:35 -04:00
wmayer
e48964fad5 Test: apply clang format 2023-09-04 07:22:09 -05:00
wmayer
142b86fde2 Mod: modernize C++: use equals default 2023-08-21 20:21:30 +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
wmayer
0df9d12530 Test: Create .qm out of .ts files 2023-05-07 08:51:20 +02:00
Abdullah Tahiri
ee0c3ad5c1 Console/ILogger: Refactor and extension
=======================================

Refactor:
 - Substitute the use of variadic templates with parameter packs.
 - Use recently incorporated external library "fmt" to handle printf like formating.
 - Extensive cleaning of pragmas and unnecessary forward declarations.
 - Parameter packs and libfmt provide a much stronger type checking now, so
   conversions that are by standard implicit as bool to int need an explicit static_cast
   to avoid compilation warnings.

Extension:
 - Include a notifier field, so that the originator of the message can be provided. E.g. Document#DocumentObject
 - Include a new type of message called CriticalMessage, this message is intended to have
   special behaviour in the future. Namely, it will be used to notify forward compatilibity issues.
   It will be used to substitute the current signal/slot mechanism.
 - Include two new types of messages for user notifications (Notification and TranslatedNotification). This messages
   will be use to convey UI notifications intended for the user (such as non-intrusive message about the usage of a tool). There
   are two versions to mark whether the string provided as a message is already translated or not. When using the console system for
   notifications, these notifications may originate from the App or the Gui. In the former, it is generally the case that the strings
   of messages are not (yet) translated (but they can be marked with QT_TRANSLATE_NOOP). In the latter, often the messages to be provided
   are already translated.

Python support for CriticalMessage, Notification and TranslatedNofification, including shortcuts:

    Crt = FreeCAD.Console.PrintCritical
    Ntf = FreeCAD.Console.PrintNotification
    Tnf = FreeCAD.Console.PrintTranslatedNotification
2023-03-07 16:13:23 +01:00
wmayer
fa6dc8d0e1 Gui: make unit tests working from command line if Gui is up 2022-12-24 19:13:40 +01:00
Uwe
4531349539 [Test] enable precompiled headers
- also remove unused headers
2022-12-14 04:25:52 +01:00
berniev
71dc5ead2f Mod: Use override etc 2 2022-08-09 12:52:26 +02:00
wmayer
b3e8efc9f9 Test: [skip ci] set direct connection mode as otherwise the test will fail 2022-07-05 15:28:28 +02:00
0penBrain
faf0d02945 Gui: test for ILoggerBlocker 2022-07-05 13:35:18 +02:00
Uwe
e1d7762140 [Test] remove Python.h 2022-03-20 22:42:09 +01:00
wmayer
0f9768fb33 Fix coverity issue:
* CID 332682: Resource leak
* CID 350607: Resource leak
* CID 332677: Resource leak
2022-03-14 11:35:04 +01:00
wmayer
60d32ee475 Test: modernize C++11
* remove redundant void-arg
* use nullptr
2022-01-26 17:46:02 +01:00
luz paz
26636dbbad Test: Fix header uniformity, whitespace, doxygen headers 2020-11-18 08:58:06 +01:00
wmayer
7ba2217617 py3: ported module init to python3 2017-02-04 15:56:31 +01:00
wmayer
b34c9fec96 fix -Wextra in Test 2016-09-21 21:15:10 +02:00
wmayer
f3b8d7cbc1 + simplify porting of Test module to Python3 2016-01-20 10:26:12 +01:00
wmayer
b0d6ffc5b2 + clean-up, fix and new methods added in unit test module 2015-10-19 21:51:43 +02:00
wmayer
201042692d 0001278: No build possible with current CMake version 2.8.12 2013-10-22 10:33:18 +02:00
wmayer
120ca87015 + unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-10 13:44:52 +00:00