Revert "Preferences refactoring (pull request #309)"

This commit is contained in:
Marius Stanciu
2020-06-01 12:57:10 +00:00
parent 3c102f7753
commit 612aa6a48f
52 changed files with 6162 additions and 3951 deletions

View File

@@ -1,33 +1,27 @@
from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
from flatcamGUI.preferences.PreferencesSectionUI import PreferencesSectionUI
from PyQt5 import QtWidgets
from flatcamGUI.preferences.cncjob.CNCJobAdvOptPrefGroupUI import CNCJobAdvOptPrefGroupUI
from flatcamGUI.preferences.cncjob.CNCJobOptPrefGroupUI import CNCJobOptPrefGroupUI
from flatcamGUI.preferences.cncjob.CNCJobGenPrefGroupUI import CNCJobGenPrefGroupUI
import gettext
import FlatCAMTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
class CNCJobPreferencesUI(QtWidgets.QWidget):
class CNCJobPreferencesUI(PreferencesSectionUI):
def __init__(self, decimals, **kwargs):
def __init__(self, decimals, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)
self.layout = QtWidgets.QHBoxLayout()
self.setLayout(self.layout)
self.decimals = decimals
super().__init__(**kwargs)
def build_groups(self) -> [OptionsGroupUI]:
return [
CNCJobGenPrefGroupUI(decimals=self.decimals),
CNCJobOptPrefGroupUI(decimals=self.decimals),
CNCJobAdvOptPrefGroupUI(decimals=self.decimals)
]
self.cncjob_gen_group = CNCJobGenPrefGroupUI(decimals=self.decimals)
self.cncjob_gen_group.setMinimumWidth(260)
self.cncjob_opt_group = CNCJobOptPrefGroupUI(decimals=self.decimals)
self.cncjob_opt_group.setMinimumWidth(260)
self.cncjob_adv_opt_group = CNCJobAdvOptPrefGroupUI(decimals=self.decimals)
self.cncjob_adv_opt_group.setMinimumWidth(260)
def get_tab_id(self):
# FIXME this doesn't seem right
return "text_editor_tab"
self.layout.addWidget(self.cncjob_gen_group)
self.layout.addWidget(self.cncjob_opt_group)
self.layout.addWidget(self.cncjob_adv_opt_group)
def get_tab_label(self):
return _("CNC-JOB")
self.layout.addStretch()