Commit Graph

239 Commits

Author SHA1 Message Date
wmayer
dbd3e8784a App: code refactoring in Application::ExtractUserPath() 2021-11-08 16:17:08 +01:00
wmayer
ae0198ea0a 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
wmayer
f36126770c 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
c349e78f45 Minor code change according to suggestions 2021-10-30 12:30:45 +08:00
Zheng, Lei
ba4c992eaa App: use enum in API Application::getDocumentByPath() 2021-10-30 11:03:55 +08:00
Zheng, Lei
ad9ad30c00 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
c74d2b8dd5 App: add class PropertyRotation 2021-10-29 12:40:32 +02:00
wmayer
a261249217 App: replace ctime() with boost's date/time functions in Application::logStatus() 2021-09-30 19:50:19 +02:00
0penBrain
1061773d56 [Core] exit() can prevent core dumping, use abort() instead on debug mode 2021-08-18 18:12:31 +02:00
wmayer
f9a54c3385 Py3: fixes #0004081: Abillity to show console output when running under Python 2021-04-01 17:51:10 +02:00
wmayer
acbb604a16 App: use std::wstring_convert instead of QString to encode/decode unicode/utf-8 2021-03-29 16:19:13 +02:00
wmayer
6c01302a19 Gui: fix unicode handling of path names on Windows 2021-03-29 15:41:13 +02:00
Benjamin Nauck
dbc4611bb2 App: Refactor win appData setup with boost::filesystem 2021-03-29 15:03:41 +02:00
Benjamin Nauck
a7e6171e49 App: Refactor *nix appData setup with boost::filesystem 2021-03-29 15:02:49 +02:00
Benjamin Nauck
c431672e87 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
Chris Hennes
3788105210 [Core] Remove deprecated code for 0.20 2021-03-07 08:44:57 +01:00
wmayer
c243741296 Gui: [skip ci] re-add removed Py_INCREF of module 2021-02-27 11:13:30 +01:00
wmayer
dd4dd204d0 App/Gui: fix memory leaks:
+ add function to cleanup units and quantities in debug build
+ fix reference leak in PropertyVector::getPyPathValue()
+ fix reference leak in PropertyPlacement::getPyPathValue()
+ in InterpreterSingleton::init() use a static std::vector<wchar_t*> instead of a C array
  to free memory at program end
+ in MainWindow::closeEvent() explicitly delete all task watchers
+ in ReportOutputObserver constructor pass parent to QObject
+ in PropertyEditor destructor explicitly delete QItemEditorFactory
2021-02-27 10:56:19 +01:00
luz paz
84553bf191 App: Fix header uniformity, trailing whitespace, and doxygen headers 2020-11-19 13:38:37 +01:00
wmayer
f0aba7a561 MSVC: [skip ci] make working with C++17 compiler 2020-11-09 16:13:34 +01:00
Priit Laes
d6b8725b34 build: boost: Drop branches requiring boost-1.46 2020-10-13 12:56:28 +02:00
Priit Laes
6cc4d8aec2 build: boost: Drop boost-1.44-specific checks 2020-10-13 12:56:28 +02:00
Chrismettal
a33a1f184d Seed randomizer on application init 2020-10-12 19:10:06 +02:00
wmayer
f55f7f040a Python: [skip ci] expose Python types in their corresponding modules 2020-09-21 15:04:26 +02:00
Zheng, Lei
dcae039c52 App/Gui: warn when loading/saving file with identical physical path 2020-08-31 14:05:14 +02:00
wmayer
5cc5ac3e9a App: improve support of portable version of FreeCAD 2020-08-05 15:47:50 +02:00
wmayer
1a34d3da1f Coverity: Uncaught exception 2020-07-20 17:34:26 +02:00
Zheng, Lei
36d046d489 App/Gui: introduce temporary document
Add new argument to Application::newDocument() to create a temporary
    document. Also exposed to Python API App.newDocument() with a named
    argument 'temp'.

    The temporary document is marked with status bit 'TempDoc'. The user
    will not be prompt for saving when closing. The undo/redo is disabled.
    The AutoSaver skips it. And the tree view will not show it.
    PropertyXLink allows linking to/from object within a temporary document
    without saving.
2020-07-14 19:36:05 +02:00
Bernd Hahnebach
986aca5b82 App: properties, add vacuum permittivity 2020-06-29 17:46:41 +02:00
wmayer
4b8cf63c14 [skip ci] improve possibility to create a QApplication in a thread 2020-06-21 00:07:21 +02:00
wmayer
d6169d6478 boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
730154a684 boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
Bernd Hahnebach
a2ee671ad7 small code formating in application 2020-03-16 15:45:24 +01:00
luz.paz
ebe194a9e9 Fix typos
Found via  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,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,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,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
```
2020-03-06 14:50:35 +01:00
Zheng, Lei
a66ebdce9f App: restore external linked documents in dependency order 2020-02-14 19:46:56 +01:00
Zheng, Lei
51cf93012f App: fix Link document restore
This fixes issue #0004224
2020-02-14 19:46:36 +01:00
Zheng, Lei
8fd53f4f75 App: add PropertyXLinkList
PropertyXLinkList is derived from PropertyXLinkSubList, which is
modified to provide APIs compatible to PropertyLinkList.

The only difference between the two class is in their getPyObject() to
make PropertyXLinkList output similar to PropertyLinkList in Python. In
C++, both class can accept mix of objects link with or without subname,
depending on which set of APIs are used.
2020-02-11 15:40:27 -05:00
Zheng, Lei
10e7b3e80e Do not throw error when open an already opened document 2020-02-05 11:12:00 +01:00
wmayer
8e4494c5c2 App: add methods to change import/export module of a registered filetype 2020-01-18 15:29:44 +01:00
luz.paz
019f73852c src/App: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/App` files
2019-12-25 11:38:43 +01:00
wmayer
79ef4be9de export typeid system to Python 2019-11-13 00:43:23 +01:00
wmayer
f00cb89201 fix crash when restoring a corrupted project fails 2019-10-25 20:58:06 +02:00
wmayer
4d831ea442 Basic support for Frequency as unit 2019-10-20 18:14:56 +02:00
luz.paz
fb32601746 Fix various (doxy) typos and whitespace issues
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,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`
2019-10-03 07:57:13 +02:00
wmayer
37287cf9d9 fix further file names vulnerabilities in core system and Image module 2019-10-02 15:07:13 +02:00
Zheng, Lei
36f7098257 App: extend Expression syntax
* Support sub-object reference syntax using the following syntax,
    Part.<<Box.>>.Placement
  or, with sub-object label referencing
    Part.<<$Cube.>>.Placement

* Extend indexing support, including range based indexing, e.g.
    A1[B2+1][C3][D4:-1]

* Add new constants, None, True, true, False, false.
2019-09-28 15:31:24 +02:00
Zheng, Lei
38c47d6e95 Expression: split Expression.h to ExpressionParser.h
Split Expression details into a separate header to reduce recompilation
time on changes.
2019-09-28 15:30:41 +02:00
luz.paz
dae18259e0 src/App/Application: Improve FC CLI help output
Help the user find more details info by directing them to the exact wiki page needed instead of the front page of the official site.
2019-09-28 12:46:14 +02:00
wmayer
d4bac9e259 fix some MSVC warnings 2019-09-19 17:55:10 +02:00
wmayer
9fa56345cf 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