Commit Graph

141 Commits

Author SHA1 Message Date
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
Zheng, Lei
f1b569621a Split App::AutoTransaction into its own file 2019-09-10 14:17:07 +02:00
Zheng, Lei
f55b4ca7f7 Gui: minor adjustment on command status update 2019-09-10 14:17:07 +02:00
wmayer
7ee903f27c avoid explicit cast to ZipInputStream in Gui::Dcoument class 2019-09-06 12:37:09 +02:00
wmayer
f88dad0905 use shared_ptr to avoid possible memory leaks and improve exception-safety 2019-09-03 17:21:13 +02:00
Jean-Marie Verdun
a2e21f79f2 Add initial version of the Cloud workbench 2019-09-03 17:21:05 +02:00
Zheng, Lei
18dffcba47 Gui: auto close transaction on Document resetEdit 2019-08-30 15:49:59 +02:00
wmayer
5af586b92e Add parameter to suppress touching a document when a view provider has been modified 2019-08-24 15:54:41 +02:00
wmayer
fd90936b5d issue #0004088: Visibility of origin feature of Part container changes when undocking the 3d view 2019-08-24 13:33:21 +02:00
wmayer
ea49e40b78 fix msvc build failure 2019-08-17 17:12:42 +02:00
Zheng, Lei
5f5ea31ec8 TreeView: update status on manual object touch 2019-08-17 15:32:51 +02:00
Zheng, Lei
31626d5c85 Gui::Document: fix saving of camera setting 2019-08-17 15:32:50 +02:00
Zheng, Lei
648f5e6d5b Gui: fix auto view switching of editing object 2019-08-17 15:32:50 +02:00
luz.paz
63a577fe07 Fix typos in src/Gio 2019-08-17 15:32:49 +02:00
Zheng, Lei
0c6b1a5d69 Gui: Application/Document/MainWindow changes following App namespace
Application:

* signalNewDocument, check the extra argument, isMainDoc, the decide
  whether to create view of the new document. This is so that external
  linked document can be opened in background without crowding the tab
  list.

* slotDeleteDocument, calls Document::beforeDelete()

* slotActiveDocument, creates view if none, because external document
  is now opened without view.

* onLastWindowClosed(), switch to next active document, and creates view
  if none.

* send(Has)MsgToFocusView(), new API to send message to the active view
  in focus. This is to solve the ambiguity of things like pressing
  delete key, copy, paste handling when the active new is not in focus.
  For example, when spread sheet view is active, delete/copy/paste
  handling should be different when the focus on the spread sheet view
  or focus on tree view.

* tryClose(), delegate to MainWindow for close confirmation

* reopen(), new API to reload a partial document in full

Document/DocumentP:

* _CoinMap, new internal map for quick access view provider from its
  root node.

* slotNewObject, modified to support view provider override from
  App::FeaturePython, through new API
  DocumentObject::getViewProviderNameOverride().

* slotDeletedObject/slotTransactionRemove, improve handling of geo group
  children rebuild

* slotSkipRecompute, add special handling of document with skip
  recompute. Some command cannot work when skip recompute is active.
  For example, sketcher command will check if recompute is successful
  on many commands, and will undo if not. New 'PartialCompute' flag is
  added to allow recompute only the editing object and all its
  dependencies if 'SkipRecompute' is active.

* slotTouchedObject, new signal handling of manually touched object.

* setModified(), do nothing if already modified. This is a critical
  performance improvement, because marking tab window as modified turns
  out to be a relatively expensive operation, and will cause massive
  slow down if calling it on every property change.

* getViewProviderByPathFromHead/getViewProvidersByPath(), new APIs to
  obtain view provider(s) from coin SoPath.

* save/saveAll/saveCopy, modified to support external document saving.

* Save/RestoreDocFile(), save and restore tree item recursive expansion
  status.

* slotFinishRestoreObject(), handle new signal
  signalFinishRestoreObject(), unifies postprocessing in restore and
  import operation.

