Commit Graph

1275 Commits

Author SHA1 Message Date
wmayer
11c5954ebf App: split Application::ParseOptions into two functions
to simplify handling of options that should be processed before determining user directories
2021-11-08 11:10:13 +01:00
luz paz
fdcdaebc9b Fix typos in source comments [skip ci]
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,apoints,ba,beginn,behaviour,bloaded,bottome,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,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,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,ontop,orgin,orginx,orginy,ot,pard,parms,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,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,./build/doc/SourceDocu`
2021-11-05 02:35:17 +01:00
wmayer
09da245af9 App: harmonize API of App::Application
* make getHomePath() static and return a std::string
* make getExecutableName() static and return a std::string
2021-11-04 10:50:09 +01:00
Zheng, Lei
a2fb4a5d6d Minor code change according to suggestions 2021-10-30 12:30:45 +08:00
Zheng, Lei
9885dadfff App: use enum in API Application::getDocumentByPath() 2021-10-30 11:03:55 +08:00
Zheng, Lei
fc9d3547ad App: fix external document loading
The problem happens when partial loading is enabled. If document A
contains a link to some object in document B, it will load B as partial
document with only that object and its necessary dependencies. But if
document A contains another link to some object in document C which also
has a link to some object in document B, the link in document C may not
be restored, because document B is partially loaded without the linked
object. This patch will check for this case and reload document B for
more objects.

See an example reported in
https://forum.freecadweb.org/viewtopic.php?p=495078#p495078
2021-10-30 11:03:52 +08:00
wmayer
16ae568549 App: add class PropertyRotation 2021-10-29 12:40:32 +02:00
wmayer
b24ac5f2f8 App: [skip ci] add get() method to WeakPtrT class 2021-10-21 15:50:07 +02:00
Yorik van Havre
d95f085760 Merge pull request #4787 from chennes/addThemeSupport
[GUI] Add Preference Pack support
2021-10-14 12:41:06 +02:00
Zheng, Lei
413a822a07 App: add signalChanged to Property
For more efficient tracking of single property changes
2021-10-12 15:47:50 -05:00
Zheng, Lei
2c6f621721 App: add expression built-in function str()
...for stringify
2021-10-12 13:42:10 -05:00
wmayer
7b45d63bf2 App: use consistent spelling of SubElement 2021-10-06 18:09:53 +02:00
wmayer
b6d90bf575 App: [skip ci] make Matrix a dynamic attribute of ComplexGeoDataPy 2021-10-05 19:18:12 +02:00
wmayer
32592de8ce App: expose methods of ComplexGeoData to Python 2021-10-05 12:43:28 +02:00
wmayer
a6d93e2d5e App: [skip ci] add overloaded constructor of DocumentObjectT 2021-10-02 07:05:37 +02:00
wmayer
0c62c22554 App: replace ctime() with boost's date/time functions in Application::logStatus() 2021-09-30 19:50:19 +02:00
wmayer
ca05fc678b App: correctly handle UTF-8 encoded path names under Windows 2021-09-29 13:47:29 +02:00
Ajinkya Dahale
b7ea205c70 [App] Fix regression introduced by PR #4996
Files opened by running `freecad xxxx.FCStd` or similar relative paths could not
be saved because of new code introduced to create parent directories. See
https://github.com/FreeCAD/FreeCAD/pull/4996#issuecomment-922370077 and
https://forum.freecadweb.org/viewtopic.php?f=13&t=62319&p=534156#p534156.

This commit resolves the issue by ensuring the parent path is absolute while
saving. We would probably like to make sure the file name is itself stored with
absolute path, but there's a few problems
1. There may be other occurences where files are loaded with relative paths. So
having a check here is a good idea.
2. Files opened by `freecad xxxx.FCStd` somehow don't have the issue where
renaming parent directory throws an exception on save. Instead the file is saved
in the new location.
2021-09-29 13:35:02 +02:00
Chris Hennes
b432592fb2 Merge branch 'master' into addThemeSupport 2021-09-24 07:51:04 -05:00
wmayer
52c4ad941b App: add comment for clarification 2021-09-23 18:51:41 +02:00
wmayer
bfe7a7a120 App: make evalExpression() a class method of DocumentObject 2021-09-23 15:31:15 +02:00
Yorik van Havre
b8a4d1e07e Merge pull request #4800 from heewa/abort-save-when-unable-to-finish
App: Abort save when unable to finish
2021-09-20 10:47:57 +02:00
Chris Hennes
6780ded233 [App] Fix LGTM warning decl hides param 2021-09-19 12:31:24 -05:00
wmayer
ef0e303235 App: handle empty, . or .. as parent directory 2021-09-19 18:06:47 +02:00
Chris Hennes
186548da6c [App] LGTM fix - rename loop variable
LGTM complains that the use of "obj" as the loop variable here hides the
parameter "obj". To silence the warning, rename the loop variable.
2021-09-18 23:18:51 -05:00
Preslav
d7ac25e3cf Ammending stiffness units 2021-09-17 11:08:08 +02:00
Ajinkya Dahale
820e88f95b [Core] (Partially?) Fix data loss on dir rename (#4996)
* Fix lost filename in err msg

In some circumstances, FileExceptions are constructed empty, then have a
filename assigned to them, but the error message in these scenarios is
left as the default "unknown" one, which is sometimes shown to users.
This change fixes that case to be consistent with instances that are
constructed with the filename.

The exception can happen when trying to save the file in a location that does
not exist, or when the user does not have permission to write there. If it
comes when saving after closing the document, all previous changes can be lost.

Partially fixes issue #4098.

Co-authored-by: Heewa Barfchin <heewa.b@gmail.com>
2021-09-16 12:06:29 -05:00
wmayer
40d2955c66 Base: split export/import macros from FCConfig.h and move them to FCGlobal.h
The FCGlobal.h can be included in a Global.h header file of an extension module.

The reason is that some IDEs (e.g. QtCreator) fails to detect the export/import macros when only defined in the PreCompiled.h files and thus raise a parser warning.
2021-09-14 16:40:30 +02:00
Chris Hennes
27042d210f Merge branch 'master' into addThemeSupport 2021-08-19 09:51:12 -05:00
0penBrain
f976699bdf [Core] exit() can prevent core dumping, use abort() instead on debug mode 2021-08-18 18:12:31 +02:00
Yorik van Havre
cbdac756a8 Merge pull request #4963 from Helios113/stiffness
Base: Adding stiffness units
2021-08-18 10:04:46 +02:00
Preslav
4ab37fc0ca Added stiffness units to FreeCAD [mN/m, N/m, kN/m, MN/m] 2021-08-16 12:27:41 +01:00
Zheng, Lei
54171f6b04 App: fix LinkMode enforcement in Link on restore 2021-08-01 16:36:12 +08:00
Heewa Barfchin
7e11c7bd50 App: Abort save when unable to finish
In these two cases, the project's file will not contain the latest
changes, so returning as if the save is complete is incorrect and can
lead to data loss (such as on app quit).
2021-05-18 11:20:00 -04:00
Chris Hennes
30fd2ce5b8 [App] Add metadata handling class 2021-05-13 09:08:28 -05:00
wmayer
b69ef38c7f allow to enable PCH for gcc and clang 2021-05-03 17:37:58 +02:00
wmayer
44e82ac3c4 App: remove some more deprecated Py2 code
and remove deprecated void from function signature and replace 0 or NULL with nullptr
2021-04-26 10:55:56 +02:00
wmayer
3ed720dcd3 App: [skip ci] fix memory leaks:
Found two memory leaks in class Enumeration
* method tearDown() always ignored to free the memory of the first element
* assignment operator didn't call tearDown() when needed
2021-04-25 21:58:24 +02:00
luz paz
fc6d1292d1 App: remove Py2 code from several src/App .cpp files 2021-04-19 15:27:06 +02:00
wmayer
377b01b4b4 Py3: fixes #0004081: Abillity to show console output when running under Python 2021-04-01 17:51:10 +02:00
wmayer
4bec60cc78 App: use std::wstring_convert instead of QString to encode/decode unicode/utf-8 2021-03-29 16:19:13 +02:00
wmayer
e1dd20db0c Gui: fix unicode handling of path names on Windows 2021-03-29 15:41:13 +02:00
Benjamin Nauck
f410aae48c App: Refactor win appData setup with boost::filesystem 2021-03-29 15:03:41 +02:00
Benjamin Nauck
66d39ecbb7 App: Refactor *nix appData setup with boost::filesystem 2021-03-29 15:02:49 +02:00
Benjamin Nauck
00d749601c App: Refactor mac appData setup with boost::filesystem
This will make it easier to add support for migration when moving
appData from `Library/Preferences` to `Library/Application Support`.
2021-03-29 15:02:36 +02:00
wmayer
d158c50c48 App: [skip ci] rename class to PropertyLinkT 2021-03-29 01:16:04 +02:00
wmayer
545b4f20db App: [skip ci] add class PropertyListT 2021-03-29 00:47:38 +02:00
wmayer
e825148cf4 App: add system32 to Python's search paths 2021-03-27 13:05:03 +01:00
donovaly
bcc669b930 [Base] add electrical conductivity
- this is necessary to perform electrodynamics simulations. Since the typical values are in the range of 1e6 S/m, we need the new units kS and MS

- since this is for simulations, also add electrical conductivity to the FEM material cards
2021-03-25 17:13:52 +01:00
Chris Hennes
52ed707b0e [Core] Remove deprecated code for 0.20 2021-03-07 08:44:57 +01:00