Commit Graph

194 Commits

Author SHA1 Message Date
wmayer
2725c3a54f Gui: modernize C++: use range-based for loop 2023-08-14 19:42:18 +02: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
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
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
marioalexis
c00699b15d Gui: Prevent crash when trying to delete pointer to BaseClass 2022-05-24 13:28:14 +02:00
wmayer
ef00864607 Gui: set Document as modified when changing one of its properties 2022-05-09 21:31:20 +02:00
wmayer
3d40a6f0e1 Gui: fix const correctness of Document::getViewOfViewProvider 2022-04-12 13:26:16 +02:00
wmayer
9eac35cf5d 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
bedf920702 Gui: PR6497 move return statement to new line 2022-03-29 12:33:50 -05:00
wmayer
96adb98f46 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
wmayer
1ca7429705 Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
wmayer
4977e55e51 App: Optimize includes to reduce compile time 2022-03-07 15:53:58 +01:00
Uwe
c613304473 [Gui] ViewProviderLink etc.: remove unused includes
- also put headers to PreCompiled.h
2022-03-06 01:11:42 +01:00
wmayer
063077ce84 Gui: [skip ci] std::isspace requires cctype header 2022-02-28 12:37:09 +01:00
Uwe
62496d7277 Revert "App: fix property ordering problem when undo/redo (#3255)"
This reverts commit c3178343db.
2022-02-22 01:21:49 +01:00
Zheng Lei
c3178343db 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
8a376e5ade [Gui] Application and Document: remove unused headers 2022-02-19 05:37:40 +01:00
wmayer
9068dbcdd6 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
715d67e2c3 Gui: do not prompt when closing view of temp document 2021-12-21 21:41:02 -07:00
Chris Hennes
c9a74d40d2 Revert "Merge pull request #4626 from pavltom/GUI_TreeView_Item_Ordering"
This reverts commit c62239d0ba, reversing
changes made to bef1df4d40.

See forums discussion: https://forum.freecadweb.org/viewtopic.php?p=549120
2021-11-24 09:03:35 -06:00
wmayer
81f4bcce66 Gui: [skip ci] fix -Wmultichar 2021-11-23 00:33:12 +01:00
luz paz
fc31a79eef 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
c62239d0ba 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
fc9d3547ad 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
345dcd5252 [Gui] Issue #3923 - Arbitrary Tree item ordering + tests 2021-10-26 19:09:34 +02:00
wmayer
b93aa77a1c Gui: move handling of failed document saving to a function to reduce code duplication 2021-10-20 21:57:51 +02:00
wmayer
cf58f30ed4 Gui: [skip ci] handle exception text as UTF-8 encoded string when saving failed 2021-09-29 14:03:51 +02:00
Chris Hennes
5661e23eef 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
54700faad8 Gui: fix typos 2021-09-17 08:28:34 +02:00
Ajinkya Dahale
820e88f95b [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
dc5a5cb2cb 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
81dbae551f 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
3ea1486071 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
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
wmayer
126c58471a Gui: [skip ci] avoid adding a wrong file name to the recent files list 2020-12-18 14:35:17 +01:00