* createView/setActiveView(), add support of delayed view creations

* canClose(), delegate to MainWindows to ask for confirmation

* undo/redo(), support grouped transaction undo/redo. Transactions may
  be grouped by the same transaction ID if they are triggered by a
  single operation but involves objects from multiple documents.

* toggleInSceneGraph(), new API to add or remove root node from or to
  scenegraph without deleting the view object.

MainWindow:

* Update command status using a single shot timer instead of periodical
  one.

* Improve message display is status bar. Give error and warning message
  higher priority (using QStatusBar::showMessage()) than normal status
  message (using actionLabel), reversed from original implementation.

* confirmSave(), new API to check for modification, and ask user to save
  the document before closing. The confirmation dialog allows user to
  apply the answer to all document for convenience.

* saveAll(), new API to save all document with correct ordering in case
  of external linking.

* createMimeDataFromSelection/insertFromMimeData(), support copy paste
  object with external linking. A new dialog DlgObjectSelection is used
  to let user select exactly which object to export.

CommandDoc/CommandWindow:

* Related changes to object delete, document import, export, and save.
2019-08-17 15:08:33 +02:00
Zheng, Lei
d4ac072306 Gui: support in-place editing
The link support means that an object can now appear in more than one
places, and even inside a document different from its own. This patch
adds support for in-place editing, meaning that the object can be edited
at correct place regardless where it is.

See [here](https://git.io/fjPIk) for more info about the relavent APIs.

This patch includes two example of modifications to support in-place
editing. One is the ViewProviderDragger, which simply adds the dragger
node to editing root node by calling
View3DInventorViewer::setupEditingRoot(dragger). The other much more
complex one is ViewProviderSketch which calls setupEditingRoot(0) to
transfer all its children node into editing root. ViewProviderSketch
also includes various modifications to command invocation, because we
can no longer assume the active document is the owner of the editing
object.

This patch also includes necessary modification of the 'Show' module to
support in-place editing.
2019-08-17 15:08:32 +02:00
Zheng, Lei
5214f5b7ce Gui: add coinRemoveAllChildren to work around Coin3D bug
See bug description:
https://bitbucket.org/Coin3D/coin/pull-requests/119/fix-sochildlist-auditing/diff

Because of path based rendering (SoFCPathAnnotation) in mouse over
highlight, this bug causes crash more frequently here comparing to
upstream.

All C++ calling of SoGroup::removeAllChildren() is replaced by
Gui::coinRemoveAllChildren(), and python code is fixed by monkey
patching SoGroup.removeAllChildren() in FreeCADGuiInit.py.
2019-08-17 14:52:11 +02:00
wmayer
7646e54580 fixes 0003986: Changing view attributes does not trigger 'File changed' status 2019-05-26 23:25:58 +02:00
wmayer
140979a278 fix saving view provider attributes for Copy&Paste or Duplicate selection 2019-02-28 18:48:30 +01:00
wmayer
1308a02c83 when restoring object then only expand single items, not its parent items 2019-02-24 00:37:53 +01:00
Mateusz Skowroński
ac508516da Use QString's multi-arg overload to save memory allocations. [-Wclazy-qstring-arg] Thanks Clazy! 2019-02-11 15:39:14 +01:00
wmayer
36271b4052 move from deprecated boost.signals to boost.signals2 library 2018-10-30 19:09:03 +01:00
wmayer
f513305916 fix crash with Py3 when releasing memory buffer 2018-10-29 11:59:34 +01:00
wmayer
addb742b3c minor fixes 2018-10-08 12:27:03 +02:00
wmayer
b129511910 fixes #0003540: Body invisible after deleting Part container 2018-09-21 15:12:38 +02:00
wmayer
ef42cfb5d6 add method to activate 3d view when setting active object list 2018-09-12 15:38:28 +02:00
wmayer
dd0b80e5c1 fix possible stack overflow when finishing edit mode 2018-05-24 19:37:16 +02:00