Skip to content

Commit 7ab7e8d

Browse files
committed
qtplasmac: fix "show last five" and "clear all" for error messages
1 parent bfb09e7 commit 7ab7e8d

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

share/qtvcp/screens/qtplasmac/qtplasmac_handler.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
from qtvcp.widgets.status_label import StatusLabel as STATLABEL
6464
from qtvcp.widgets.stylesheeteditor import StyleSheetEditor as SSE
6565
from qtvcp.lib.aux_program_loader import Aux_program_loader
66-
from qtvcp.lib.notify import Notify
6766
from plasmac import run_from_line as RFL
6867
from rs274.glcanon import GlCanonDraw
6968
from qt5_graphics import Lcnc_3dGraphics as DRO
@@ -74,7 +73,6 @@
7473
INFO = Info()
7574
ACTION = Action()
7675
TOOL = Tool()
77-
NOTICE = Notify()
7876
AUX_PRGM = Aux_program_loader()
7977
INIPATH = os.environ.get('INI_FILE_NAME', '/dev/null')
8078

@@ -591,9 +589,10 @@ def screen_options_patch(self):
591589
# we want custom notifications for jog errors
592590
def new_process_error(self, w, kind, text):
593591
O = self.w.screen_options
592+
N = O.QTVCP_INSTANCE_._NOTICE
594593
if O.desktop_notify:
595594
if 'on limit switch error' in text:
596-
NOTICE.update(O.notify_hard_limits, title='Machine Error:', message=text, msgs=O.notify_max_msgs)
595+
N.update(O.notify_hard_limits, title='Machine Error:', message=text, msgs=O.notify_max_msgs)
597596
elif 'jog-inhibit' in text:
598597
if self.w.led_float_switch.hal_pin.get():
599598
trigger = _translate('HandlerClass', 'Float Switch')
@@ -603,21 +602,21 @@ def new_process_error(self, w, kind, text):
603602
trigger = _translate('HandlerClass', 'Breakaway Switch')
604603
msg0 = _translate('HandlerClass', 'has disabled jogging')
605604
text = '{} {}\n'.format(trigger, msg0)
606-
NOTICE.update(O.notify_critical, title='Operator Error:', message=text, msgs=O.notify_max_msgs)
605+
N.update(O.notify_critical, title='Operator Error:', message=text, msgs=O.notify_max_msgs)
607606
elif kind == linuxcnc.OPERATOR_ERROR:
608-
NOTICE.update(O.notify_critical, title='Operator Error:', message=text, msgs=O.notify_max_msgs)
607+
N.update(O.notify_critical, title='Operator Error:', message=text, msgs=O.notify_max_msgs)
609608
elif kind == linuxcnc.OPERATOR_TEXT:
610-
NOTICE.update(O.notify_critical, title='Operator Text:', message=text, msgs=O.notify_max_msgs)
609+
N.update(O.notify_critical, title='Operator Text:', message=text, msgs=O.notify_max_msgs)
611610
elif kind == linuxcnc.OPERATOR_DISPLAY:
612-
NOTICE.update(O.notify_critical, title='Operator Display:', message=text, msgs=O.notify_max_msgs)
611+
N.update(O.notify_critical, title='Operator Display:', message=text, msgs=O.notify_max_msgs)
613612
elif kind == linuxcnc.NML_ERROR:
614-
NOTICE.update(O.notify_critical, title='Internal NML Error:', message=text, msgs=O.notify_max_msgs)
613+
N.update(O.notify_critical, title='Internal NML Error:', message=text, msgs=O.notify_max_msgs)
615614
elif kind == linuxcnc.NML_TEXT:
616-
NOTICE.update(O.notify_critical, title='Internal NML Text:', message=text, msgs=O.notify_max_msgs)
615+
N.update(O.notify_critical, title='Internal NML Text:', message=text, msgs=O.notify_max_msgs)
617616
elif kind == linuxcnc.NML_DISPLAY:
618-
NOTICE.update(O.notify_critical, title='Internal NML Display:', message=text, msgs=O.notify_max_msgs)
617+
N.update(O.notify_critical, title='Internal NML Display:', message=text, msgs=O.notify_max_msgs)
619618
elif kind == STATUS.TEMPARARY_MESSAGE:
620-
NOTICE.update(O.notify_normal,
619+
N.update(O.notify_normal,
621620
title='Operator Info:',
622621
message=text,
623622
status_timeout=0,

0 commit comments

Comments
 (0)