Commit Graph

159 Commits

Author SHA1 Message Date
wmayer
81f4bcce66 Gui: [skip ci] fix -Wmultichar 2021-11-23 00:33:12 +01:00
luz paz
fc31a79eef Gui: remove superfluous whitespace from translation string
Avoids possible translation mistakes by only exposing non-whitespace strings.
2021-11-22 19:28:43 +01:00
Chris Hennes
c62239d0ba Merge pull request #4626 from pavltom/GUI_TreeView_Item_Ordering
[Gui] Issue #3923 - Add arbitrary Tree View item ordering
2021-11-10 23:35:05 -06: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
Tomas Pavlicek
345dcd5252 [Gui] Issue #3923 - Arbitrary Tree item ordering + tests 2021-10-26 19:09:34 +02:00
wmayer
b93aa77a1c Gui: move handling of failed document saving to a function to reduce code duplication 2021-10-20 21:57:51 +02:00
wmayer
cf58f30ed4 Gui: [skip ci] handle exception text as UTF-8 encoded string when saving failed 2021-09-29 14:03:51 +02:00
Chris Hennes
5661e23eef Merge pull request #4792 from heewa/abort-quit-on-failed-save
[Gui] Fix app quitting despite failing to save project
2021-09-17 19:46:01 -05:00
wmayer
54700faad8 Gui: fix typos 2021-09-17 08:28:34 +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
Heewa Barfchin
dc5a5cb2cb Fix app quitting after failed save. Fixes #4098
Return `false` from Document::save() to properly communicate the
failure, which the app-quit process already handles by aborting.
2021-05-14 12:53:25 -04:00
luz paz
81dbae551f Crowdin: Gui: fix user-facing typo in Document.cpp [skip ci]
ref: https://crowdin.com/translate/freecad/549/en-en?filter=basic&value=0#6584664
2021-02-25 10:31:33 +01:00
Zheng, Lei
3ea1486071 Gui: fix external edit reset crash
By making sure to signal from the owner document of the editing object.
The owner document of the editing object may be different from the
editing document in case of editing external linked object.
2021-01-04 12:01:00 +01:00
Mateusz Skowroński
2559f2d29c Fix build warnings from deprecated Boost headers (they are used internally by Boost). Thanks @wwmayer for the hint. 2020-12-29 10:20:53 +01:00
wmayer
126c58471a Gui: [skip ci] avoid adding a wrong file name to the recent files list 2020-12-18 14:35:17 +01:00
luz paz
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
bf262b4188 Gui: [skip -ci] fix Document::toggleInSceneGraph() to avoid to add a node twice 2020-09-25 13:05:45 +02:00
luz paz
5cd408687b Fix typos in various files [skip-ci]
Found via `codespell 2.0.dev0`  
```
codespell -q 2 -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
```
2020-09-04 10:10:31 +02:00
Zheng, Lei
6ef1562d1f App/Gui: warn when loading/saving file with identical physical path 2020-08-31 14:05:14 +02:00
wmayer
44f42a8e2c LGTM: [skip ci] fix: Declaration hides parameter
A local variable hides a parameter. This may be confusing. Consider renaming one of them.
2020-07-27 10:57:34 +02:00
Zheng, Lei
536051179b 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
wmayer
f3b460e42e boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
4ec45b545e 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
wmayer
66e546042f Gui: [skip ci] move handling of parameter ShowAxisCross from Document to View3DInventor 2020-05-30 11:32:34 +02:00
Adrian
90bc7789d2 Improve Axis Cross behavior and expose parameter to 3D View preferences 2020-05-30 11:17:38 +02:00
wmayer
be1fd42554 Gui: [skip ci] make it configurable to set size of thumbnails 2020-03-19 16:16:17 +01:00
luz.paz
c7d3ae2d83 [skip ci] Fix typo (crowdin)
ref: https://crowdin.com/translate/freecad/549/en-eu#6577888
2020-03-11 10:56:45 +01:00
wmayer
fba86d171c Gui: [skip ci] fix regression in Document::setEdit()
For more details see: https://forum.freecadweb.org/viewtopic.php?f=19&t=43629&p=371972#p371972
2020-02-25 17:10:42 +01:00
Zheng, Lei
cd7fb70d1f Gui: fix crash on Document resetEdit 2020-02-13 15:27:49 +01:00
Rajendra Pardeshi
28d67eba2e Issue ID 0004230 : Fixing a crash in chamfer command. Putting a null check for the function return value
[skip ci]
2019-12-30 15:49:51 +01:00
wmayer
eb4e2d2c56 Gui: add virtual method containsViewProvider to MDIView and re-implement it in some sub-classes
Improve Document::setActiveView to not always switch to the first 3D view but check the currently active view before
2019-12-29 15:00:35 +01:00
Zheng, Lei
df548bf82e Gui: fix Document::signalInEdit
Make it sure it is signaled with the correct document
2019-12-21 15:26:02 +01:00
Zheng, Lei
1cbec1a60d Gui: fix Std_Transform tool
The problem is caused by tracking of editing object placement
introduced in 719c11e714.

After this commit, any editing object can disable placement tracking by
calling Gui::Document::setEditingTransform() inside either
ViewProvider::startEditing() or setEditingViewProvider().
2019-12-21 15:17:48 +01:00
Zheng, Lei
719c11e714 Gui: track editing object placement change 2019-12-08 14:46:34 +01:00
wmayer
bf4bf624a4 for restored view providers of a redo again call handleChildren3D() to update scene graph 2019-11-29 22:24:16 +01:00
asapelkin
e951094af9 use emplace_back instead of push_back where justified 2019-11-21 14:48:09 +01:00
wmayer
1e7628f436 convert enum to enum class to fix -Wgnu-redeclared-enum 2019-11-13 22:39:27 +01:00
Zheng, Lei
6663d625a9 Gui: add new API ViewProviderDocumentObject::allowOverride()
This API is used to delcare if a view provider can be used as an
override for a give object.

Conflicts:
	src/App/DocumentObject.h
2019-10-06 17:22:57 +02:00
luz.paz
7b7797f4f3 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
d2be4f115d fix further file names vulnerabilities in core system and Image module 2019-10-02 15:07:13 +02:00
wmayer
3ccba4c64b when cloning a 3d view then also set the new view into edit mode in case the original view is 2019-10-01 19:35:51 +02:00
wmayer
f24c097a5a make sure resetting a document while closing it works independently of the activw view 2019-10-01 16:37:07 +02:00
Zheng, Lei
fd0f4f5654 Split App::AutoTransaction into its own file 2019-09-10 14:17:07 +02:00
Zheng, Lei
4141242e9d Gui: minor adjustment on command status update 2019-09-10 14:17:07 +02:00
wmayer
6195b5e9ef avoid explicit cast to ZipInputStream in Gui::Dcoument class 2019-09-06 12:37:09 +02:00
wmayer
10cd535ceb use shared_ptr to avoid possible memory leaks and improve exception-safety 2019-09-03 17:21:13 +02:00
Jean-Marie Verdun
27e7b9913a Add initial version of the Cloud workbench 2019-09-03 17:21:05 +02:00
Zheng, Lei
f7d416d15e Gui: auto close transaction on Document resetEdit 2019-08-30 15:49:59 +02:00
wmayer
b1551934b4 Add parameter to suppress touching a document when a view provider has been modified 2019-08-24 15:54:41 +02:00
wmayer
1e19ef5be4 issue #0004088: Visibility of origin feature of Part container changes when undocking the 3d view 2019-08-24 13:33:21 +02:00