GeometryEditorPrefGroupUI.py 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. from PyQt5 import QtWidgets
  2. from flatcamGUI.GUIElements import FCSpinner, RadioSet
  3. from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
  4. class GeometryEditorPrefGroupUI(OptionsGroupUI):
  5. def __init__(self, decimals=4, parent=None):
  6. # OptionsGroupUI.__init__(self, "Gerber Adv. Options Preferences", parent=parent)
  7. super(GeometryEditorPrefGroupUI, self).__init__(self)
  8. self.setTitle(str(_("Geometry Editor")))
  9. self.decimals = decimals
  10. # Advanced Geometry Parameters
  11. self.param_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
  12. self.param_label.setToolTip(
  13. _("A list of Geometry Editor parameters.")
  14. )
  15. self.layout.addWidget(self.param_label)
  16. grid0 = QtWidgets.QGridLayout()
  17. self.layout.addLayout(grid0)
  18. # Selection Limit
  19. self.sel_limit_label = QtWidgets.QLabel('%s:' % _("Selection limit"))
  20. self.sel_limit_label.setToolTip(
  21. _("Set the number of selected geometry\n"
  22. "items above which the utility geometry\n"
  23. "becomes just a selection rectangle.\n"
  24. "Increases the performance when moving a\n"
  25. "large number of geometric elements.")
  26. )
  27. self.sel_limit_entry = FCSpinner()
  28. self.sel_limit_entry.set_range(0, 9999)
  29. grid0.addWidget(self.sel_limit_label, 0, 0)
  30. grid0.addWidget(self.sel_limit_entry, 0, 1)
  31. # Milling Type
  32. milling_type_label = QtWidgets.QLabel('%s:' % _('Milling Type'))
  33. milling_type_label.setToolTip(
  34. _("Milling type:\n"
  35. "- climb / best for precision milling and to reduce tool usage\n"
  36. "- conventional / useful when there is no backlash compensation")
  37. )
  38. self.milling_type_radio = RadioSet([{'label': _('Climb'), 'value': 'cl'},
  39. {'label': _('Conventional'), 'value': 'cv'}])
  40. grid0.addWidget(milling_type_label, 1, 0)
  41. grid0.addWidget(self.milling_type_radio, 1, 1)
  42. self.layout.addStretch()