Commit Graph

12 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
25c3ba7338 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
bofdahof
998f4e4d45 Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
André Caldas
560898907b Avoids using getNameInDocument() to test if DocumentObject is attached to a Document.
This patch substitutes by isAttachedToDocument() (almost) everywhere where
getNameInDocument() is used for this purpose.

The very few places not touched by this patch demand a (just a little) less trivial change.
When we change the returning type of getNameInDocument() to std::string,
those places will be easily found, because they shall generate a compiler error
(converting std::string to bool).

Rationale:
The fact that getNameInDocument() return nullptr to indicate
that the object is not attached to a document is responsible for lots of bugs
where the developer does not check for "nullptr".

The idea is to eliminate all those uses of getNameInDocument() and, in the near future,
make getNameInDocument() return always a valid std::string.
2023-12-11 17:37:58 +01:00
Abdullah Tahiri
ec2f74a535 Gui: Command execution output for Developer only
================================================

Problem:
Command execution templates currently are send to Console() error,
which sends messages to both developers and users.

A user sees an error message (for example in the notifications area)
which is just the Python command that FreeCAD executed due to user's
input. This annoys users who do not understand Python and it is not
informative for them.

It is however informative for a developer, who can associate which
command produced which error/exception.

Solution:
To make these messages intended for the Developer only. So that regular
users are not annoyed.

Of course, Developers and power users can always select in preferences,
under Notification Area to be shown debug errors and warnings. In which
case nothing really changes.
2023-06-01 19:25:00 +02:00
wmayer
c0cccf7f7e Gui: add overloaded version of cmdAppDocument and cmdGuiDocument() that has a string as first parameter 2022-06-13 15:21:55 +02:00
Uwe
2be0a9706e [Gui] Command: remove unused includes 2022-03-04 03:21:46 +01:00
wmayer
13ba2242de Gui: [skip ci] allow to set edit mode in cmdSetEdit() 2021-11-01 14:47:26 +01:00
wmayer
57375ce7c2 Gui: [skip ci] add Gui::cmdAppDocumentArgs and support further string types with FormatString::str 2021-10-03 16:45:45 +02:00
luz paz
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
c0d58b8f3e [skip ci] fix more -Wgnu-zero-variadic-macro-arguments 2019-11-17 19:11:08 +01:00
wmayer
d4a1eb0cce [skip ci] improve documentation 2019-11-17 15:13:48 +01:00
wmayer
2bfffd202d add (variadic) templates to replace (non-strict ISO C++11 compliant) macros 2019-11-17 12:13:11 +01:00