Commit Graph

167 Commits

Author SHA1 Message Date
Uwe
a65c88d3c5 [Gui] ViewProviderLink etc.: remove unused includes
- also put headers to PreCompiled.h
2022-03-06 01:11:42 +01:00
wmayer
92505fb8ea Gui: [skip ci] std::isspace requires cctype header 2022-02-28 12:37:09 +01:00
Uwe
16467d9067 Revert "App: fix property ordering problem when undo/redo (#3255)"
This reverts commit 24d30636e4fb990fdbd67538360846ff09456dfc.
2022-02-22 01:21:49 +01:00
Zheng Lei
170a12089c App: fix property ordering problem when undo/redo (#3255)
* Part: fix Placement/Shape onChanged() handling

* App: fix property ordering problem when undo/redo
See https://tracker.freecadweb.org/view.php?id=4265#c14271

* Gui: fix undo/redo signaling
Make sure to signal after all properties has been restored
2022-02-21 12:29:01 +01:00
Uwe
eaaeef80e1 [Gui] Application and Document: remove unused headers 2022-02-19 05:37:40 +01:00
wmayer
6f3446d19e Gui: force a redraw of the 3d view when creating it as otherwise on some systems the bottom and right side of the main window becomes black 2022-02-05 17:56:52 +01:00
Zheng, Lei
4d82c5d319 Gui: do not prompt when closing view of temp document 2021-12-21 21:41:02 -07:00
Chris Hennes
ded7adb798 Revert "Merge pull request #4626 from pavltom/GUI_TreeView_Item_Ordering"
This reverts commit b0452667c72f330323f6b3366f45bf039d05feef, reversing
changes made to b2d99f3fa7b4c7c305aed4a8d975a8624a6d590f.

See forums discussion: https://forum.freecadweb.org/viewtopic.php?p=549120
2021-11-24 09:03:35 -06:00
wmayer
b48647fb1e Gui: [skip ci] fix -Wmultichar 2021-11-23 00:33:12 +01:00
luz paz
a07c7e4333 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
8d1735741b 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
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
Tomas Pavlicek
17f328c7a9 [Gui] Issue #3923 - Arbitrary Tree item ordering + tests 2021-10-26 19:09:34 +02:00
wmayer
cac50da55b Gui: move handling of failed document saving to a function to reduce code duplication 2021-10-20 21:57:51 +02:00
wmayer
5cff5654ca Gui: [skip ci] handle exception text as UTF-8 encoded string when saving failed 2021-09-29 14:03:51 +02:00
Chris Hennes
860f46ac6c 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
9a23ffb35a Gui: fix typos 2021-09-17 08:28:34 +02:00
Ajinkya Dahale
c123bc2bf8 [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
5a2e40c3f5 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
a522f4a240 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
1d4edddddb 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
98f63ba60f 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
a7506326c9 Gui: [skip ci] avoid adding a wrong file name to the recent files list 2020-12-18 14:35:17 +01:00
luz paz
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
bf7ebdf8c5 Gui: [skip -ci] fix Document::toggleInSceneGraph() to avoid to add a node twice 2020-09-25 13:05:45 +02:00
luz paz
6f62fd09df 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
dcae039c52 App/Gui: warn when loading/saving file with identical physical path 2020-08-31 14:05:14 +02:00
wmayer
45e0673645 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
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
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
wmayer
d3b8906dd0 Gui: [skip ci] move handling of parameter ShowAxisCross from Document to View3DInventor 2020-05-30 11:32:34 +02:00
Adrian
1f63355c06 Improve Axis Cross behavior and expose parameter to 3D View preferences 2020-05-30 11:17:38 +02:00
wmayer
6f80d466ad Gui: [skip ci] make it configurable to set size of thumbnails 2020-03-19 16:16:17 +01:00
luz.paz
268637a042 [skip ci] Fix typo (crowdin)
ref: https://crowdin.com/translate/freecad/549/en-eu#6577888
2020-03-11 10:56:45 +01:00
wmayer
43295895d6 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
6556276c5a Gui: fix crash on Document resetEdit 2020-02-13 15:27:49 +01:00
Rajendra Pardeshi
c16b0e4e61 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
c5c3b41c8f 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
f7fb8e349d Gui: fix Document::signalInEdit
Make it sure it is signaled with the correct document
2019-12-21 15:26:02 +01:00
Zheng, Lei
2f53721d9d Gui: fix Std_Transform tool
The problem is caused by tracking of editing object placement
introduced in b25ad5e085a42800c0ebd7a507233f081fcee7ef.

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
fce44f1423 Gui: track editing object placement change 2019-12-08 14:46:34 +01:00
wmayer
11e64ed3df for restored view providers of a redo again call handleChildren3D() to update scene graph 2019-11-29 22:24:16 +01:00
asapelkin
ced8100ab9 use emplace_back instead of push_back where justified 2019-11-21 14:48:09 +01:00
wmayer
f14371bc06 convert enum to enum class to fix -Wgnu-redeclared-enum 2019-11-13 22:39:27 +01:00
Zheng, Lei
2df3052ecf 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
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
wmayer
9e5ab2d6fa 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
736417989b make sure resetting a document while closing it works independently of the activw view 2019-10-01 16:37:07 +02:00