Commit Graph

24 Commits

Author SHA1 Message Date
Markus Reitböck
abc6b9e7d0 Test: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
 should be considered an optimization, not a requirement. In particular, do not explicitly include a
 precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
 generated precompile header on the compiler command line instead. This is more portable across
 the major compilers and is likely to be easier to maintain. It will also avoid warnings being
 generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-24 20:08:57 +02:00
Ryan Kembrey
d7bc171a38 Test: Update UI strings for consistency
Closes: #22369
2025-08-04 20:13:34 +02:00
bofdahof
998f4e4d45 Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
pre-commit-ci[bot]
222a2520b1 [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
7681c62468 Test: apply clang format 2023-09-04 07:22:09 -05:00
wmayer
9a749e51c8 Mod: modernize C++: use equals default 2023-08-21 20:21:30 +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
wmayer
832abf8c7f Test: Create .qm out of .ts files 2023-05-07 08:51:20 +02:00
Abdullah Tahiri
c604d1741d 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
3c709f31df Gui: make unit tests working from command line if Gui is up 2022-12-24 19:13:40 +01:00
Uwe
ff247f84bf [Test] enable precompiled headers
- also remove unused headers
2022-12-14 04:25:52 +01:00
berniev
ddafb98813 Mod: Use override etc 2 2022-08-09 12:52:26 +02:00
wmayer
b4c480737f Test: [skip ci] set direct connection mode as otherwise the test will fail 2022-07-05 15:28:28 +02:00
0penBrain
5dcd27df93 Gui: test for ILoggerBlocker 2022-07-05 13:35:18 +02:00
Uwe
b480826091 [Test] remove Python.h 2022-03-20 22:42:09 +01:00
wmayer
0054cbddaa Fix coverity issue:
* CID 332682: Resource leak
* CID 350607: Resource leak
* CID 332677: Resource leak
2022-03-14 11:35:04 +01:00
wmayer
92671e0da5 Test: modernize C++11
* remove redundant void-arg
* use nullptr
2022-01-26 17:46:02 +01:00
luz paz
31c0099a59 Test: Fix header uniformity, whitespace, doxygen headers 2020-11-18 08:58:06 +01:00
wmayer
76b3397762 py3: ported module init to python3 2017-02-04 15:56:31 +01:00
wmayer
49869ba7a1 fix -Wextra in Test 2016-09-21 21:15:10 +02:00
wmayer
a643463733 + simplify porting of Test module to Python3 2016-01-20 10:26:12 +01:00
wmayer
169b2e356e + clean-up, fix and new methods added in unit test module 2015-10-19 21:51:43 +02:00
wmayer
f061b6f7ea 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