Make all of the prefs sections into subclasses of PreferencesSectionUI

This commit is contained in:
David Robertson
2020-05-06 02:15:41 +01:00
parent 1c5a6de80d
commit 1fc076b158
8 changed files with 115 additions and 274 deletions

View File

@@ -1,27 +1,24 @@
from PyQt5 import QtWidgets
from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
from flatcamGUI.preferences.PreferencesSectionUI import PreferencesSectionUI
from flatcamGUI.preferences.cncjob.CNCJobAdvOptPrefGroupUI import CNCJobAdvOptPrefGroupUI
from flatcamGUI.preferences.cncjob.CNCJobOptPrefGroupUI import CNCJobOptPrefGroupUI
from flatcamGUI.preferences.cncjob.CNCJobGenPrefGroupUI import CNCJobGenPrefGroupUI
class CNCJobPreferencesUI(QtWidgets.QWidget):
class CNCJobPreferencesUI(PreferencesSectionUI):
def __init__(self, decimals, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)
self.layout = QtWidgets.QHBoxLayout()
self.setLayout(self.layout)
def __init__(self, decimals, **kwargs):
self.decimals = 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)
super().__init__(**kwargs)
self.layout.addWidget(self.cncjob_gen_group)
self.layout.addWidget(self.cncjob_opt_group)
self.layout.addWidget(self.cncjob_adv_opt_group)
self.layout.addStretch()
def build_groups(self) -> [OptionsGroupUI]:
return [
self.cncjob_gen_group,
self.cncjob_opt_group,
self.cncjob_adv_opt_group
]