ToolsSubPrefGroupUI.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. from PyQt5 import QtWidgets
  2. from PyQt5.QtCore import QSettings
  3. from appGUI.GUIElements import FCCheckBox
  4. from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
  5. import gettext
  6. import appTranslation as fcTranslate
  7. import builtins
  8. fcTranslate.apply_language('strings')
  9. if '_' not in builtins.__dict__:
  10. _ = gettext.gettext
  11. settings = QSettings("Open Source", "FlatCAM")
  12. if settings.contains("machinist"):
  13. machinist_setting = settings.value('machinist', type=int)
  14. else:
  15. machinist_setting = 0
  16. class ToolsSubPrefGroupUI(OptionsGroupUI):
  17. def __init__(self, decimals=4, parent=None):
  18. super(ToolsSubPrefGroupUI, self).__init__(self, parent=parent)
  19. self.setTitle(str(_("Substractor Tool Options")))
  20. self.decimals = decimals
  21. # ## Subtractor Tool Parameters
  22. self.sublabel = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
  23. self.sublabel.setToolTip(
  24. _("A tool to substract one Gerber or Geometry object\n"
  25. "from another of the same type.")
  26. )
  27. self.layout.addWidget(self.sublabel)
  28. self.close_paths_cb = FCCheckBox(_("Close paths"))
  29. self.close_paths_cb.setToolTip(_("Checking this will close the paths cut by the subtractor object."))
  30. self.layout.addWidget(self.close_paths_cb)
  31. self.delete_sources_cb = FCCheckBox(_("Delete source"))
  32. self.delete_sources_cb.setToolTip(
  33. _("When checked will delete the source objects\n"
  34. "after a successful operation.")
  35. )
  36. self.layout.addWidget(self.delete_sources_cb)
  37. self.layout.addStretch()