Commit Graph

5762 Commits

Author SHA1 Message Date
wmayer
24cb532182 Gui: Remove bounding box computation from SoDatumLabel::GLRender() 2023-09-17 19:27:12 +02:00
wmayer
99358cd063 Gui: fix clang-tidy warnings in EditableDatumLabel
and fix two further memory leaks
2023-09-17 19:11:31 +02:00
wmayer
10a60f2ec5 Gui: fix clang-tidy warnings in TaskImage 2023-09-17 19:11:31 +02:00
Paddle
4079c924d9 TaskImage: remove the spinbox/sodatumLabel gestion and use the global EditableDatumLabel instead. 2023-09-17 13:05:53 +02:00
Paddle
620c2ce239 Introduce EditableDatumLabel. A class that handles a SoDatumLabel with a spinbox to edit its value. 2023-09-17 13:05:53 +02:00
Paddle
a13b05d877 SoDatumLabel: Make the textOffset persistent. 2023-09-17 13:05:53 +02:00
AgCaliva
64f60721a9 merge master via cli 2023-09-16 02:12:58 -03:00
AgCaliva
b360b43ebe Fixing DOMDocument redefinition 2023-09-16 00:38:41 -03:00
luzpaz
3518ace910 Fix typos 2023-09-14 20:53:04 -05:00
wmayer
dc6ce5a08b Gui: implement handling of Combo, Property and Tree view 2023-09-14 13:35:13 +02:00
wmayer
4fcddc71ab Gui: rework ComboView 2023-09-14 13:24:24 +02:00
wmayer
23c5b330d9 Gui: add TaskView to its own dock window 2023-09-14 13:17:33 +02:00
wmayer
ad10a01ad9 Gui: determine the bounding box of an SoDatumLabel outside its GLRender() method 2023-09-13 16:56:53 +02:00
wmayer
d9d7bf87ae MSVC: fix several compiler warnings 2023-09-12 22:57:26 +02:00
sliptonic
adec096db4 Merge pull request #10529 from wwmayer/cancel-button-feature
Gui: Add cancel button to transform task UI dialog
2023-09-11 10:55:00 -05:00
sliptonic
a99706ff68 Merge pull request #10586 from wwmayer/issue_9422
Gui: fixes issue #9422: Dependency Graph: export to .dot/.gv
2023-09-11 10:39:00 -05:00
Yorik van Havre
dee27e4098 Merge pull request #10619 from wwmayer/fix_issue_10617
Gui: fixes #10617: Ctrl+C only stop python running in console not from macros
2023-09-11 17:36:43 +02:00
sliptonic
f944083818 Merge pull request #10632 from Rexbas/rotation-center-opencascade
Gui: Fix rotation center indicator for OpenCascade style
2023-09-11 10:35:12 -05:00
Chris Hennes
0bc6870618 Update translations (#10613)
* Update translations
* Start: Remove Start.ts
2023-09-10 13:06:26 -05:00
wmayer
4f27591e67 Gui: fix some MSVC truncation warnings
See forum: https://forum.freecad.org/viewtopic.php?t=81051
2023-09-10 18:08:06 +02:00
Rexbas
4850443238 Gui: Fix rotation center indicator for OpenCascade style 2023-09-10 14:03:38 +02:00
andrea
19272554e1 Removed old code using qt<5.4 2023-09-09 17:50:51 +02:00
wmayer
ccfda42dfb Gui: fixes #10617: Ctrl+C only stop python running in console not from macros
This commit handles the execution from the Python editor
2023-09-09 14:19:00 +02:00
wmayer
ab3878ad97 Gui: fixes #10617: Ctrl+C only stop python running in console not from macros
This commit handles the execution from the macro dialog
2023-09-09 14:02:57 +02:00
wmayer
26cd974e08 Gui: fix clang-tidy warning 2023-09-08 21:45:10 +02:00
Michael Tuma
32c5968069 Made the interval that the Python profiler runs at configurable
Added a "User parameter:BaseApp/Preferences/PythonConsole/ProfilerInterval" int
property which sets how often (in milliseconds) the Python profiler runs while
Python code is running. Setting this value to zero will totally disable it.

Also added a preference in the Python console screen which allows the user to
set the value of this property to between 0 (disabled) and 5000 (once every 5
seconds). (+1 squashed commits)

Squashed commits:

[cca88ac633] Made the Python profiler only run when the console is running code

This has two purposes. First, it prevents a performance impact from running the
profiler whenever Python code is running. Second, it prevents crashes caused by
Qt's process events function being called too frequently. When the Python code
is running in the console, it monopolizes the main thread and prevents events
from being processed. Therefore, causing events to be processed in the callback
should not force events to be processed too frequently, because the normal loop
is being prevented by the Python code. (+1 squashed commits)

Squashed commits:

[45f86917e6] Made long-running Python code not freeze the GUI without multithreading

Removed the background thread running Python code and replaced it with a custom
profiler which the Python interpreter runs frequently (at every Python opcode I
believe) on the main thread whenever Python code is running. The profiler will
make Qt process any new events every 200 ms, preventing "App not responding"
messages and making sure any Ctrl+C keypresses will be processed. This prevents
the previous issue where running anything GUI-related from Python would crash
the program (because Qt isn't thread-safe). (+1 squashed commits)

Squashed commits:

[0ef7d810b3] Made the process of getting thread IDs cross-platform compatible

Instead of using <threads.h>, now the standard <thread> header from C++
11 is used to find the thread ID, since <threads.h> is apparently not
available on Windows. (+1 squashed commits)

Squashed commits:

[74c7b867f2] # This is a combination of 2 commits.

Python from the console now runs in the background

In a nutshell, all Python code which is input from the interactive console
now runs in a seperate QThread which runs in the background, instead of
on the UI thread. This means that long operates operations will no longer
cause the app to display an "App not responding" message, because the UI
thread is now free to keep running unencumbered.

However, it is still not possible to run multiple Python statements at
the same time. If the user tries to run some Python while a previous
statement is still being processed, instead it will display an error
message in the console stating that the previous command is still
being processed.

I also added a seperate QTimer which runs once every 100ms to flush any
output from the Python code back to the console. I can't flush the output
to the console from the background thread because the relevant Qt5 code
is not thread-safe (it causes random segfaults). So I added this timer
as a work-around, since it runs in the main UI thread.

Implemented Ctrl+C keyboard interrupts in the console

This is implemented by detecting a Ctrl+C key event in the Python
console in the main Qt UI thread, and sending a keyboard interrupt
to the background thread that runs the Python code.
2023-09-08 21:45:10 +02:00
andrea
dccca2b7ed fix compilation warning 2023-09-08 14:13:36 +02:00
wmayer
381efa3b35 Gui: filter warning about dead keys
Forum thread: https://forum.freecad.org/viewtopic.php?t=80981
2023-09-08 14:12:24 +02:00
wmayer
f17790eb24 Gui: fixes issue #9422: Dependency Graph: export to .dot/.gv 2023-09-07 08:40:05 +02:00
FEA-eng
6171feb560 Update MainWindow.cpp
fixed small typo in the warning about 0.22 being dev version not for production use
2023-09-05 15:40:16 -05:00
kaktus Jacek
65f3355a78 Removing unnecessary strings from Crowdin + improving typos
patches for #10459 and #10426...
a few small details escaped attention need to be fixed
😉
Removing unnecessary strings from Crowdin and improving typos.
2023-09-05 15:38:58 -05:00
Syres916
c65434cfc9 [Gui] Correct logic and use more simplistic condition 2023-09-05 18:26:34 +01:00
Syres916
f26824459f [Preferences] Exclude 8514oem from Monospace fonts 2023-09-05 11:29:37 +01:00
Rexbas
da4318f140 Gui: Add nullptr check in showRotationCenter 2023-09-05 08:54:11 +02:00
Rexbas
dc216cde2a Gui: Refactor navigation animations
- Animations are played through an Animator
- Standard animations have a fixed duration and inherit from QVariantAnimation
- The animation duration can be changed in the preferences
- Fix animations when using the two arrows above the NaviCube
- Start an animation or start and wait for an animation
- Replaces standard camera animations (e.g. by selecting standard views or NaviCube) with FixedTimeAnimation
- Replace View3DInventorViewer's CameraAnimation with FixedTimeAnimation
- Replace OpenInventor navigation style infinite spin animation with SpinningAnimation
- Stops an active animation when a new animation is started
- Stops an active animation when the user starts dragging, panning or zooming
- Refactor reorientCamera so it can be used in animations
- Enable animations by default
2023-09-04 21:43:41 +02:00
didendron
ce2c0ed322 Gui: Add cancel button to transform task UI dialog
Fixes #7517
2023-09-04 16:43:27 +02:00
wmayer
531d7de201 Gui: make GroupCommand more flexible
Currently the GroupCommand by default sets the action group as non-exclusive, checkable and having a drop-down menu which isn't always the desired behaviour in sub-classes.
Thus, some new methods are added to let a sub-class in its constructor decide how it should behave.
2023-09-01 13:28:19 +02:00
PaddleStroke
09d50dc072 Assembly: Initial implementation (#10427)
* Assembly: Initial implementation.
* Disable Assembly wb as it's WIP.
* Stub code for handling assembly import.

Co-authored-by: sliptonic <shopinthewoods@gmail.com>
Co-authored-by: Paddle <PaddleStroke@users.noreply.github.com>
2023-08-31 12:30:10 -05:00
AgCaliva
3da00e36a3 Merge Master 2023-08-30 16:24:16 -03:00
howie-j
961e329fe4 Updated Shortcuts.cfg pref pack template to newest commands and shortcuts 2023-08-30 10:00:15 -05:00
wmayer
a86c0b8928 Gui: fix crash with the move to the new-style of class SelectionFilterPy
When setting the selection filter below and hovering over an object causes a segmentation fault:
filter = Gui.Selection.Filter('SELECT Part::Feature')
Gui.Selection.addSelectionGate(filter)
2023-08-30 15:09:08 +02:00
kaktus Jacek
ddc6c2a1a0 Cleaning code from unnecessary strings generated to Crowdin 4 (#10426)
Cleaning Crowdin of "garbage". Second approach.
https://github.com/FreeCAD/FreeCAD-translations/issues/270
2023-08-29 12:57:26 -05:00
Chris Hennes
40f130643a Update translations 2023-08-29 07:38:09 -05:00
kaktus Jacek
cde1a9bcb9 Cleaning code from unnecessary strings generated to Crowdin 2 (#10416)
Cleaning Crowdin of "garbage". Second approach.
https://github.com/FreeCAD/FreeCAD-translations/issues/270
2023-08-28 22:08:14 -05:00
wmayer
35136bb3c2 Gui: do not call back() on an empty container
Calling back() on an empty container is undefined behaviour: https://en.cppreference.com/w/cpp/container/vector/back
2023-08-29 00:52:33 +02:00
wmayer
93090fa55b Gui: no need to check for nullptr when using dynamic_cast
It's explicitly allowed to use dynamic_cast on a nullptr and the result will be a nullptr too.
See https://en.cppreference.com/w/cpp/language/dynamic_cast
2023-08-29 00:45:27 +02:00
Chris Hennes
f0152cbcce Merge pull request #10410 from qewer33/startpage-viual-fixes-2
StartPage: Visual fixes follow-up
2023-08-28 12:18:13 -05:00
Chris Hennes
ebcbfb6203 App: Warn on OpenGL too old (#9272)
* App: Warn on OpenGL too old

Based on original code from PR #9164

* GUI: Switch to DlgCheckableMessageBox for openGL warning
2023-08-28 12:08:23 -04:00
Edoardo Morandi
512770f27c fix: downcasting of SoNode that can cause UB (#9285)
A SoNode* is not necessarily a SoFCSelectionRoot*, and when this
assumption breaks the code causes UB (the comment related to one of the
chunks explicitly says that it is safe, but unfortunately it is not).

Instead of storing `SoFCSelectionRoot*` and blindly cast a generic
`SoNode*` to that, we can do the opposite. In this way it is obviously
necessary to use a dynamic cast when trying to reach for
`SoFCSelectionRoot` specific features, but in this way the abstraction
should be sound.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2023-08-28 11:06:06 -05:00
PaddleStroke
41aefb1331 Pref: wb: Add contextual menu to sort alphabetically. (#10363)
Co-authored-by: Paddle <PaddleStroke@users.noreply.github.com>
2023-08-28 10:39:44 -05:00