Commit Graph

173 Commits

Author SHA1 Message Date
Zheng, Lei
ebf321fc47 Implementation of Link
This patch includes the actual implementation of Link, which is
implemented as an extension named LinkBaseExtension in App namespace,
and a full view provider ViewProviderLink in Gui. The reason of not
using ViewProviderExtension is because it need full control when
display, not just extending existing functionalities.

Please see [here](https://git.io/fjPue) for more details of the
implementation.

This patch also includes a set of link manipulation commands, and a
task panel for overriding geometry element colors.
2019-08-17 15:08:33 +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
wmayer
b35966cd00 set Qt::AA_ShareOpenGLContexts for Qt5.9 2019-06-05 09:43:47 +02:00
wmayer
c10de2f744 Qt WebEngine seems to be initialized from a plugin. Please set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute before constructing QGuiApplication 2019-06-05 07:28:02 +02:00
wmayer
737e82c053 handle eventual system error messages 2019-05-21 15:44:49 +02:00
luz.paz
06d583b425 Misc typos and whitespace fixes
Found via `codespell -q 3 -I ../fc-word-whitelist.txt -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*`
2019-03-31 11:42:36 +02:00
wmayer
d2e8fd3bbf make 3d view creation working with Qt 5.12 2019-03-23 21:18:18 +01:00
wmayer
25f180e4d3 allow to define custom background images 2019-03-06 11:09:14 +01:00
wmayer
6730ffebd8 improve exception handling if module to load a file cannot be imported 2019-02-12 13:07:48 +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
ickby
761881fe99 Expose edit signals to Gui observer 2018-10-08 11:06:04 +02:00
wmayer
506f50788b when loading file by drag and drop then create the objects in the active document
if no document exists then use i18n to translate the document name
2018-09-15 19:14:46 +02:00
wmayer
ef42cfb5d6 add method to activate 3d view when setting active object list 2018-09-12 15:38:28 +02:00
luz.paz
69d46d1b43 Misc. typo and whitespace fixes
`codespell -q 3 -I ../fc-word-whitelist.txt --skip=".git,*.ts,*.po,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/zipios++"`
2018-09-11 07:27:22 +02:00
wmayer
f2ec0eaca3 enable VBO support for Intel graphic drivers if UseVBO is activated 2018-09-03 16:57:33 +02:00
wmayer
b761262dc3 enable VBO support for Intel graphic drivers if UseVBO is activated 2018-09-03 16:46:54 +02:00
wmayer
8f1ef0d90c get rid of private function _PyImport_FixupBuiltin for FreeCAD and FreeCADGui modules 2018-09-01 19:57:15 +02:00
wmayer
78efe74229 number of used decimals in UnitsApi must already be set when initializing App 2018-08-29 23:35:38 +02:00
wmayer
e532f3fd88 for Qt5 no explict event processing after creating a 3d view 2018-08-09 18:57:21 +02:00
wmayer
e60d0027a2 add some convenience methods for initialization process 2018-08-09 18:41:40 +02:00
wmayer
49e9154b40 quit event loop after closing main window if not started by an extern host application 2018-08-09 17:03:01 +02:00
Yorik van Havre
e64657abe0 allow to disable version number in window title 2018-07-07 20:12:43 -03:00
Danilo Oliveira
0b94e1b223 Add version info to window title
Fix issue 3499
by The Wikilab Team (wikilab.blog.br)
2018-07-06 09:55:44 -03:00
wmayer
ec36f0cfe4 fix Linux build failure 2018-04-27 14:47:19 +02:00
wmayer
41219c3467 improve icon theme handling 2018-04-27 13:27:45 +02:00
wmayer
1b5995d787 workaround for bug in VS 2013 that occurs at Python init time 2018-04-15 19:05:06 +02:00
wmayer
185002d4e5 fixes #0002621: Exporting with File Type *.svg, *.svgz, *.dxf should be prevented if not in Drawing WB 2018-01-02 16:28:24 +01:00
luzpaz
8200c97ed2 Fix Techdraw UI typo found via crowdin + misc. typos
Ref: https://crowdin.com/translate/freecad/27911/en-eu#6503377
2017-11-26 15:48:20 +01:00
wmayer
6a24bc9602 add class ViewProviderDragger
derive ViewProviderGeometryObject from ViewProviderDragger
derive ViewProviderPart from ViewProviderDragger
2017-11-26 15:42:57 +01:00
wmayer
da4d35ac89 improvements of wait cursor
make filtering of modal dialogs working with Qt5
save/restore filter flags
don't filter events for File > Export
when using showPreferences don't show wait cursor
2017-10-22 19:49:56 +02:00
Unknown
8d9bd319bd Misc. Typos 2017-10-09 19:59:33 +02:00
wmayer
fde42545ba fix various coverity issues 2017-09-15 11:48:38 +02:00
Stefan Tröger
1a3fb02eb9 Move App::Part to a separate global toolbar 2017-09-09 16:47:07 +02:00
Markus Hovorka
f9f2d8c31b Add TextDocument with full size editor
A new document object App::TextDocument. It has a property Text which
holds the text of the document as a string. This commit also contains a
full size editor based on QPlainTextEdit. It can only be used by the
TextDocument and has a read only mode invoked for read only documents
(ReadOnly property set to true). The editor is invoked by a double
click on the TextDocument.
2017-07-04 19:36:10 +02:00
wmayer
4cda387e61 py3: support of Python 3.4 2017-06-06 23:49:42 +02:00
wmayer
729cfd8155 py3: fox compiler warnings
issue 0000995
2017-06-04 00:17:57 +02:00
wmayer
0e605eccb3 workaround for broken tree indicators with Qt 5.6 under Windows 2017-05-20 21:21:30 +02:00
Yorik van Havre
7e39fed862 py3: Gui: files A-P ported to python3 2017-05-06 17:23:27 +02:00
triplus
4bf27344c8 Boot phase reference point 2017-05-04 20:03:34 +02:00
wmayer
fb7094bf31 use specialized exception classes 2017-04-28 18:49:11 +02:00
wmayer
c526c18b94 fix scan coverity issues: uncaught exception 2017-04-11 14:03:08 +02:00
wmayer
e4cba8e80f add new signal to Document class for convinience and add method to DocumentObserver 2017-04-07 15:14:45 +02:00
wmayer
1565139b20 Qt5OpenGL: at startup determine some basic information about OpenGL setup 2017-03-21 20:37:03 +01:00
wmayer
9e42badfaf move QuarterWidget to QOpenGLWidget 2017-03-21 20:37:03 +01:00
Bruce B. Lacey
f536dbe1d2 Qt5: Enabled HiDPI scaling and Use HiDPI Qt Pixmaps
* Enable HiDPI scaling on displays that support it
    on Qt 5.6 and later
  * Enable HiDPI Pixmaps on Qt 5.1 and later
2017-03-03 11:58:38 -03:00
Bruce B. Lacey
b601ea32f5 Use scalable application icon resources on macOS
Fixes #2920
2017-02-23 20:27:55 -08:00
wmayer
86c4d8bc9c issue #0002891: Sketching impossible, Type.Error Exception 2017-02-09 12:46:58 +01:00
wmayer
953749e330 add observer for GUI documents 2017-01-22 19:05:13 +01:00