GerberPreferencesUI.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
  2. from flatcamGUI.preferences.PreferencesSectionUI import PreferencesSectionUI
  3. from flatcamGUI.preferences.gerber.GerberEditorPrefGroupUI import GerberEditorPrefGroupUI
  4. from flatcamGUI.preferences.gerber.GerberExpPrefGroupUI import GerberExpPrefGroupUI
  5. from flatcamGUI.preferences.gerber.GerberAdvOptPrefGroupUI import GerberAdvOptPrefGroupUI
  6. from flatcamGUI.preferences.gerber.GerberOptPrefGroupUI import GerberOptPrefGroupUI
  7. from flatcamGUI.preferences.gerber.GerberGenPrefGroupUI import GerberGenPrefGroupUI
  8. import gettext
  9. import FlatCAMTranslation as fcTranslate
  10. import builtins
  11. fcTranslate.apply_language('strings')
  12. if '_' not in builtins.__dict__:
  13. _ = gettext.gettext
  14. class GerberPreferencesUI(PreferencesSectionUI):
  15. def __init__(self, decimals, **kwargs):
  16. self.decimals = decimals
  17. super().__init__(**kwargs)
  18. def build_groups(self) -> [OptionsGroupUI]:
  19. return [
  20. GerberGenPrefGroupUI(decimals=self.decimals),
  21. GerberOptPrefGroupUI(decimals=self.decimals), # FIXME vertical layout with opt and exp
  22. GerberExpPrefGroupUI(decimals=self.decimals),
  23. GerberAdvOptPrefGroupUI(decimals=self.decimals),
  24. GerberEditorPrefGroupUI(decimals=self.decimals)
  25. ]
  26. def get_tab_id(self):
  27. return "gerber_tab"
  28. def get_tab_label(self):
  29. return _("GERBER")