Commit Graph

235 Commits

Author SHA1 Message Date
0penBrain
f6f5182bc3 Gui : susbtitute dot with local decimal separator for spin boxes
Main goal is to improve user-friendlyness for several locales
 Substitution of dot is performed :
 * Always if dot is neither decimal nor group/thousand separator of current locale
 * Only on NUMPAD dot if dot is not decimal but is group separator of current locale
2021-09-27 15:06:36 +02:00
wmayer
bc5c585c8b Gui: move Ui loader classes to their own source files 2021-09-22 20:31:01 +02:00
Yorik van Havre
10c684cfab Merge pull request #4788 from 0penBrain/UserEditMode
Gui: add user edit mode (default edit mode set by user)
2021-09-02 11:50:03 +02:00
Chris Hennes
9af48f2709 [GUI] Add autoload option to Workbench preferences page (#4957)
* Add autoload option to Workbench preferences page

* Address bugs identified in the forum.

* Add forward declaration of QCheckBox
2021-08-10 20:33:03 -05:00
0penBrain
ef22c6ba1e [Gui] Introducing user edit mode 2021-05-14 09:23:04 +02:00
Matthijs Kooijman
fdc6890f4e Gui: Enable compression of tablet motion events
By default (on platforms that support it, X11 and Windows currently) QT
applies compression for high frequency events (mouse move, touch, window
resizes) to keep things smooth even when handling the event takes a
while (e.g. to calculate snapping).

However, tablet pen move events (and mouse move events synthesised from
those, which is what FreeCAD uses) are not compressed by default (to
allow maximum precision when e.g. hand-drawing curves), leading to
unacceptable slowdowns using a tablet pen.

This commit enable compression for tablet events here to solve that and
make use of a tablet just as smooth as a mouse with FreeCAD.

This can (and likely will) lead to some movement events being dropped,
but since there is no freeform curve drawing tool, that should not be
problematic (and if it is ever added, it could still work without
compression if the mouse movement event handler is written to be fast
enough).
2021-03-29 12:08:46 +02:00
donovaly
0d43fd4d0f [Gui] fix HiDPI rounding bug
As reported in https://forum.freecadweb.org/viewtopic.php?f=10&t=56425&start=20#p485809
this PR fixes the problem reported here: https://forum.freecadweb.org/viewtopic.php?f=10&t=56425&start=20#p485759
2021-03-10 15:25:04 +01:00
Chris Hennes
c39764e395 [GUI] Migrate Application to std::bind 2021-03-07 08:47:01 +01:00
Chris Hennes
dc96a08201 [GUI] Remove deprecated code from Application
Strip out anything that was only active for Qt <5.9 or Python <3.6.
2021-03-07 08:47:01 +01:00
wmayer
dd4dd204d0 App/Gui: fix memory leaks:
+ add function to cleanup units and quantities in debug build
+ fix reference leak in PropertyVector::getPyPathValue()
+ fix reference leak in PropertyPlacement::getPyPathValue()
+ in InterpreterSingleton::init() use a static std::vector<wchar_t*> instead of a C array
  to free memory at program end
+ in MainWindow::closeEvent() explicitly delete all task watchers
+ in ReportOutputObserver constructor pass parent to QObject
+ in PropertyEditor destructor explicitly delete QItemEditorFactory
2021-02-27 10:56:19 +01:00
wmayer
88d49cd982 Gui: [skip ci] improve exception handling:
* handle all exceptions in Application::onLastWindowClosed because this method can be (indirectly)  called from ~BaseView and would otherwise trigger std::terminate()
* handle exceptions in PropertyEditor::closeTransaction() because when recomputing a document while closing it leaves the editor in a bad state
2021-02-25 12:23:13 +01:00
wmayer
a4aea3f480 Gui: [skip ci] add convenience function updateActions() to Application
Use updateActions() in ViewProvider::onChanged() to also trigger an update on pure view property changes
2021-02-09 15:21:17 +01:00
Chris Hennes
15afa3ae59 Remove extraneous lines from export
Corrects a merge issue from an earlier PR: the removed lines are
redundant.
2021-02-01 13:38:21 +01:00
Chris Hennes
279ca4d660 Add parameters to user.cfg file when used
The two parameters are now added to the user.cfg file once they are
accessed in the code. So the first time you export a file, the
parameeter RecentIncludesExported is created and defaulted to false, and
the first time you import a file the parameter RecentIncludesImported is
created and defaults to true. Once that is done the parameters can be
edited from the Parameter Editor, even though they do not have entries
in the Preferences dialog.
2021-01-10 15:40:10 -06:00
Chris Hennes
e653e6710c Merge branch 'master' into addImportExportRecentFilesPrefs 2021-01-10 13:17:29 -06:00
Mateusz Skowroński
98f63ba60f Fix build warnings from deprecated Boost headers (they are used internally by Boost). Thanks @wwmayer for the hint. 2020-12-29 10:20:53 +01:00
Chris Hennes
aec977765e Add prefs for import/export in Recent Files
Add two (currently hidden) preferences controlling whether imported and
exported files are included in the recent files list.

RecentIncludesImported defaults to true, and RecentIncludesExported
defaults to false.
2020-12-18 13:43:23 -06:00
wmayer
b7bd7d229b Gui: [skip ci] add option to use software OpenGL 2020-12-17 16:27:36 +01:00
wmayer
d9a3cd6956 Gui: [skip ci] make parameter to control High DPI scaling available for all platforms 2020-12-02 22:38:04 +01:00
wmayer
5009699e79 Gui: [skip ci] add user parameter to disable High DPI scaling on Windows (by default off) 2020-12-02 13:15:01 +01:00
ADDIREKT\Apeltauer
aa5ac86b87 (Windows only) Improve the dpi handling with different dpi screens on windows 2020-12-02 13:08:46 +01:00
luz paz
c93bf6cbae Gui: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the src/Gui code.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
2020-12-01 14:53:35 +01:00
luz paz
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
67e80c7d6a Qt5: fix deprecation warnings for Qt 5.15
+ QByteArray::append is deprecated
+ QPixmap* QLabel::pixmap() is deprecated
+ overloaded version of QString::split is deprecated
+ QSysInfo::windowsVersion()/QSysInfo::MacVersion() is deprecated
2020-10-18 14:45:31 +02:00
wmayer
ed60bb7618 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
804ed5115d Gui: [skip ci] fix appearance of TaskGroups when a style sheet is set 2020-10-06 18:20:34 +02:00
wmayer
863c5a2700 Gui: [skip ci] fix handling of active document when importing a file 2020-10-06 12:33:35 +02:00
mwganson
8f49abe7f2 [File Import] add import to document transaction for unde/redo 2020-10-06 11:56:11 +02:00
wmayer
e539cce45a Gui: [skip ci] fix initialization of Python-based view providers in FreeCADGui.subgraphFromObject 2020-09-26 22:39:18 +02:00
wmayer
f55f7f040a Python: [skip ci] expose Python types in their corresponding modules 2020-09-21 15:04:26 +02:00
wmayer
73f89f8cf0 Gui: [skip ci] move Python functions for commands to its own class 2020-08-02 20:50:43 +02:00
wmayer
41ca54de70 LGTM: [skip ci] remove some obsolete FIXME comments from source code 2020-07-28 09:49:20 +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
Zheng, Lei
2801fa342c Gui: update command actions after sending message to view 2020-07-06 16:38:11 +02:00
wmayer
80ad2edfe4 Gui: export scene graph to file or buffer 2020-06-29 15:27:52 +02:00
wmayer
8b32ea8dab GuiPy: [skip ci] expose function to Python to replace Switch with Separator nodes 2020-06-20 12:22:24 +02:00
wmayer
278202eb6f 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
3ca859acf7 Gui: [skip ci] fix Gui.subgraphFromObject and improve error text if wrapping fails 2020-06-19 15:07:57 +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
b1f41dd87e Gui: [skip ci] wheel event filter for combo boxes 2020-05-22 10:42:38 +02:00
wmayer
5e9731c990 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
e14e5b845e [skip ci] use QLocale class consistently to make it possible to change it application-wide 2020-03-26 16:37:45 +01:00
wmayer
410c03205f Gui: [skip ci] implement Python wrapper for ExpressionBinding 2020-03-25 13:22:18 +01:00
wmayer
a4935643e2 Gui: [skip ci] simplify Application::setStyleSheet and directly check if the passed file name exists 2020-03-19 19:37:49 +01:00
wmayer
522eefba4f Gui: move handing of style sheets to Application::setStyleSheet to avoid code duplication 2020-03-19 15:57:20 +01:00
triplus
873769d021 Use relative path to stylesheet fix #4130 2020-03-19 14:25:03 +01:00
Zheng, Lei
6556276c5a Gui: fix crash on Document resetEdit 2020-02-13 15:27:49 +01:00
triplus
b9b7f5ce89 Option to opt-out from using a Linux desktop icon theme. 2020-02-08 12:31:34 +01:00