Draft: Added a preference to turn on/off tool messages (off by default) - fixes #7078

This commit is contained in:
Yorik van Havre
2023-11-23 16:27:36 +01:00
parent b5adfff293
commit b1bcfec271
28 changed files with 149 additions and 111 deletions

View File

@@ -35,6 +35,8 @@ added manually.
# @{
import FreeCAD as App
params = App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft")
def _msg(text, end="\n"):
"""Write messages to the console including the line ending."""
@@ -55,4 +57,10 @@ def _log(text, end="\n"):
"""Write messages to the log file including the line ending."""
App.Console.PrintLog(text + end)
def _toolmsg(text, end="\n"):
"""Write messages to the console including the line ending,
only if ToolMessages pref setting is True"""
if params.GetBool("ToolMessages", False):
App.Console.PrintMessage(text + end)
## @}