update probe basic
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import os
|
||||
import linuxcnc
|
||||
|
||||
from qtpy import uic
|
||||
from qtpy.QtCore import Qt
|
||||
from qtpy.QtWidgets import QWidget
|
||||
from PySide6.QtWidgets import QWidget
|
||||
|
||||
import template_user_buttons_ui
|
||||
from qtpyvcp.widgets.button_widgets.action_button import ActionButton
|
||||
|
||||
from qtpyvcp.plugins import getPlugin
|
||||
from qtpyvcp.utilities import logger
|
||||
from qtpyvcp.actions import bindWidget, InvalidAction
|
||||
|
||||
LOG = logger.getLogger(__name__)
|
||||
|
||||
@@ -19,5 +21,17 @@ INI_FILE = linuxcnc.ini(os.getenv('INI_FILE_NAME'))
|
||||
class UserButton(QWidget):
|
||||
def __init__(self, parent=None):
|
||||
super(UserButton, self).__init__(parent)
|
||||
ui_file = os.path.splitext(os.path.basename(__file__))[0] + ".ui"
|
||||
uic.loadUi(os.path.join(os.path.dirname(__file__), ui_file), self)
|
||||
self.ui = template_user_buttons_ui.Ui_USER_BUTTONS()
|
||||
self.ui.setupUi(self)
|
||||
self._bind_action_buttons()
|
||||
|
||||
def _bind_action_buttons(self):
|
||||
# Explicitly bind dynamic buttons in case property-based binding was skipped.
|
||||
for button in self.findChildren(ActionButton):
|
||||
action_name = button.property("actionName")
|
||||
if not action_name:
|
||||
continue
|
||||
try:
|
||||
bindWidget(button, str(action_name))
|
||||
except InvalidAction:
|
||||
LOG.warning("Invalid action for user button %s: %s", button.objectName(), action_name)
|
||||
Reference in New Issue
Block a user