Commit Graph

51 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
25c3ba7338 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
Markus Reitböck
6ef07bb358 Gui: 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-14 09:47:03 +02:00
Max Wilfinger
ecf02b7878 Gui: Update UI strings for consistency
Closes: #22135
2025-08-04 20:14:45 +02:00
Ladislav Michl
c293d74566 Base: rename Exception's PascalCase methods to camelCase 2025-05-05 23:50:01 +02:00
Benjamin Nauck
a882289995 Gui: use contains() and isEmpty() instead of count() where possible 2025-05-03 22:19:51 +02:00
Kacper Donat
6e2583cdcd Gui: Use freecad_cast whenever possible 2025-04-26 14:23:25 +02:00
Kacper Donat
b300c80b90 Base: Use explicit pointer syntax for freecad_cast (#20694)
* Base: Use explicit pointer syntax for freecad_cast

This aligns our custom cast with other casts

* All: Use explicit pointer syntax for freecad_cast
2025-04-11 14:11:33 +00:00
Kacper Donat
35a9673a75 Base: Rename Base::freecad_dynamic_cast into freecad_cast
This is to make it shorter and easier to use. QT does the same thing
with their qobject_cast.
2025-04-07 10:32:28 -05:00
Kacper Donat
12a69fe296 Base: Add isNullOrEmpty string helper
This adds isNullOrEmpty string helper that cheks if string is... well
null or empty. It is done to improve readability of the code and better
express intent.
2025-02-21 15:04:43 +01:00
Benjamin Nauck
a1c5767643 Mod: Use new addObject<T>(...) using regex 2025-02-10 18:35:38 +01:00
Roy-043
bee46bca68 Core: fix sWhatsThis for Std_LinkActions 2025-01-08 22:25:25 +01:00
Snow Faerie
8bc062b6e8 Fix and add menu accelerators (#15532)
* Fix and add menu accelerators: menus common to all workbenches

I use menu accelerators fairly often, so I find it very frustrating when
they are missing, or worse, they don't work due to the same letter being
assigned to several commands.

This patch adds accelerators to lots of menu entries missing them and
fixes broken accelerators.

Wherever possible, standard accelerator keys are used:
https://doc.qt.io/qt-5/accelerators.html

This commit covers accelerator fixes that are common to all workbenches.
Accelerator fixes for specific workbenches will be done in separate
commits.

* Add missing accelerators: Spreadsheet workbench
2024-12-13 10:39:30 -06:00
luzpaz
a71f49f4f6 Fix trailing newlines and minor typo fixes 2024-07-23 16:16:30 +02:00
wmayer
0484592835 Fix accessibility of some group commands
Several group commands are active but require an active document to work. This PR overrides the method isActive() to
disable the commands if no active document exists.

The affected commands are:
* Std_ViewGroup
* Std_LinkActions
* PartDesign_CompDatums
* PartDesign_CompSketches
2024-05-23 10:14:46 +02:00
wmayer
d063ea58a4 Gui: Fix Std_LinkActions
Currently the active button of the Std_LinkActions command is toggable that is confusing behaviour.
This PR makes the action group non-checkable
2024-04-02 08:19:38 +02:00
Chris Hennes
672d879653 Gui: Fix translation strings for Part, Group, and Link
Extra HTML tags were added outside the translation NOOP. They were unnecessary, and broke translation.
2024-03-05 10:38:51 +01:00
Adrian Insaurralde Avalos
963652c6a7 Avoid sending unescaped quotes to python console 2024-02-04 16:44:25 -06: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
Paddle
a515bd0244 Improve tooltips and remove the html from the translate. 2023-09-21 07:31:15 +02:00
Paddle
404623a114 Give std_LinkMake a proper tooltip. 2023-09-20 12:44:38 +02:00
Paddle
a92c528c9e Structure toolbar : put Link in the command group. 2023-09-20 12:44:33 +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
Chris Hennes
f1e57968cd Gui: Adjust tooltips for improved translation
Tooltips should not be identical to the command menu entry, it prevents translators from translating them separately.
2023-04-29 13:03:02 -05:00
berniev
75acacd1b7 Gui: Use auto and range-based for (#7481)
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. 
* When possible use a ranged for loop instead of begin() and end() iterators
2022-09-14 13:25:13 -05:00
luz paz
1a7ddfdc24 Fix typos and whitespace
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,anormal,apoints,ba,beginn,behaviour,bloaded,bottome,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childrens,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,itsel,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oce,oder,ontop,orgin,orginx,orginy,ot,pard,parm,parms,pres,programm,que,rady,recurrance,ro,rougly,seperator,serie,sinc,siz,strack,substraction,te,technic,thist,thru,tread,uint,unter,uptodate,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./src/Base/StackWalker.cpp,./build/doc/SourceDocu`
2022-08-23 18:49:47 +02:00
berniev
0c70d45c83 Gui: Use override etc 2 2022-08-09 12:43:23 +02:00
berniev
656ef8961f Gui: redundant void 2 2022-08-08 10:21:44 +02:00
berniev
d88729d2c4 Gui: use empty 2022-08-06 16:35:45 +02:00
wmayer
6ee2c7f865 Fix several clazy issues:
* C++11 range-loop might detach Qt container [-Wclazy-range-loop-detach]
2022-07-24 23:48:37 +02:00
wmayer
0bef4e82f2 Fix several clazy issue:
* Missing reference in range-for with non trivial type [-Wclazy-range-loop-reference]
2022-07-24 22:29:06 +02:00
Uwe
3e99d39d05 [Gui] remove some more superfluous nullptr checks 2022-07-18 13:15:38 +02:00
wmayer
e0487b62a6 Gui: [skip ci] set Std_LinkMakeRelative as WhatsThis name 2022-06-13 11:01:36 +02:00
Uwe
832f181ec0 [Gui] make What's This? work for sublinks 2022-06-13 02:42:37 +02:00
wmayer
9eac35cf5d Gui: clean-up Selection API
Replace the int of the 'resolve' argument of several functions with a proper enum class.
* This avoids the inconsistencies in client code where often true/false is passed when an int is expected
* This avoids the use of magic numbers like 0, 1, 2 or the undocumented 3
2022-04-09 17:03:43 +02:00
Chris Hennes
bedf920702 Gui: PR6497 move return statement to new line 2022-03-29 12:33:50 -05:00
wmayer
96adb98f46 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
wmayer
1ca7429705 Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
wmayer
4977e55e51 App: Optimize includes to reduce compile time 2022-03-07 15:53:58 +01:00
Uwe
2be0a9706e [Gui] Command: remove unused includes 2022-03-04 03:21:46 +01:00
wmayer
fe7f4c4be7 Gui: remove QT_TR_NOOP from command group names and use "CommandGroup" as context string 2021-09-29 16:31:55 +02:00
wmayer
c4f411af26 Gui: use public methods in Command sub-classes 2021-04-21 19:34:50 +02:00
luz paz
74ab516494 Gui: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the src/Gui code.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
2020-12-01 14:53:35 +01:00
luz paz
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
f900bdf115 Gui: [skip ci] fixes #0004330: The Std_WhatsThis command does not work for 2 submenus of the View menu. 2020-04-30 14:53:37 +02:00
Zheng, Lei
fbfad66d2b Gui: expose link actions to toolbar 2019-10-08 10:25:36 +02:00
Zheng, Lei
f57283f598 Link: change sub-element linking mechanism
Previous multi-sub-element linking (e.g. Face, Edge) is supported
through SubElements of type PropertyStringList, which does not support
geometry element update tracking. This patch changes it to use
PropertyXLink's new multi-subname capability.
2019-10-08 10:20:50 +02:00
Zheng, Lei
e03e6d9a44 Gui: expose link selection and navigation command 2019-10-08 10:19:20 +02:00
Zheng, Lei
68a9a847c5 Gui: improve Std_LinkSelect command
Recognize external object brought in by a link to a group. The
Std_LinkSelect will jump into the the owner document of the external
object.
2019-10-08 10:16:44 +02:00
wmayer
b50b21576e core system
force strict ISO C++ (-Wpedantic)
TODO: still a lot of variadic macros are not valid ISO C++
2019-09-18 01:01:14 +02:00
Zheng, Lei
848fbf6035 Gui: allow SelectionSingleton::hasSubSelection() check for sub-element
This is used by relative link command activation for sub-element
selection
2019-08-30 14:43:04 +02:00