Revert "Preferences refactoring (pull request #309)"
This commit is contained in:
@@ -1,32 +1,12 @@
|
||||
from typing import Dict
|
||||
|
||||
from PyQt5 import QtWidgets
|
||||
|
||||
from PyQt5.QtCore import QSettings
|
||||
|
||||
import gettext
|
||||
import FlatCAMTranslation as fcTranslate
|
||||
import builtins
|
||||
|
||||
from flatcamGUI.preferences.OptionUI import OptionUI
|
||||
|
||||
fcTranslate.apply_language('strings')
|
||||
if '_' not in builtins.__dict__:
|
||||
_ = gettext.gettext
|
||||
|
||||
settings = QSettings("Open Source", "FlatCAM")
|
||||
if settings.contains("machinist"):
|
||||
machinist_setting = settings.value('machinist', type=int)
|
||||
else:
|
||||
machinist_setting = 0
|
||||
|
||||
|
||||
class OptionsGroupUI(QtWidgets.QGroupBox):
|
||||
app = None
|
||||
|
||||
def __init__(self, fixme_get_rid_of_this=None, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
|
||||
def __init__(self, title, parent=None):
|
||||
# QtGui.QGroupBox.__init__(self, title, parent=parent)
|
||||
super(OptionsGroupUI, self).__init__()
|
||||
self.setStyleSheet("""
|
||||
QGroupBox
|
||||
{
|
||||
@@ -36,38 +16,4 @@ class OptionsGroupUI(QtWidgets.QGroupBox):
|
||||
""")
|
||||
|
||||
self.layout = QtWidgets.QVBoxLayout()
|
||||
self.setLayout(self.layout)
|
||||
|
||||
def option_dict(self) -> Dict[str, OptionUI]:
|
||||
# FIXME!
|
||||
return {}
|
||||
|
||||
|
||||
class OptionsGroupUI2(OptionsGroupUI):
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.grid = QtWidgets.QGridLayout()
|
||||
self.layout.addLayout(self.grid)
|
||||
self.grid.setColumnStretch(0, 0)
|
||||
self.grid.setColumnStretch(1, 1)
|
||||
|
||||
self.options = self.build_options()
|
||||
|
||||
row = 0
|
||||
for option in self.options:
|
||||
row += option.add_to_grid(grid=self.grid, row=row)
|
||||
|
||||
self.layout.addStretch()
|
||||
|
||||
def build_options(self) -> [OptionUI]:
|
||||
return []
|
||||
|
||||
def option_dict(self) -> Dict[str, OptionUI]:
|
||||
result = {}
|
||||
for optionui in self.options:
|
||||
result[optionui.option] = optionui
|
||||
return result
|
||||
|
||||
|
||||
self.setLayout(self.layout)
|
||||
Reference in New Issue
Block a user