Commit Graph

1116 Commits

Author SHA1 Message Date
Benjamin Bræstrup Sayoc
33384cff9c [Everywhere] FileInfo::hasExtension for multiple values (#9774)
* [Base] Add hasExtension for multiple values

* [Gui] Use hasExtension for multiple values

* [Drawing] Use hasExtension for multiple values

* [Fem] Use hasExtension for multiple values

* [Import] Use hasExtension for multiple values

* [Mesh] Use hasExtension for multiple values

* [Part] Use hasExtension for multiple values

* [TechDraw] Use hasExtension for multiple values
2023-08-07 09:55:19 -06:00
wmayer
c7a17468e7 modernize C++: use noexcept 2023-08-07 16:06:58 +02:00
wmayer
89d529ab7b modernize C++: use using 2023-08-06 23:17:10 +02:00
wmayer
d244dcf2da modernize C++: use nullptr 2023-08-05 11:23:12 -06:00
Morgan 'ARR\!' Allen
f8f02f0895 add cstdint behind ifdef __GNUC__ for compiling under alpine linux
note: in other headers there is a mix of including the ifdef
2023-08-04 18:45:22 -06:00
wmayer
a00a5d6400 Base: modernize C++: use override 2023-08-04 17:09:53 +02:00
sliptonic
20768ba7f9 Merge pull request #9594 from wwmayer/issue_9549_new
Part: fixes #9549: Part Fuse not working inside Part container
2023-07-24 10:16:51 -05:00
marioalexis
3d3b5b76f5 Base: Fix warnings -Wredundant-move 2023-07-24 14:39:21 +00:00
0penBrain
566ae39519 [Bugfix]Base: fix implementation of isFile() so it is safe to use
Current implementation can freeze the app if called on specific files
2023-07-23 17:19:31 +00:00
wmayer
4688582de3 Base: fix bug in CoordinateSystem::setYDirection 2023-07-13 15:12:09 +02:00
Pesc0
4a8d3853ba [Toponaming] create ElementMap class (#9175)
* Copypaste ElementMap
* Add MappedNameRef
* Fix missing include
* Copypaste `findTagInElementName`
* fix error introduced _somewhere_
* refactor toponaming constants
* Move `findTagInElementName` in `MappedName`
* reintroduce workaround to compile ElementMap
* Added missing functions copied from complexgeodata
* fix last compile errors, reorder and format files
* remove recursive refs to ComplexGeoData
* Add more comments
* fixed comments and added tests
* added FIXME, make functions private, misc fixes
* Move static functions from complexGeoData to PostfixStringReferences. Rename to ElementNamingUtils
* Fix broken includes due to previous change
* Revert constants from string to const char*
* added childmap tests and made hasher public
* Make functions private
* Added remaining tests
* removed bool return from `erase` functions
* fix missing appexport

Co-authored-by: John Dupuy <jdupuy98@gmail.com>
2023-06-15 09:05:24 -05:00
Abdullah Tahiri
1307f708c7 Interpreter: Fix lack of notifier in DeveloperError call 2023-06-01 19:25:00 +02:00
Abdullah Tahiri
dc08aa8e0f Console: Ensure macros have a notifier string 2023-06-01 19:25:00 +02:00
Connor Worrell
b75336dad0 [Base] US Building Schema correct sign on fraction 2023-05-31 19:53:49 -04:00
Abdullah Tahiri
cc091b2703 Console: Update loging macros to only send to developers 2023-05-25 14:09:06 +02:00
Abdullah Tahiri
d7ec60c2b4 Console: Improve the documentation 2023-05-23 14:24:45 +02:00
Abdullah Tahiri
c2b2b0c1fa Base: Interpreter - Mark Exception reporting and stack as intended for developers 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
2bcee570da Console: Extend the Python interface 2023-05-23 14:24:45 +02:00
Abdullah Tahiri
45bf89d977 Console: Convenience dedicated functions 2023-05-23 14:24:45 +02:00
Abdullah Tahiri
a66e00d2a4 Ilogger - Separate behaviour for user exposed and not exposed loggers 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
Chris Hennes
c71c36bfa8 Merge pull request #9582 from chennes/translateUnitSchemes
Gui: Translate unit system UI
2023-05-17 11:06:27 -05:00
marioalexis
f1af39725a Base: Include needed header file 2023-05-16 12:46:34 -03:00
Chris Hennes
001c79f459 Gui: Translate unit system UI 2023-05-15 20:16:46 -05:00
wmayer
41e6758bc0 Base: add helper function to quote a string and join a list of strings 2023-05-15 23:40:07 +02:00
Chris Hennes
2e5f43e69b App/Toponaming: Add missing include to Writer 2023-05-11 14:34:35 -05:00
Chris Hennes
0a2eacade2 App/Toponaming: Lint and compilation cleanup 2023-05-11 14:34:35 -05:00
Chris Hennes
1c0cf32b22 App/Toponaming: Add supporting code
Support for reading and writing binary data, and a small tweak to bitmask.
2023-05-11 14:34:35 -05:00
wmayer
b543fe3bfe MSVC: fix build failure related to PCH 2023-04-12 08:30:44 +02:00
marioalexis
6cb9bdd23a src: Add descriptor protocol support for Python C++ extension modules 2023-04-10 16:53:51 +02:00
Abdullah Tahiri
d06e99ae34 Console: wrong alignment 2023-03-26 11:33:57 +02:00
Uwe
67c75dad2f [FEM] Elmer: add missing deformation info
- also some formatting changes done by clang
2023-03-26 09:32:56 +02:00
wwmayer
560752cd80 Base: fixes #8902: Segfault from Part WB functionality in python scripting (#8927) 2023-03-17 22:50:30 +01:00
Gaël Écorchard
85420a885b Merge branch 'master' into empty_identifier_not_allowed 2023-03-15 14:14:15 +01:00
wmayer
2071971a5d MSYS2: fix creation of ProgressIndicatorPy 2023-03-14 22:24:33 +01:00
luzpaz
3f6771ff56 Refine previous fix for #8866 2023-03-14 15:59:33 +01:00
luzpaz
ff470469f5 Fix misc. grammar and whitespace 2023-03-13 15:01:05 +01:00
wmayer
bcc80ba9aa MSYS2: fix linking error with extern templates 2023-03-12 16:17:38 +01:00
Abdullah Tahiri
63f3bdaf77 Base: Observer - fix template instantiation
===========================================

Merit goes to Werner for figuring out the issue and proposing a MSVC/MSYS2 viable solution:
https://github.com/FreeCAD/FreeCAD/pull/8781#issuecomment-1464898566
2023-03-12 06:06:29 +01:00
Daniel-Khodabakhsh
827af464e3 Add various matrix related expression functions (#8603)
Adds a few new Expression functions with the goal to:

- Simplify Placement, Rotation, Vector and Matrix object creation.
- Add new matrix functions for rotation and translation.
2023-03-11 20:13:23 -06:00
Gaël Écorchard
de42289c12 Do not allow an empty identifier 2023-03-10 13:10:00 +01: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
mosfet80
d73636630a Merge branch 'master' into removeGZstream 2023-03-01 19:43:56 +01:00
Andrew
c4e6c0a292 remove unused FDstream file 2023-03-01 12:28:00 -06:00
wmayer
da63fbaacf Base: catch exception raised by Rotation::setValue 2023-03-01 18:43:15 +01:00
wmayer
ea866c755b Base: fix/ignore some clang-tidy warnings 2023-02-28 15:17:06 +01:00
wmayer
315a1158a9 Base: make static const predefined quantities 2023-02-28 15:17:06 +01:00
wmayer
31a01d3c23 Base: fix Lint warnings in Quantity 2023-02-28 15:17:06 +01:00
wmayer
b0b52cda32 Base: fix pow() of Quantity 2023-02-27 22:13:08 +01:00