The problems I have are usually with editing things. If I do something that creates an 'error' (red text in the 'Report View' box) and don't notice - I find it is possible to get a mess I can't recover from. The problem is I'm looking at the model I'm working on - and miss the errors.
I'm not a python programmer - but I think there is a play-sound lib - don't know how to load it or how to write something that will make the beep - so any help would be welcome. (I'm running on Debian bullseye - 0.19.. )
Is there a way to make errors beep?
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
Is there a way to make errors beep?
I would rather have questions that cannot be answered,
than answers that cannot be questioned’
Richard Feynman.
than answers that cannot be questioned’
Richard Feynman.
Re: Is there a way to make errors beep?
I don't know of a beep, but you can configure Preferences->Output window->Show Report on error.
That opens the report view, which should be alert enough.
That opens the report view, which should be alert enough.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Is there a way to make errors beep?
Hi
good idea adding option in "General > Output Window > CheckBox "Beep or Sound file..."
mario
good idea adding option in "General > Output Window > CheckBox "Beep or Sound file..."
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Is there a way to make errors beep?
This macro will set it so that you get a beep every time the text changes in the report view. I haven't worked out how to distinguish errors, warnings, and regular messages. I thought of using rv.textColor(), but it seems to always return black no matter even if the message is in red. There might be a way to move the cursor up to get the previous line, but I have failed with that, too.
Usage: run the macro to install the beep observer. Hold down Ctrl key while running to disconnect the beep observer.
Code: Select all
from PySide import QtGui,QtCore
mw = Gui.getMainWindow()
rv = mw.findChild(QtGui.QTextEdit, "Report view")
def onMsg():
QtGui.QApplication.beep()
modifiers = QtGui.QApplication.keyboardModifiers()
if modifiers == QtCore.Qt.ControlModifier:
rv.textChanged.disconnect()
FreeCAD.Console.PrintMessage('beep observer disconnected\n')
else:
rv.textChanged.connect(onMsg)
FreeCAD.Console.PrintMessage('beep observer connected\n')
- Attachments
-
- report_view_beep.FCMacro
- (445 Bytes) Downloaded 18 times
Re: Is there a way to make errors beep?
Hi
mario
you are too fast thanksTheMarkster wrote: ↑Fri Jan 07, 2022 6:37 pm This macro will set it so that you get a beep every time the text changes in the report view.
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Is there a way to make errors beep?
I wanted to have the option to beep only for errors and warnings, but failed to make that work. It could be done in C++ code since the mechanism for opening the report view on these errors is already there.mario52 wrote: ↑Sat Jan 08, 2022 10:41 am Hi
you are too fast thanksTheMarkster wrote: ↑Fri Jan 07, 2022 6:37 pm This macro will set it so that you get a beep every time the text changes in the report view.
mario
To play another sound file:
Code: Select all
from PySide2 import QtMultimedia
QtMultimedia.QSound.play("some_file.wav")
Re: Is there a way to make errors beep?
OK - This is great! - really appreciate.
I've spent a lot of time creating problems by trying to edit things and not realizing I've corrupted the object.
The little nudge from the beep really helps..
I've spent a lot of time creating problems by trying to edit things and not realizing I've corrupted the object.
The little nudge from the beep really helps..
I would rather have questions that cannot be answered,
than answers that cannot be questioned’
Richard Feynman.
than answers that cannot be questioned’
Richard Feynman.