Commit Graph

225 Commits

Author SHA1 Message Date
wmayer
6c0659711b Core: Do not save changes of a text object if the GUI document is about to be closed
This fixes #16873: Text document breaks some Analysis container objects
2024-10-02 20:42:00 -06:00
bgbsww
0f53f2195d Add override flag for recomputes; set it in relevant tests with old files. 2024-09-16 17:49:35 +02:00
bgbsww
a54f03f666 Move code for recompute dialog and disable warning 2024-09-16 17:49:35 +02:00
hlorus
16cfe2f499 [MeasureGui] Use temporary measure object creation (#15122)
* MeasureGui: Store measure type in TaskMeasure

* MeasureGui: Avoid adding measurement to document during command interaction

* [Gui] Add check for document in VPDocumentObject::getActiveView

* MeasureGui: Track the document when adding objects

* MeasureGui: Cleanup python measurement creation

* [Gui] Add isAnnotationViewProvider method

* [Gui] Check if viewprovider is added as an annotation in getActiveView

* [Gui] Add takeAnnotationViewprovider method to Gui::Document

* [Gui] Make addViewProvider public

* [MeasureGui] Add existing view provider to document when storing measurement

* [MeasureGui] Fix invocation of initial label placement

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-02 11:54:05 -04:00
Pieter Hijma
44387a793b Core: Add missing Python interpreter locks 2024-07-16 11:57:36 +02:00
PaddleStroke
974f57cf94 Core: Add Gui::Document::getTreeRootObjects() 2024-06-12 10:57:24 +02:00
Kuzma30
32b55a6c1c Fix potential problems. https://forum.freecad.org/viewtopic.php?t=70256#p762073 2024-05-27 11:57:26 -05:00
Kuzma30
bb4ef6dae2 Use for predefined filename string its Label value 2024-05-27 11:57:26 -05:00
wmayer
d89bece39a Gui: Replace TreeRank property with a simple int
This fixes that copied & pasted objects are not added at the end of the tree view.
See https://forum.freecad.org/viewtopic.php?p=755532#p755532
2024-05-06 18:24:20 +02:00
André Caldas
560898907b Avoids using getNameInDocument() to test if DocumentObject is attached to a Document.
This patch substitutes by isAttachedToDocument() (almost) everywhere where
getNameInDocument() is used for this purpose.

The very few places not touched by this patch demand a (just a little) less trivial change.
When we change the returning type of getNameInDocument() to std::string,
those places will be easily found, because they shall generate a compiler error
(converting std::string to bool).

Rationale:
The fact that getNameInDocument() return nullptr to indicate
that the object is not attached to a document is responsible for lots of bugs
where the developer does not check for "nullptr".

The idea is to eliminate all those uses of getNameInDocument() and, in the near future,
make getNameInDocument() return always a valid std::string.
2023-12-11 17:37:58 +01:00
bgbsww
a1c08dbf43 Move the unit schema into Project Information and remove all Project Unit System code (#11266)
* Add unit system to Project Information and store with document.

* Remove the project unit system

* Restore correct document activation signalling to fix test fail

* Remove commented out dead lines

* Restore ignore option for project unit schemas

* Whitespace fix

* Refresh after changing units

* Remove field label

* Property editor changes applied to unit system
2023-12-04 13:04:53 -06:00
Chris Hennes
aaa0db3867 Merge pull request #11231 from DeflateAwning/http-cleanup
Find and replace http://freecad to https://freecad
2023-11-06 11:16:13 -06:00
DeflateAwning
8de6db3e97 Find and replace http://freecad.org to https://freecad.org
Find and replace:
http:\/\/(.{0,10})freecad
https://$1freecad
Done in all remaining files (after doing it in SVGs in the last commit)
2023-10-29 22:39:22 -06:00
Chris Hennes
cbd0ef5975 Merge branch 'main' into modernize-type-check 2023-10-25 16:07:28 -05:00
Florian Foinant-Willig
773c701eec Core: modernize type checking 2023-10-23 18:07:07 +02:00
Paddle
d08ead4d7f Set the default icon of View3DInventor 2023-10-23 12:06:08 -04:00
wmayer
ce3e6b9b24 Core: add method to XMLReader to access next element of an XML file
If the next element could be read-in successfully true is returned, and false otherwise.
2023-10-09 15:06:45 +02:00
wmayer
56820718c5 Core: Revert superfluous changes made with PR #9521 2023-10-09 15:06:45 +02:00
AgCaliva
2212e68a30 merge master via cli 2023-10-04 13:28:48 -03:00
dyylanhammond
f1a6a9e3a6 Change default file saving preferences (#10781)
* Change default compression level from 3 to 7
* increase default thumbnail size to 256
2023-09-27 16:08:43 -05:00
AgCaliva
1f9bae0de7 Merge branch 'master' into User/Document/Feature_level_units_selection_#7746 2023-09-25 22:58:23 -03:00
wmayer
5743ce4681 Gui: fix possible memory leak if inappropriate view provider is created
Example code:
doc = App.newDocument()
doc.addObject(type = "Part::Feature", viewType = "MeshGui::ViewProviderMesh")
2023-09-21 19:11:29 -05:00
AgCaliva
39dcb1da7b Merge Master 2023-08-30 16:24:16 -03:00
wmayer
2725c3a54f Gui: modernize C++: use range-based for loop 2023-08-14 19:42:18 +02:00
AgCaliva
0c4ef0e106 merge master 2023-08-08 23:29:40 -03:00
wmayer
d150fa7164 modernize C++: avoid bind
In many cases std::bind() is kept because the code is much simpler
2023-08-08 21:10:16 +02:00
wmayer
68d22d864b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
Paddle
00dcb12c0b Change the default of 'Save thumbnail on doc save' 2023-07-30 15:37:18 +02:00
AgCaliva
ceb4a28991 Merge branch 'master' into User/Document/Feature_level_units_selection_#7746 2023-07-02 17:45:05 -03:00
AgCaliva
816d4077df Implemented DocumentReader for GuiDocument.xml reading. Final 2023-06-30 20:50:36 -03:00
AgCaliva
0751770bc6 Revert "DocumentReader implemented for GuiDocument.xml reading."
This reverts commit 5f101af3e9.
2023-06-30 20:27:12 -03:00
AgCaliva
5f101af3e9 DocumentReader implemented for GuiDocument.xml reading. 2023-06-30 18:41:00 -03:00
AgCaliva
52c55f59a8 Implementing agnostic version of ParameterGrp for reading XML, replacing XMLReader from src/Base/reader.cpp with new class DocumentReader 2023-06-16 15:36:43 -03:00
Pesc0
4a8d3853ba [Toponaming] create ElementMap class (#9175)
* Copypaste ElementMap
* Add MappedNameRef
* Fix missing include
* Copypaste `findTagInElementName`
* fix error introduced _somewhere_
* refactor toponaming constants
* Move `findTagInElementName` in `MappedName`
* reintroduce workaround to compile ElementMap
* Added missing functions copied from complexgeodata
* fix last compile errors, reorder and format files
* remove recursive refs to ComplexGeoData
* Add more comments
* fixed comments and added tests
* added FIXME, make functions private, misc fixes
* Move static functions from complexGeoData to PostfixStringReferences. Rename to ElementNamingUtils
* Fix broken includes due to previous change
* Revert constants from string to const char*
* added childmap tests and made hasher public
* Make functions private
* Added remaining tests
* removed bool return from `erase` functions
* fix missing appexport

Co-authored-by: John Dupuy <jdupuy98@gmail.com>
2023-06-15 09:05:24 -05:00
AgCaliva
8db6ab544a Handling errors 2023-05-21 01:41:10 -03:00
AgCaliva
af74608ada Added per project Unit System feature 2023-05-09 19:29:13 -03:00
wmayer
4d076a7056 Gui: force a redraw of the 3d view when creating it as otherwise on some systems the bottom and right side of the main window becomes black 2023-04-28 13:15:54 +02:00
luzpaz
129d5882a7 Migrate domain name from freecadweb to freecad (#9352)
* Migrate domain name from freecadweb to freecad
* Migrate src/Mod/Material files
* Migrate Stylesheet related files
* Migrate *.svg files
* Migrate miscellaneous files
* Migrate some build files
* Migrate recently added TD AR_IRAM template files

Closes #6415
2023-04-24 15:19:20 -05:00
Abdullah Tahiri
eb7bf5d977 Gui: Remove old signal for critical messages in favour of Notification Area
===========================================================================

The former system of autoclosing messageboxes is removed in favour of the Notification Area.
2023-03-12 06:06:29 +01:00
wmayer
7d221f10c1 Gui: [skip ci] fix build failure due to missing include 2022-12-22 11:01:23 +01:00
Abdullah Tahiri
bcc65d2fbb Gui: Handle user notifications
==============================

This commit provides specific behaviour on how to handle user messages signalled by App::Document for the different types of notifications.

For critical messages DURING a user initiated restore (i.e. only if the user clicked in the UI, not applicable for macros or Python initiated):
- The first critical message during restore requires user confirmation by clicking a button in a modal dialog box. The user has the choice to
request to be asked for confirmation for any subsequent critical message during restore or to forgo confirmation.
- If he chooses to forgo confirmation, subsequent critical messages are shown as auto-closing non-modal dialogs in a non-intrusive way. The user
can continue working while this information is shown. There is a maximum of auto-closing non-modal dialgos that can be enqueued. Over this maximum,
A warning pop up indicates this situation, referring to the Report View. No further auto-closing messages are enqueued until all existing messages
have disappeared. This is done to prevent overwhelming the user with notifications in cases where malfunction causes too many notifications to be
generated.

For any type of message OUTSIDE a user initiated restore:
- Messages are shown as non-intrusive non-modal auto-closing messages (it is not possible to generate modal/blocking messages outside a user
initiated restore).
- Messages are enqueued respecting a limit as above.
2022-12-21 16:01:23 +01:00
marioalexis
0382f276a2 Gui: Replace C cast 2022-09-18 11:06:51 -05: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
ba8d5ab055 Gui: modernize C++: replace 'typedef' with 'using' 2022-08-29 14:09:18 +02:00
berniev
656ef8961f Gui: redundant void 2 2022-08-08 10:21:44 +02:00
berniev
d88729d2c4 Gui: use empty 2022-08-06 16:35:45 +02:00
wmayer
36a6f9e2fc Fix several clazy issue:
* Use multi-arg instead [-Wclazy-qstring-arg]
* Use an empty QLatin1String instead of an empty QStringLiteral [-Wclazy-empty-qstringliteral]
* getter Gui::ProgressBar::canAbort possibly mismarked as a slot [-Wclazy-const-signal-or-slot]
* Missing emit keyword on signal call [-Wclazy-incorrect-emit]
2022-07-24 20:07:04 +02:00
andrea
3018985f80 Remove unused code into GUI 2022-07-17 03:53:11 +02:00
Uwe
c23a30b916 [Gui] remove unnecessary Boolean comparisons 2022-06-19 15:17:01 +02:00
wmayer
919271ed5e Gui: fix visibility of front nodes when moving an object to Part container 2022-05-30 03:21:52 +02:00