ExcellonAdvOptPrefGroupUI.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. from PyQt5 import QtWidgets
  2. from PyQt5.QtCore import QSettings
  3. from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCCheckBox, NumericalEvalTupleEntry, NumericalEvalEntry
  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 ExcellonAdvOptPrefGroupUI(OptionsGroupUI):
  17. def __init__(self, decimals=4, parent=None):
  18. # OptionsGroupUI.__init__(self, "Excellon Advanced Options", parent=parent)
  19. super(ExcellonAdvOptPrefGroupUI, self).__init__(self, parent=parent)
  20. self.setTitle(str(_("Excellon Adv. Options")))
  21. self.decimals = decimals
  22. # #######################
  23. # ## ADVANCED OPTIONS ###
  24. # #######################
  25. self.exc_label = QtWidgets.QLabel('<b>%s:</b>' % _('Advanced Options'))
  26. self.exc_label.setToolTip(
  27. _("A list of advanced parameters.\n"
  28. "Those parameters are available only for\n"
  29. "Advanced App. Level.")
  30. )
  31. self.layout.addWidget(self.exc_label)
  32. grid0 = QtWidgets.QGridLayout()
  33. grid0.setColumnStretch(0, 0)
  34. grid0.setColumnStretch(1, 1)
  35. self.layout.addLayout(grid0)
  36. # Table Visibility CB
  37. self.table_visibility_cb = FCCheckBox(label=_('Table Show/Hide'))
  38. self.table_visibility_cb.setToolTip(
  39. _("Toggle the display of the Tools Table.")
  40. )
  41. grid0.addWidget(self.table_visibility_cb, 0, 0, 1, 2)
  42. # Auto Load Tools from DB
  43. self.autoload_db_cb = FCCheckBox('%s' % _("Auto load from DB"))
  44. self.autoload_db_cb.setToolTip(
  45. _("Automatic replacement of the tools from related application tools\n"
  46. "with tools from DB that have a close diameter value.")
  47. )
  48. grid0.addWidget(self.autoload_db_cb, 1, 0, 1, 2)
  49. self.layout.addStretch()