Commit Graph

211 Commits

Author SHA1 Message Date
wmayer
f129f3f097 Gui: [skip ci] workaround to allow to define the link color of the application's palette 2020-10-08 11:32:17 +02:00
wmayer
a299f234a0 Gui: [skip ci] fix appearance of TaskGroups when a style sheet is set 2020-10-06 18:20:34 +02:00
wmayer
c3a8fcf594 Gui: [skip ci] fix handling of active document when importing a file 2020-10-06 12:33:35 +02:00
mwganson
c4ff3385f5 [File Import] add import to document transaction for unde/redo 2020-10-06 11:56:11 +02:00
wmayer
6d03265729 Gui: [skip ci] fix initialization of Python-based view providers in FreeCADGui.subgraphFromObject 2020-09-26 22:39:18 +02:00
wmayer
ffa1da617f Python: [skip ci] expose Python types in their corresponding modules 2020-09-21 15:04:26 +02:00
wmayer
9b529bc45c Gui: [skip ci] move Python functions for commands to its own class 2020-08-02 20:50:43 +02:00
wmayer
767b2787c1 LGTM: [skip ci] remove some obsolete FIXME comments from source code 2020-07-28 09:49:20 +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
Zheng, Lei
1c8ad8731d Gui: update command actions after sending message to view 2020-07-06 16:38:11 +02:00
wmayer
f948a39bdb Gui: export scene graph to file or buffer 2020-06-29 15:27:52 +02:00
wmayer
87046ef045 GuiPy: [skip ci] expose function to Python to replace Switch with Separator nodes 2020-06-20 12:22:24 +02:00
wmayer
0d05fc328d GuiPy: [skip ci] handle some Qt warnings when using GUI from Python
+ avoid warning: QEventLoop: Cannot be used without QApplication
+ avoid warning: QObject::startTimer: Timers can only be used with threads started with QThread
2020-06-20 11:43:59 +02:00
wmayer
70b2d49550 Gui: [skip ci] fix Gui.subgraphFromObject and improve error text if wrapping fails 2020-06-19 15:07:57 +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
c90db64188 Gui: [skip ci] wheel event filter for combo boxes 2020-05-22 10:42:38 +02:00
wmayer
7d18017b49 Gui: [skip ci] fix regression in Application::open() and always encode file name when passing it to Python interpreter 2020-04-02 11:55:45 +02:00
wmayer
ec8b1bc072 [skip ci] use QLocale class consistently to make it possible to change it application-wide 2020-03-26 16:37:45 +01:00
wmayer
ce3eadf289 Gui: [skip ci] implement Python wrapper for ExpressionBinding 2020-03-25 13:22:18 +01:00
wmayer
1fc309bb58 Gui: [skip ci] simplify Application::setStyleSheet and directly check if the passed file name exists 2020-03-19 19:37:49 +01:00
wmayer
d496e714c9 Gui: move handing of style sheets to Application::setStyleSheet to avoid code duplication 2020-03-19 15:57:20 +01:00
triplus
af5e7abe46 Use relative path to stylesheet fix #4130 2020-03-19 14:25:03 +01:00
Zheng, Lei
cd7fb70d1f Gui: fix crash on Document resetEdit 2020-02-13 15:27:49 +01:00
triplus
c420de0f9b Option to opt-out from using a Linux desktop icon theme. 2020-02-08 12:31:34 +01:00
Zheng, Lei
992dc49ece Do not throw error when open an already opened document 2020-02-05 11:12:00 +01:00
luz.paz
f11783a498 src/Gui: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/Gui` files
2019-12-25 11:39:17 +01:00
wmayer
ef73ab5f3a [skip ci] minor changes 2019-11-18 16:35:29 +01:00
Markus Lampert
c43cca3254 Set QT settings before creating QCoreApplication. 2019-11-17 13:00:42 -03:00
wmayer
fd9054b3bf [skip ci] support of style sheet in branding framework 2019-11-09 17:36:49 +01:00
Markus Lampert
c6c761b812 Added <last> as an option to the workbench selection. 2019-11-01 17:42:14 -03: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
2a3d398a9b change order of beforeDelete() and clearing selection inside Application::slotDeleteDocument to prevent crashes in case resetting a view provider touches the selection 2019-10-01 16:33:37 +02:00
wmayer
5de6763ed5 add escape sequence when executing as Python string 2019-09-28 23:35:08 +02:00
wmayer
1bfe0f3bea fixes #0004125: MDIViews not accessible correctly 2019-09-15 18:15:44 +02:00
Zheng, Lei
4141242e9d Gui: minor adjustment on command status update 2019-09-10 14:17:07 +02:00
Zheng, Lei
bc26820837 Gui: Placement/DatumCS view provider changes
* Add always zoom invariant and always on top rendering to
  ViewProviderDatumCS

* Add a new utility class AxisOrigin for more efficient axis rendering.
  Also exposed to python.

* Change ViewProviderPlacement to use AxisOrigin for rendering.
  A single instance of AxisOrigin is shared by all
  ViewProviderPlacement. Selection context is used to distinguish among
  different instances.
2019-08-17 15:08:34 +02:00
Zheng, Lei
2a6bd5e464 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
bd2f5191c9 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
00bcef0619 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
57b3ca6f77 set Qt::AA_ShareOpenGLContexts for Qt5.9 2019-06-05 09:43:47 +02:00
wmayer
2a1dd8415d 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
5aff1c9188 handle eventual system error messages 2019-05-21 15:44:49 +02:00
luz.paz
c985f9ee79 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
763c2b22fe make 3d view creation working with Qt 5.12 2019-03-23 21:18:18 +01:00
wmayer
c3fb5edc41 allow to define custom background images 2019-03-06 11:09:14 +01:00
wmayer
aee5b0213b improve exception handling if module to load a file cannot be imported 2019-02-12 13:07:48 +01:00
Mateusz Skowroński
317bcd59c9 Use QString's multi-arg overload to save memory allocations. [-Wclazy-qstring-arg] Thanks Clazy! 2019-02-11 15:39:14 +01:00
wmayer
f898eafd64 move from deprecated boost.signals to boost.signals2 library 2018-10-30 19:09:03 +01:00