Commit Graph

194 Commits

Author SHA1 Message Date
wmayer
e09d8aaba6 Gui: modernize C++: use range-based for loop 2023-08-14 19:42:18 +02:00
wmayer
948cbfccd9 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
52e1c7c33b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
Paddle
68bf3cd299 Change the default of 'Save thumbnail on doc save' 2023-07-30 15:37:18 +02:00
Pesc0
c65f049d20 [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
wmayer
fa8daef521 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
38a01939e0 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
0e881f9f06 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
0de2f04dd2 Gui: [skip ci] fix build failure due to missing include 2022-12-22 11:01:23 +01:00
Abdullah Tahiri
07f85212af 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
ff1b4eff05 Gui: Replace C cast 2022-09-18 11:06:51 -05:00
berniev
ae53c9b0a4 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
23961706be Gui: modernize C++: replace 'typedef' with 'using' 2022-08-29 14:09:18 +02:00
berniev
3d1f70765a Gui: redundant void 2 2022-08-08 10:21:44 +02:00
berniev
2db561561e Gui: use empty 2022-08-06 16:35:45 +02:00
wmayer
916c814219 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
7886d3cbf4 Remove unused code into GUI 2022-07-17 03:53:11 +02:00
Uwe
0828d769e8 [Gui] remove unnecessary Boolean comparisons 2022-06-19 15:17:01 +02:00
wmayer
66819f82fd Gui: fix visibility of front nodes when moving an object to Part container 2022-05-30 03:21:52 +02:00
marioalexis
42f7be2a4a Gui: Prevent crash when trying to delete pointer to BaseClass 2022-05-24 13:28:14 +02:00
wmayer
b41bdd82a0 Gui: set Document as modified when changing one of its properties 2022-05-09 21:31:20 +02:00
wmayer
54efa2afcd Gui: fix const correctness of Document::getViewOfViewProvider 2022-04-12 13:26:16 +02:00
wmayer
0b2c73cf32 Gui: clean-up Selection API
Replace the int of the 'resolve' argument of several functions with a proper enum class.
* This avoids the inconsistencies in client code where often true/false is passed when an int is expected
* This avoids the use of magic numbers like 0, 1, 2 or the undocumented 3
2022-04-09 17:03:43 +02:00
Chris Hennes
5df3dbae6f Gui: PR6497 move return statement to new line 2022-03-29 12:33:50 -05:00
wmayer
1178df06b4 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
wmayer
8f786ea6ef Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
wmayer
f1f68db55b App: Optimize includes to reduce compile time 2022-03-07 15:53:58 +01:00
Uwe
a65c88d3c5 [Gui] ViewProviderLink etc.: remove unused includes
- also put headers to PreCompiled.h
2022-03-06 01:11:42 +01:00
wmayer
92505fb8ea Gui: [skip ci] std::isspace requires cctype header 2022-02-28 12:37:09 +01:00
Uwe
16467d9067 Revert "App: fix property ordering problem when undo/redo (#3255)"
This reverts commit 24d30636e4fb990fdbd67538360846ff09456dfc.
2022-02-22 01:21:49 +01:00
Zheng Lei
170a12089c App: fix property ordering problem when undo/redo (#3255)
* Part: fix Placement/Shape onChanged() handling

* App: fix property ordering problem when undo/redo
See https://tracker.freecadweb.org/view.php?id=4265#c14271

* Gui: fix undo/redo signaling
Make sure to signal after all properties has been restored
2022-02-21 12:29:01 +01:00
Uwe
eaaeef80e1 [Gui] Application and Document: remove unused headers 2022-02-19 05:37:40 +01:00
wmayer
6f3446d19e 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 2022-02-05 17:56:52 +01:00
Zheng, Lei
4d82c5d319 Gui: do not prompt when closing view of temp document 2021-12-21 21:41:02 -07:00
Chris Hennes
ded7adb798 Revert "Merge pull request #4626 from pavltom/GUI_TreeView_Item_Ordering"
This reverts commit b0452667c72f330323f6b3366f45bf039d05feef, reversing
changes made to b2d99f3fa7b4c7c305aed4a8d975a8624a6d590f.

See forums discussion: https://forum.freecadweb.org/viewtopic.php?p=549120
2021-11-24 09:03:35 -06:00
wmayer
b48647fb1e Gui: [skip ci] fix -Wmultichar 2021-11-23 00:33:12 +01:00
luz paz
a07c7e4333 Gui: remove superfluous whitespace from translation string
Avoids possible translation mistakes by only exposing non-whitespace strings.
2021-11-22 19:28:43 +01:00
Chris Hennes
8d1735741b Merge pull request #4626 from pavltom/GUI_TreeView_Item_Ordering
[Gui] Issue #3923 - Add arbitrary Tree View item ordering
2021-11-10 23:35:05 -06:00
Zheng, Lei
ad9ad30c00 App: fix external document loading
The problem happens when partial loading is enabled. If document A
contains a link to some object in document B, it will load B as partial
document with only that object and its necessary dependencies. But if
document A contains another link to some object in document C which also
has a link to some object in document B, the link in document C may not
be restored, because document B is partially loaded without the linked
object. This patch will check for this case and reload document B for
more objects.

See an example reported in
https://forum.freecadweb.org/viewtopic.php?p=495078#p495078
2021-10-30 11:03:52 +08:00
Tomas Pavlicek
17f328c7a9 [Gui] Issue #3923 - Arbitrary Tree item ordering + tests 2021-10-26 19:09:34 +02:00
wmayer
cac50da55b Gui: move handling of failed document saving to a function to reduce code duplication 2021-10-20 21:57:51 +02:00
wmayer
5cff5654ca Gui: [skip ci] handle exception text as UTF-8 encoded string when saving failed 2021-09-29 14:03:51 +02:00
Chris Hennes
860f46ac6c Merge pull request #4792 from heewa/abort-quit-on-failed-save
[Gui] Fix app quitting despite failing to save project
2021-09-17 19:46:01 -05:00
wmayer
9a23ffb35a Gui: fix typos 2021-09-17 08:28:34 +02:00
Ajinkya Dahale
c123bc2bf8 [Core] (Partially?) Fix data loss on dir rename (#4996)
* Fix lost filename in err msg

In some circumstances, FileExceptions are constructed empty, then have a
filename assigned to them, but the error message in these scenarios is
left as the default "unknown" one, which is sometimes shown to users.
This change fixes that case to be consistent with instances that are
constructed with the filename.

The exception can happen when trying to save the file in a location that does
not exist, or when the user does not have permission to write there. If it
comes when saving after closing the document, all previous changes can be lost.

Partially fixes issue #4098.

Co-authored-by: Heewa Barfchin <heewa.b@gmail.com>
2021-09-16 12:06:29 -05:00
Heewa Barfchin
5a2e40c3f5 Fix app quitting after failed save. Fixes #4098
Return `false` from Document::save() to properly communicate the
failure, which the app-quit process already handles by aborting.
2021-05-14 12:53:25 -04:00
luz paz
a522f4a240 Crowdin: Gui: fix user-facing typo in Document.cpp [skip ci]
ref: https://crowdin.com/translate/freecad/549/en-en?filter=basic&value=0#6584664
2021-02-25 10:31:33 +01:00
Zheng, Lei
1d4edddddb Gui: fix external edit reset crash
By making sure to signal from the owner document of the editing object.
The owner document of the editing object may be different from the
editing document in case of editing external linked object.
2021-01-04 12:01:00 +01: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
wmayer
a7506326c9 Gui: [skip ci] avoid adding a wrong file name to the recent files list 2020-12-18 14:35:17 +01:00