Commit Graph

4429 Commits

Author SHA1 Message Date
wmayer
608521d9f5 Gui: add missing include for Qt6 build 2023-03-18 00:08:40 +01:00
Paddle
98b97d7c68 Core: Add possibility to change the unit in the sizeLabel. 2023-03-17 14:04:24 +00:00
Abdullah Tahiri
6e29309a82 NotificationArea: Preferences - width 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
a2bd55109d NotificationArea: Convert plain text to HTML to perserve format 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
4b7a44739f NotificationArea: Use fixed size notifications 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
eb590aed5d NotificationBox: Allow to set a fixed notification width 2023-03-17 11:29:30 +01:00
Abdullah Tahiri
3ece84fd9d NotificationArea: Allow wrapping of message text to avoid rendering issues with long messages 2023-03-17 11:29:30 +01:00
wmayer
a62d01ea2a Gui: set-up a logging category filter to suppress the most annoying Qt warnings 2023-03-16 20:40:00 +01:00
Paddle
71a94da497 Sketcher: Stylesheet, fix manualUpdate button style. 2023-03-14 16:28:14 +01:00
Paddle
00ffa67cbd Sketcher: Solver Message simplification 2023-03-14 16:28:14 +01:00
Adrian Insaurralde Avalos
38901f194b fix #8847 sketcher dialog tool buttons bad styling 2023-03-14 13:32:21 +01:00
wmayer
6ee8ee3c73 Gui: [skip ci] fix whitespaces 2023-03-13 22:38:54 +01:00
Syres916
223f0b4b35 [Gui] Add TODO reference hack 2023-03-13 22:34:58 +01:00
Syres916
7e57d539ff [Gui] Improve comments regarding move of widget 2023-03-13 22:34:58 +01:00
Syres916
5e6cd8d51f [Gui] Fix regressions from PR7771...
specifically c24a50f486 fixes #7965 #8440
2023-03-13 22:34:58 +01:00
Ronny Standtke
9878ecf3a2 use standard Close button for consistency with other task dialogs 2023-03-13 11:56:27 -05:00
Abdullah Tahiri
48ef9c794b Gui: Notifications - Convenience functions to send intrusive/non-intrusive notifications
========================================================================================

Functions to transparently send errors, warnings, notifications and translatednotifications, either
as intrusive messages (modal pop-up QMessageBox style) or as non-intrusive messages (notificationarea),
depending on the preferences of the user.

It is intended to substitute calls to QMessageBox with these functions in WBs, including the Sketcher WB.

Example:

QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
                      QObject::tr("Cannot add a constraint between two external geometries."));

Can be rewritten as:

 Gui::TranslatedNotification(obj,
               QObject::tr("Wrong selection"),
               QObject::tr("Cannot add a constraint between two external geometries."));

or

 Gui::TranslatedNotification("Sketcher",
               QObject::tr("Wrong selection"),
               QObject::tr("Cannot add a constraint between two external geometries."));

where the first parameter (obj or "Sketcher") is the notifier string. If obj is an App::DocumentObject
(or a derived class of it), internally the function transparently calls getFullLabel() to get the notifier
string.
2023-03-12 18:44:55 +01:00
wmayer
220947abdb MSVC: fix compiler warnings about redefined pre-processor directives
Swapping the order of Qt and Inventor headers fixes them because the latter uses #ifdef/#endif guards
2023-03-12 16:17:38 +01:00
wmayer
be0e65fa7a clang: fix -Wdeprecated-declarations 2023-03-12 15:05:21 +01:00
wmayer
82ac24de5c clang: fix -Wunused-parameter, -Wunused-variable, -Wswitch 2023-03-12 15:05:21 +01:00
Abdullah Tahiri
31e50ed1c7 Gui: Preference Page for NotificationArea
=========================================

Configuration preference page for controlling the notification area (non-intrusive messages and widget).
2023-03-12 06:06:29 +01: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
Abdullah Tahiri
7954716386 Gui: Add Notification Area to Status bar
========================================

