Commit Graph

12 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
9fe130cd73 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
bofdahof
ba2c2ca5ad Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
André Caldas
89dbab9b0e 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
6cced4defb 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
5d560405b8 Gui: add overloaded version of cmdAppDocument and cmdGuiDocument() that has a string as first parameter 2022-06-13 15:21:55 +02:00
Uwe
41f49010bd [Gui] Command: remove unused includes 2022-03-04 03:21:46 +01:00
wmayer
cd918265c8 Gui: [skip ci] allow to set edit mode in cmdSetEdit() 2021-11-01 14:47:26 +01:00
wmayer
06c6fecf2e Gui: [skip ci] add Gui::cmdAppDocumentArgs and support further string types with FormatString::str 2021-10-03 16:45:45 +02:00
luz paz
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
d488218701 [skip ci] fix more -Wgnu-zero-variadic-macro-arguments 2019-11-17 19:11:08 +01:00
wmayer
d68a8c5e24 [skip ci] improve documentation 2019-11-17 15:13:48 +01:00
wmayer
6bc9a90b44 add (variadic) templates to replace (non-strict ISO C++11 compliant) macros 2019-11-17 12:13:11 +01:00