Commit Graph

245 Commits

Author SHA1 Message Date
wmayer
ed03e8ded5 Gui: allow to configure the checks of the cache directory 2021-11-16 15:37:04 +01:00
wmayer
973642285e Gui: periodically check cache directory and offer a way to clean it up if it exceeds the limit 2021-11-15 22:53:41 +01:00
wmayer
d5726bd7af App: standard path handling
* distinguish between temp and cache location
* document's transident directory is created in the cache location
* add functions to access temp and cache location via Python
2021-11-15 16:26:25 +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
e702c5d234 Gui: [skip ci] fix minor memory leak 2021-10-26 13:31:55 +02:00
wmayer
a5411da5b9 Gui: code-refactoring of document recovery handling to reduce code duplication 2021-10-21 21:45:52 +02:00
Yorik van Havre
d95f085760 Merge pull request #4787 from chennes/addThemeSupport
[GUI] Add Preference Pack support
2021-10-14 12:41:06 +02:00
0penBrain
510cbf523a 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
Chris Hennes
b432592fb2 Merge branch 'master' into addThemeSupport 2021-09-24 07:51:04 -05:00
wmayer
b4e69f1b2d Gui: move Ui loader classes to their own source files 2021-09-22 20:31:01 +02:00
Yorik van Havre
3e483c5268 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
27042d210f Merge branch 'master' into addThemeSupport 2021-08-19 09:51:12 -05:00
Chris Hennes
e2e7733d09 [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
032f743fbf [Gui] Introducing user edit mode 2021-05-14 09:23:04 +02:00
Chris Hennes
858e88afe1 [GUI] Add PreferencePack support
Preference Packs are collections of preferences that can be applied en
mass to the user's current setup. Any preference that can be stored in
user.cfg can be stored in a preference pack, and they are designed to be
easy to distribute.

Support is also added for saving a subset of current preferences into a
new preference pack in order to facilitate easy creation of new
"themes", etc.
2021-05-13 09:08:33 -05:00
Matthijs Kooijman
a12f26b8f5 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
7b4fdf3e7c [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
226b713ed4 [GUI] Migrate Application to std::bind 2021-03-07 08:47:01 +01:00
Chris Hennes
9d0086eb23 [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
df0f979f3b 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
5b864424db 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
7c708eeca3 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
5e07d708db 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
636add044b 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
e8cc4f1ede Merge branch 'master' into addImportExportRecentFilesPrefs 2021-01-10 13:17:29 -06:00
Mateusz Skowroński
2559f2d29c 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
74e146610a 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
93736cca48 Gui: [skip ci] add option to use software OpenGL 2020-12-17 16:27:36 +01:00
wmayer
53eb15fe50 Gui: [skip ci] make parameter to control High DPI scaling available for all platforms 2020-12-02 22:38:04 +01:00
wmayer
3d6dee2a12 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
181914b46f (Windows only) Improve the dpi handling with different dpi screens on windows 2020-12-02 13:08:46 +01:00
luz paz
74ab516494 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
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
2057e151d8 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
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