Parameter "NotificationAreaEnabled" can be used to completely disable the Notification Area.

If disabled it won't appear on the UI at all and no non-intrusive notification will be generated.
2023-03-12 06:06:29 +01:00
Abdullah Tahiri
b2ef6f3f43 Gui: Notification Area
======================

A notification area consisting of one area for non-intrusive notifications, and a widget showing previous
errors, warnings, critical messages and notifications.

Notifications being marked with QT_TRANSLATION_NOOP with context "Notifications" are translated.

Messages are shown during a minimum show time, unless pop up (clicked inside). Messages stay until
a maximum show time. Between the minimum and the maximum show times left mouse button events make
the non-intrusive notification disappear.

The widget stores a configurable amount of messages after which old messages are removed to make room for
new ones.

Unread messages are shown in bold.
2023-03-12 06:06:29 +01:00
Abdullah Tahiri
a3aedccc22 Gui: New Icon for Notification Area
Gui: Icon resources - Warning icon

Gui: Icons - squash
2023-03-12 06:06:29 +01:00
Abdullah Tahiri
980f7f7f7a Base: Observer - fix template instantiation
===========================================

Merit goes to Werner for figuring out the issue and proposing a MSVC/MSYS2 viable solution:
https://github.com/FreeCAD/FreeCAD/pull/8781#issuecomment-1464898566
2023-03-12 06:06:29 +01:00
Abdullah Tahiri
c7e0aad548 NotificationBox: clang-format formatting 2023-03-12 06:06:29 +01:00
Abdullah Tahiri
1ba43102b1 NotificationBox: Fixes
======================

QToolTip removed the Windows specific behaviour of passing a screen widget as parent for QLabel
in 44fb925f50471ebc23dcccfaa4e9d9873b05d205. NotificationBox code is simplified not to use a
parent widget at all.

A inappropriate review fix actually causing a bug is fixed.

