Commit Graph

4681 Commits

Author SHA1 Message Date
Abdullah Tahiri
ef70f2e53d Gui: Unavailable toolbars default to visible when made available
================================================================

https://github.com/FreeCAD/FreeCAD/issues/9208#issuecomment-1567469254

Issue:
- Unavailable toolbars default to not visible (as they are unavailable)
- However, when made available, they remain not visible. There may be
  cases when this is indeed the wanted behaviour, but they are not the
  ones we are facing.
- In the latter, the user expects the toolbars to show (and the
  configuration file to be saved with all toolbars showing.

Solution:
- Change the default behaviour of Unavailable toolbars when forcing
  them to be available, so that they are visible when made available.
- If then the case arises that we have toolbars where we would prefer
  then to be left not visible when making them available (so they are
  listed in the toolbar context menu to make them visible, but not
  visible per default), then we would need to create another toolbar
  policy class "UnavailableHidden".
- I chose not to add it directly (although it is straightforward) in
  fear that we will never need it, and it would make the code more
  complex to understand and thus maintain.
2023-05-30 16:37:53 +02:00
Abdullah Tahiri
ee1fcb3f3a Sketcher/Gui: Extend toolbar framework and fix toolbar visibility not preserved
=================================================================================

fixes #9208

Essentially:
- The regular mechanism to save toolbar state when changing from one WB to another
is not designed to support changes within one WB (e.g. from edit mode and back).
- At creation time, toolbars can be initialised with default visible or default hidden
state. Additionally, there is third configuration "Unavailable", which refers to a
toolbar that is hidden, and the control to enable it is also hidden by default.
- The ToolBarManager is extended to enable to set the State of one or more toolbars.
- The State refers to changes to be effected on one or more toolbars by client code:
* ForceHidden allows to hide a toolbar and also hide its control (a toolbar not available
in a mode).
* ForceAvailable allows to make a toolbar available by making its control visible, the
toolbar itself is visible or not depending on user settings.
* RestoreDefault allows to bring the control visibility to the default of the toolbar, the
toolbar itself is visible or not depending on user settings.
* SaveState allows to store the current visibility state of a toolbar. It enables client
code to save the state when appropriate. It provides the only option for default "Unavailable"
toolbars, which are fully managed by client code. It provides additional flexibility to save
other toolbar visibility on request.

For the Sketcher this means:
- That edit mode toolbars are not shown outside edit mode.
- That edit mode toolbars and non-edit mode toolbars can be configured independently.
- that edit mode toolbars' state is saved when leaving edit mode if and only if, the
workbench that is selected when leaving edit mode is the Sketcher WB.
- it won't save the state if the user manually selected another WB and then left edit
mode (why? see limitation above).

Limitation:
- When switching to another WB while in edit mode, the other WB is activated before the
current WB (sketcher WB) is deactivated. This means that at sketcher level, the sketcher
has no chance to save states or do other tidy up actions before the tools of the other WB
are activated.
- This, however, is understood as not relevant enough as to warrant changing the mechanisms
in place.
2023-05-30 16:37:53 +02:00
Chris Hennes
a2d457e88f Update translations 2023-05-25 21:32:26 -05:00
Chris Hennes
ec8fe448dc Gui: Don't show raw exception to user 2023-05-24 20:57:43 +02:00
Abdullah Tahiri
2a3fe4c628 Gui: Notifications Framework - accept more notifier types
=========================================================

Extends notifier types to Gui::Document, App::Document, Gui::ViewProviderDocumentObject.

This allows to pass these objects as notifiers, and the framework gets the right string
from the Label or FullLabel as appropriate.
2023-05-24 18:35:41 +02:00
Abdullah Tahiri
12a7f3b236 NotificationArea/Preferences: Allow Opt-in for Developer warnings and errors
============================================================================

The old preferences had errors and warnings ON by default and allowed to opt-out.
It was not possible to separate errors/warnings intended for users from those intended for developers.

The new version has developer errors and warnings OFF by default. User intended ones are ON.
It is possible to opt-in for developer errors and warnings from the preferences dialog.

As developer errors and warnings are NOT translated, if opting-in, they won't be localised.

User errors and warnings should be translated. If they are not, it is a bug.
2023-05-23 14:24:45 +02:00
Abdullah Tahiri
cc13da5470 Console: Remove Translated Notification message
===============================================

With the new console extension, the translation state is coded separatedly.

Therefore, it is possible to code a Notification as translated without needing a specific type.

Additionally, any other message, such as Error of Warning can be translated.

It does not make sense to leave this message, if only for reasons of coherence and to simplify
maintainance of code.
2023-05-23 14:24:45 +02:00
Abdullah Tahiri
c973033b6c Gui: Adapt Notifications Framework 2023-05-23 14:24:45 +02:00
Abdullah Tahiri
98f3163a7a App: NotificationArea adaptation to the new messages 2023-05-23 14:24:45 +02:00
Abdullah Tahiri
a66e00d2a4 Ilogger - Separate behaviour for user exposed and not exposed loggers 2023-05-23 14:24:45 +02:00
Abdullah Tahiri
e3702ac2d8 Console: Extend framework with intended recipient and content type metainformation
==================================================================================

Limitations of the current framework:
- Codes the translated state only for TranslatedNotification as part of the type.
- Does not code the intended recipient (user, developer, ...)

Problems:
- Some errors are intended for developers, some errors may only be intended for users,
if, for example, there is another developer error which already contains all the information.
The current framework may lead to information duplication or to showing to the user developer
information, which is perceived as annoying.
- Logs shall be in English (report view), while every message to the user (UI) shall be translated.
The current framework can only differentiate where to report based on subscription (legacy logs do not
subscribe to notifications), and for notifications, whether it is translated or not depends on the type.
It is not possible to code errors or warnings that are already translated.

Solution:
- To extend the ILogger interface with additional metainformation, indicating the intended recipient
(User, Developer, All), and the content of the message (translated, untranslated, untranslatable). The latter
is useful for dynamic strings that won't find a match in the translation framework.

Bonus:
- This extended version allows to do away with translatednotification, as now any message can be independently
marked as translated or untranslated or untraslatable.
- It is now possible to provide the right icon of severity (error, warning, info), even when it is only user intended
and already translated.
2023-05-23 14:24:45 +02:00
Chris Hennes
20f073e84e Update translations 2023-05-21 19:13:11 -05:00
Chris Hennes
864f99bf98 Merge pull request #9614 from chennes/fixPrefPageContext
Gui: Correct translation context of pref pages
2023-05-20 19:53:32 -05:00
Chris Hennes
5f82aa42bb Merge pull request #9215 from marioalexis84/gui-window_parameter
Gui: Add function in WindowParameter class to connect slot to ParameterManager signal
2023-05-19 22:45:48 -05:00
Chris Hennes
d30292bece Merge pull request #9603 from chennes/windowsVersionHack
Gui: Hack to get Windows 11 version
2023-05-19 21:12:19 -05:00
Chris Hennes
0100e8f843 Gui: Correct translation context of pref pages
Preference page title strings must be in QObject
2023-05-19 20:46:12 -05:00
Chris Hennes
68ec11425d Gui: Hack to get Windows 11 version 2023-05-19 10:27:21 -05:00
Chris Hennes
0b41c4a8a8 Update translations 2023-05-18 07:49:08 -05:00
Chris Hennes
55ee18108e Merge pull request #9596 from chennes/macVersionInfoHack
Gui: Mac version info hack
2023-05-17 20:07:46 -05:00
Chris Hennes
c71c36bfa8 Merge pull request #9582 from chennes/translateUnitSchemes
Gui: Translate unit system UI
2023-05-17 11:06:27 -05:00
Chris Hennes
589a1bbaff Merge pull request #9551 from chennes/syncQtTranslations
Gui: Sync translation files with Qt project
2023-05-17 11:04:43 -05:00
Chris Hennes
d23a89e78e Gui: Hack to ensure good macOS version number 2023-05-16 21:34:07 -05:00
Chris Hennes
001c79f459 Gui: Translate unit system UI 2023-05-15 20:16:46 -05:00
wmayer
01da66f2df [skip ci] Gui: PrintWarning has been moved to Console module 2023-05-15 15:58:48 +02:00
wmayer
3c8ee2213f Gui: check for QApplication instance to avoid crash 2023-05-14 18:50:35 +02:00
Chris Hennes
f90138e737 Gui: Sync translation files with Qt project 2023-05-11 22:06:18 -05:00
Chris Hennes
86128f1de2 Merge pull request #9541 from Ondsel-Development/wb_prevent_duplicates
Pref: Wb: prevent duplicate workbenches in the lists.
2023-05-11 19:33:22 -05:00
Paddle
764d3d4b30 Pref: Wb: prevent duplicate workbenches in the lists. 2023-05-11 10:25:29 +02:00
Chris Hennes
4c282fe0df Merge pull request #9497 from wwmayer/generate_qm_files
Generate qm files
2023-05-10 18:18:25 -05:00
wmayer
ecb72b8ead Gui: when loading SVG images get default size and keep aspect ratio
See forum: https://forum.freecad.org/viewtopic.php?p=680800#p680800
2023-05-10 11:59:44 +02:00
Rexbas
530dd7c219 Fix typo 2023-05-09 10:31:38 +02:00
Rexbas
9415c80a5e Add method to find the nearest orientation 2023-05-09 10:31:38 +02:00
Rexbas
e09f729400 Cleanup unused NaviCube methods 2023-05-09 10:31:38 +02:00
Rexbas
de2a2f6c6f Apply the rotation that is stored in the NaviCube face 2023-05-09 10:31:38 +02:00
Rexbas
f20a0cceaa Determine rotation direction of NaviCube buttons 2023-05-09 10:31:38 +02:00
Rexbas
86d9ded206 Determine standard orientations of NaviCube faces 2023-05-09 10:31:38 +02:00
wmayer
6f8e3f374f Gui: fix NaviCube in split views (fixes #9500)
* initialize base and hilite color with more sensible default values
* handle case if no font name is set
* apply user preferences to NaviCube
2023-05-08 10:05:01 +02:00
wmayer
8cc0b6ad39 Gui: Create .qm out of .ts files 2023-05-07 08:52:49 +02:00
Chris Hennes
1a4b85121b Merged crowdin translations 2023-05-06 11:56:32 -05:00
wmayer
d163114374 Gui: disable lighting for the label of an axis
This way the backside of the label is displayed with the same color as the front side. Otherwise it may be black.
2023-05-05 22:00:55 -04:00
Ronny Standtke
8d1c9c2563 Origin axis: use same colors as axis cross and make bigger than planes
for easier selection and visualization
2023-05-05 03:09:36 -04:00
Ronny Standtke
ddb080995b Origin plane: make plane faces unpickable 2023-05-05 03:09:36 -04:00
Ronny Standtke
ad5e702366 Origin plane: add semi transparent face 2023-05-05 03:09:36 -04:00
Jolbas
35b0ea71f9 Compability with OpenGL ES
Replace glPolygonMode() and GL_POLYGON with GL_LINE_LOOP
Replace glDepthRange() with glPolygonOffset()
Some cleanup in configuring openGL
2023-05-04 17:38:48 -04:00
wmayer
2de08f77b7 Use View3DInventorViewer::setSelectionEnabled instead of SoFCUnifiedSelection::selectionRole 2023-05-04 08:03:11 +02:00
wmayer
87749d1bb8 Gui: do not enable lighting when rendering from image or framebuffer 2023-05-04 07:55:05 +02:00
Yorik van Havre
04dd1cb279 Merge pull request #9433 from chennes/fixSerbianLatinMenuEntry
GUI: Transform sr-CS to sr_Latn in menu entry
2023-05-03 11:28:13 +02:00
Chris Hennes
6da3d0e6b5 Mods: Remove Raytracing
Deprecated. Replaced by 3rd party addon 'Render'.
2023-05-02 12:49:54 -05:00
Chris Hennes
3cdb347c72 Merge pull request #9437 from chennes/updateTranslations20230429
Update translations
2023-05-02 10:24:05 -05:00
Chris Hennes
4dbb17f3ac Merge pull request #9440 from chennes/modifyGuiTooltipForTranslation
Gui: Adjust tooltips for improved translation
2023-05-02 10:23:42 -05:00