Commit Graph

117 Commits

Author SHA1 Message Date
Chris Hennes
86a44c9824 Gui: Wrap PyArg_ParseTupleAndKeywords 2023-08-25 15:34:26 -05:00
Tobias Falk
5965956293 added PDF/A-1b compliancy to all PDF export functions
for more details about this look at: https://www.kdab.com/creating-pdfa-documents-qt/
2023-08-05 14:46:11 -06:00
Paddle
f3d5b204d2 Core: WorkbenchComboBox and WorkbenchGroup simplification. 2023-05-22 10:13:13 +02:00
Chris Hennes
273943a42c GUI: Translate the tooltip for EditMode menu
The tip text was extracted from the Wiki.
2023-04-21 16:55:05 -05:00
Paddle
ec2e5fe2ac Pref: Wb: remove args first element on restart.
- isRebootRequired is not public but in accept&reject.
- PreferencePage::isRebootRequired changed to const
- Change 2 warnings to log
- remove useless  c_str()
- Change DlgPreferencesImp::isRebootRequired name + reboot by restart everywhere.
- Sort workbenches so that disabled wb are sorted.
2023-03-31 14:12:27 +02:00
Paddle
8d16cf7395 Pref: - add require-reboot capability to PreferencePage.
- Implement this require-reboot in wb pref page
2023-03-28 15:18:23 +02:00
wmayer
77ecde6527 Core: use FileHandler in Application::sOpen and Application::sInsert 2023-03-22 15:14:45 +01:00
berniev
75acacd1b7 Gui: Use auto and range-based for (#7481)
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. 
* When possible use a ranged for loop instead of begin() and end() iterators
2022-09-14 13:25:13 -05:00
wmayer
201f4c9a5a Core: replace PyObject_IsTrue with Base::asBoolean 2022-07-16 14:04:05 +02:00
wmayer
e9890c0798 Gui/Mod: replace several reinterpret_cast with static_cast 2022-06-25 11:36:55 +02:00
marioalexis
f78412c75b Gui: Use PyObject_IsTrue in combination with conditional ternary operator 2022-06-22 19:50:03 -04:00
wmayer
1383b47659 Test: [skip ci] add unit tests for PR #6907 2022-05-24 14:17:44 +02:00
wmayer
96adb98f46 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
wmayer
9160f06e1c Base: rename BaseExceptionFreeCADError to PyExc_FC_GeneralError 2022-03-17 14:45:48 +01:00
wmayer
d69defaa3c Py: replace BaseExceptionFreeCADError with more suitable exception types 2022-03-17 13:54:23 +01:00
Uwe
471ae07025 [Gui] move xerces to precompiled header
as suggested here: https://github.com/FreeCAD/FreeCAD/commit/95c70e7f#r68066840
2022-03-06 15:53:13 +01:00
Uwe
5f092f9072 [Gui] fix when compiling with PCH 2022-03-05 15:01:55 +01:00
wmayer
95c70e7f4c App: use forward declarations 2022-03-04 21:09:46 +01:00
Uwe
7518dad67b [Gui] compilation fixes for non-PCH
the recent commits were done with PCH, this is the final commit of today's header work for PCH
2022-02-19 06:22:08 +01:00
Uwe
dd5a681fd8 [Gui] remove unused headers 2022-02-19 03:41:28 +01:00
Maël Kerbiriou
08c41ffb00 Gui: replace s# format unit with s* 2022-02-09 19:29:56 +01:00
wmayer
49539c1998 Gui: [skip ci] replace tabs with spaces, replace NULL with nullptr 2022-02-03 09:56:46 +01:00
marioalexis
5afbdd5f6b Gui: Improve the docstrings and clean up code in ApplicationPy.cpp 2022-02-03 08:21:23 +01:00
wmayer
6bf724cca9 Gui: extend PySide2 wrapper of MainWindow with extra functions 2021-11-19 15:45:56 +01:00
wmayer
09da245af9 App: harmonize API of App::Application
* make getHomePath() static and return a std::string
* make getExecutableName() static and return a std::string
2021-11-04 10:50:09 +01:00
wmayer
00759f9c96 Gui: move PythonWrapper class to its own source file 2021-09-22 23:30:03 +02:00
0penBrain
032f743fbf [Gui] Introducing user edit mode 2021-05-14 09:23:04 +02:00
wmayer
1aad309886 Gui: remove some more deprecated Py2 2021-04-26 10:59:32 +02:00
luz paz
6a7184139d Gui: remove Py2 code from several src/Gui .cpp files 2021-04-14 14:56:02 +02:00
luz paz
472168fc15 Fix typos [skip ci]
Typos ffound via `codespell v2.1.dev0`  
Also includes fixes in deprecated code of `src/Mod/Assembly`
2020-12-28 23:14:04 +01:00
luz paz
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
623d6b7134 Gui: [skip ci] add x3d and xhtml format to export dialog 2020-09-07 16:27:21 +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
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
mwganson
8565736dea avoid saving to parameters if new shortcut is the default, better check for if setting shortcut was success 2020-07-20 14:11:14 +02:00
mwganson
43be29c3b1 return false when unable to set shortcut 2020-07-20 14:11:14 +02:00
Mark Ganson TheMarkster
42a4b11d1f convert tab to spaces 2020-07-20 14:11:14 +02:00
Mark Ganson TheMarkster
c437ab007c move preprocessor directives back to column 1 2020-07-20 14:11:14 +02:00
Mark Ganson TheMarkster
5c42e35f52 remove some commented lines 2020-07-20 14:11:14 +02:00
mwganson
5f347447b1 [Python Gui] add new command Gui.setCommandShortcut(), fix bug in Gui.getCommandShortcut() and Gui.getCommandInfo() where user has changed shortcut via customize dialog, but these 2 commands returned previous default information 2020-07-20 14:11:14 +02:00
mwganson
f956a00baa add getCommandInfo() rename getShortcut to getCommandShortcut 2020-04-09 11:43:50 +02:00
mwganson
94215c1716 [skip ci] Add getShortcut(string) command to Gui, returns string value representing shortcut key accelerator for this command 2020-04-09 11:43:50 +02:00
Zheng, Lei
b322969752 Gui: fix FreeCADGui.loadFile() 2020-03-01 16:29:47 +01:00
Zheng, Lei
992dc49ece Do not throw error when open an already opened document 2020-02-05 11:12:00 +01:00
Zheng, Lei
8516c6fbe3 Gui: fix Gui.addCommand() in Python3 2019-12-09 00:37:34 +00:00
Markus Lampert
7c9e044199 Fixed updateCommand definition for python 2019-09-27 11:11:47 +02:00
Zheng, Lei
c3fe336dc5 Gui: add Gui.updateCommands() for manual command status update 2019-09-10 14:17:07 +02:00
Zheng, Lei
f8e1d455e0 Gui: improve Gui.addIcon(), add Gui.isIconCached()
The motivation of this patch is to make it easy for Python workbench
cache its own icons (possibly generated at runtime), saving the trouble
of pre-compiling the icons as binary resources.

* Gui.addIcon() now support a third argument as format. Default format
  is 'XPM' as before. The intention is to allow user to cache other
  format of icon image, like 'PNG'.

* ViewProviderPythonFeature::getIcon() now checks if the given string
  argument is a key to a cached icon.
2019-09-07 16:01:19 +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