https://github.com/FreeCAD/FreeCAD/pull/8352#discussion_r1111342024
2023-03-12 06:06:29 +01:00
Uwe
29ac3191da [Gui] fix bug on restoring PrefColorButton
- onRestore did not read in transparencies because App::Color::fromPackedRGB was used instead of App::Color::fromPackedRGBA
2023-03-11 15:49:59 +01:00
Syres916
2a1438be59 [Gui] Fix display names of Recent Macros 2023-03-09 15:08:35 +01:00
Uwe
b9b53e6ef7 [Gui] [skip ci] improve new icon
- remove the Python logo in it (not visible in this size and can be license issue in future)
- save as plain SVG
2023-03-09 15:04:54 +01:00
Syres916
5c7f1e5d0e [Gui] Add an icon for Std_RecentMacros command (#8793)
* [Gui] Add Std_RecentMacros.svg icon
* [Gui] Add Std_RecentMacros icon
* [Gui] Add icon to Std_RecentMacros command
2023-03-09 14:55:30 +01:00
wmayer
a72ca7f424 Gui: fixes #8501: FreeCAD crashes when constraining a sketch with an expression containing . (dot) 2023-03-09 12:45:16 +01:00
wmayer
0f6a79a474 Gui: fix possibly garbled toolbars and menus
See also Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=986821
For now enable this line only for Windows builds
2023-03-09 12:44:45 +01:00
wmayer
c0f434d388 Gui: check for more ExpressionBinding types 2023-03-09 12:43:44 +01:00
wmayer
296683e113 Gui: split icon handling from ExpressionBinding 2023-03-09 12:43:44 +01:00
Uwe
8fbd65a501 [Gui] NaviCube: don't write font size on loading preferences
- as discussed here: https://github.com/FreeCAD/FreeCAD/pull/8567#issuecomment-1445283127 and following)
2023-03-08 17:18:59 +01:00
berniev
6c9d7ebc7a an example of using constexpr array for data
simplifies code and removes the need for a class.
2023-03-07 23:22:44 +01:00
ronnystandtke
939ff4468f Bug fixes and improvements for workbenches settings (#8725)
* removed header strings from ui file so that they can be dynamically set from cpp file
* use enum for column numbers
* only replace load button with loaded indicator (much faster and checkboxes no longer get unselected by loading a workbench)
* improved i18n (allows better positioning of argument for translators)
* improved column ordering (buttons and checkboxes much closer to icon and name)
* fixed variable camelCase (checkbox -> checkBox)
* exit for-loop if button was found
* added check for nullptr
2023-03-07 12:42:22 -06:00
Abdullah Tahiri
ee0c3ad5c1 Console/ILogger: Refactor and extension
=======================================

Refactor:
 - Substitute the use of variadic templates with parameter packs.
 - Use recently incorporated external library "fmt" to handle printf like formating.
 - Extensive cleaning of pragmas and unnecessary forward declarations.
 - Parameter packs and libfmt provide a much stronger type checking now, so
   conversions that are by standard implicit as bool to int need an explicit static_cast
   to avoid compilation warnings.

Extension:
 - Include a notifier field, so that the originator of the message can be provided. E.g. Document#DocumentObject
 - Include a new type of message called CriticalMessage, this message is intended to have
   special behaviour in the future. Namely, it will be used to notify forward compatilibity issues.
   It will be used to substitute the current signal/slot mechanism.
 - Include two new types of messages for user notifications (Notification and TranslatedNotification). This messages
   will be use to convey UI notifications intended for the user (such as non-intrusive message about the usage of a tool). There
   are two versions to mark whether the string provided as a message is already translated or not. When using the console system for
   notifications, these notifications may originate from the App or the Gui. In the former, it is generally the case that the strings
   of messages are not (yet) translated (but they can be marked with QT_TRANSLATE_NOOP). In the latter, often the messages to be provided
   are already translated.

Python support for CriticalMessage, Notification and TranslatedNofification, including shortcuts:

    Crt = FreeCAD.Console.PrintCritical
    Ntf = FreeCAD.Console.PrintNotification
    Tnf = FreeCAD.Console.PrintTranslatedNotification
2023-03-07 16:13:23 +01:00
wmayer
3cafc5e782 Gui: Add download location to side bar of file dialog 2023-03-07 14:41:26 +01:00
wmayer
be7e78aaf9 Gui: fix regression with the default visibility of toolbars
If the user e.g. activates the Clipboard toolbar then it should not be hidden any more if the user switches to another workbench.
The way it is now the user has to make this toolbar visible over and over again when changing the workbench. This also has the negative effect that
the workbench selector changes its position
2023-03-07 10:43:12 +01:00
mosfet80
bed7b76524 remove Python2 code 2023-03-04 17:51:43 -06:00
Adrian Insaurralde Avalos
2d68ad5e7a [Gui] Split "File" toolbar and add "Clipboard" toolbar
"File" is split into "File", "Edit" and "Help"
"Clipboard" is hidden by default
2023-03-03 22:47:11 -06:00
Adrian Insaurralde Avalos
8200cde106 [Gui] ToolBarManager: add feature to make toolbars hidden by default 2023-03-03 22:47:11 -06:00
Syres916
1ad4eef455 [Gui] Recent macros, improve wording of Hint msg 2023-03-03 20:29:38 -06:00
Syres916
858a1d23a3 [Gui] Recent macros, enhance warning msg
See discussion : https://forum.freecadweb.org/viewtopic.php?f=3&t=75350
2023-03-03 20:29:38 -06:00
Adrian Insaurralde Avalos
662473b11f Improve NaviCube font matching on linux 2023-02-28 10:01:33 +01:00
Yorik van Havre
be6a654b3e merged crowdin translations 2023-02-27 16:01:15 +01:00
Yorik van Havre
2cd27ce328 updated ts files 2023-02-27 15:35:51 +01:00