Commit Graph

64 Commits

Author SHA1 Message Date
Syres916
b1e4a2b044 [Gui] fix the Preferences tree font 2025-10-07 12:47:29 -05:00
Chris Hennes
f3d801f598 Gui: Fix ignored font preference 2025-09-18 11:45:45 -05:00
Markus Reitböck
a72a0d6405 Gui: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-14 09:47:03 +02:00
tetektoza
1439f3a9b3 Gui: Make Report View properly claim Select All (Ctrl+A) shortcut
Currently if user tries to use CTRL+A on Report View while having
document opened, it rejects the action and nothing happens.

This happened during the introduction of Select All (CTRL+A) behavior in
Sketcher. Basically, before Report View was not catching the event, but
neither any widget, resulting in QTextEdit catching it at the end of the
chain. Now, after enabling it for the whole document,
Report View rejected it, but we have registered it throughout the
document, so another widget was intercepting the event.

So, fix for that is simple - add a check for Select All shortcut on
Report View level, so the event will get consumed instead of being
rejected and propagated to further widgets.
2025-09-13 13:39:09 +02:00
Roy-043
ca2f45d99e Core: 2 Report View context menu items to Title Case 2025-08-24 13:06:39 +02:00
Max Wilfinger
6692dacc0a Gui: Update UI strings for consistency
Closes: #22135
2025-08-04 20:14:45 +02:00
Lee Matos
0e50784104 Gui: Fix #12199 missing font family Courier on MacOS 2025-07-28 10:17:18 +02:00
Max Wilfinger
d59f404267 Gui: Center notification label and disable show report view by default (#21872)
* Gui: Center notification label and disable show report view by default

* Stylesheet: min-width: 0 for QStatusBar QPushButton
2025-06-16 11:03:58 -05:00
bofdahof
ba2c2ca5ad Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
Andrea
2d4ab5af20 REMOVE old QT<= 5.14 code
Ubuntu 22.04  use qt 1.15.3.
In the code is still used qt code <5.10.
A cleanup was done by removing qT code version used in ubuntu 18.04.
2025-03-05 09:32:06 +01:00
Kacper Donat
13fbab9e42 Base: Move App::Color to Base
Every basic data type is stored in Base module, color is standing out as
one that does not. Moving it to Base opens possibilities to integrate it
better with the rest of FreeCAD.
2025-02-17 21:10:26 +01:00
Benjamin Bræstrup Sayoc
8d2d0a47f4 Gui: Use QStringLiteral 2025-02-10 18:34:57 +01:00
Pieter Hijma
06afcba869 Core: Fix a missing Python interpreter lock
ReportView has a missing Python interpreter lock.  It is not breaking
FreeCAD in general but it is deemed a bug nonetheless.  See the issue.
2024-06-27 08:02:15 -05:00
Abdullah Tahiri
4e7aa94b32 Gui: ReportView - include notifier string
=========================================

Console error, warnings, ... allow for a notifiername. This appears separately in the notification area. However, the report view ignores it.

This commit prepends the notifier string separated by a semicolon, if not empty.

It solves the problem that, if the message did not include the notifier, this was not indicated in the Report View.

If the message included the notifier, then it was duplicated in the notification area.
2023-11-13 12:04:53 -05:00
wmayer
888a33917d Gui: modernize C++: use equals default 2023-08-20 18:12:43 +02:00
wmayer
7d0926d0b3 Qt6 port:
Fix deprecation warnings with version 6.3 or 6.4
2023-08-04 21:23:14 -06:00
Abdullah Tahiri
5f52885fbf Ilogger - Separate behaviour for user exposed and not exposed loggers 2023-05-23 14:24:45 +02:00
Abdullah Tahiri
9d9f928b2d 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
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
9604f94fdc Core: add functions setPackedARGB and fromPackedRGBA 2023-02-26 10:11:53 +01:00
wmayer
337991cbc7 Gui: use Color::asPackedRGB<QColor>() 2023-02-26 10:11:53 +01:00
wmayer
76860143f7 Gui: replace slots with member function pointers 2023-02-03 00:21:38 +01:00
luz paz
d14cfc37d5 Gui: Rename 'Output window' to 'Report view'
Closes #7659
2022-11-07 22:51:23 -06:00
wmayer
4b08850edb Qt6 port:
* QApplication::setFallbackSessionManagementEnabled has been removed
* QString::medRef() has been removed. Use QString::mid() again.
* QTextStream::setCodec has been removed
* Use operator QVariant of the QFont class to make code Qt5 and Qt6 compatible
* Signature of QTreeWidget::mimeData() has changed in Qt6. Remove TreeWidget::mimeData() because it doesn't change the implementation
* QLayout::setMargin() is deprecated in Qt5 and has been removed in Qt6. Use QLayout::setContentsMargins()
* QDateTime::toTime_t() is deprecated in Qt5 and has been removed in Qt6. Use QDateTime::toSecsSinceEpoch()
* QDesktopWidget is deprecated in Qt5 and has been removed in Qt6. Use QScreen
2022-11-01 16:55:40 +01:00
0penBrain
4f17fa7387 Gui: fix default color of report view messages in preferences 2022-10-10 07:33:41 -07: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
berniev
75fa455c5d Gui: Use override etc 2 2022-08-09 12:43:23 +02:00
0penBrain
077114163a [BUGFIX] Gui: correctly restore message type enabling in report view 2022-07-05 13:35:18 +02:00
wmayer
4791575e31 Gui: remove some superfluous const_cast 2022-06-24 14:48:52 +02:00
wmayer
1178df06b4 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
Uwe
560c85c7f8 [Gui] Task* and Text*: remove unused includes 2022-03-05 17:44:07 +01:00
wmayer
195c87625d Gui: [skip ci] make some minor improvements in ReportOutput class 2022-02-24 17:56:52 +01:00
wmayer
a311bed2fd Gui: Fix problem where Python output and errors are not redirected to report view until preferences window is opened 2022-02-24 17:42:40 +01:00
wmayer
c7d419623c Gui: reduce code duplication in ReportOutputObserver and ReportOutput 2021-12-27 17:50:48 +01:00
Uwe
3d9b6eefac [GUI] don't show report view on warnings by default
I introduced FreeCAD to several people and see that especially newbies are confused with all the warnings they get but cannot understand.
The solution was to change that the report view panel is not automatically shown on every warning.
This PR does this.

More experienced users can anytime enable the option. Thus this PR has not much impact but obviously makes life easier for beginners.
2021-12-25 20:40:24 +01:00
wmayer
07c92cc218 Gui: make the Copy command of the report window working if an object in the tree is selected 2021-12-13 18:57:28 +01:00
wmayer
219ded18ba Gui: refactoring: move duplicated code to DockWindowManager::activate() 2021-12-09 07:40:44 +01:00
wmayer
dd4dd204d0 App/Gui: fix memory leaks:
+ add function to cleanup units and quantities in debug build
+ fix reference leak in PropertyVector::getPyPathValue()
+ fix reference leak in PropertyPlacement::getPyPathValue()
+ in InterpreterSingleton::init() use a static std::vector<wchar_t*> instead of a C array
  to free memory at program end
+ in MainWindow::closeEvent() explicitly delete all task watchers
+ in ReportOutputObserver constructor pass parent to QObject
+ in PropertyEditor destructor explicitly delete QItemEditorFactory
2021-02-27 10:56:19 +01:00
luz paz
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
Mark Ganson TheMarkster
749f71b3fd [Report View] fix inconsistencies
Make default values consistent for whether to show report view on log and normal messages.  Default values should be warnings: true, errors: true, normals: false, logs: false.
2020-08-24 16:30:12 +02:00
wmayer
3f7fb1af7a Gui: add an option to also suppress normal messages 2020-07-31 19:39:49 +02:00
mwganson
1a4a52356f [report view] add preferences to report view context menu 2020-07-31 19:39:49 +02:00
wmayer
79e8562f9b Gui: [skip ci] avoid to write several time stamps to a single line 2020-07-15 12:49:20 +02:00
mikeprice99
415f23227b Add timecode option for report view 2020-07-10 13:03:37 +02:00
wmayer
aefd5e2358 Qt5: 'void Q[Plain]TextEdit::setTabStopWidth(int)' is deprecated [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
8dbe26a95f Qt5: 'int QFontMetrics::width' is deprecated since Qt 5.11: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
891a435c55 Qt5: 'static QString Gui::TaskView::TaskWatcherCommands::trUtf8(const char*, const char*, int)' is deprecated [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
mwganson
26a3217b42 [Report View] add options to show report view on warning, error, normal, and log message types individually 2020-03-16 19:21:49 +01:00
wmayer
c642768756 fix regressions in SplashObserver::SendLog and ReportOutput::SendLog 2019-10-20 13:41:10 +02:00