Skip to content

Commit 3cf8d4c

Browse files
committed
Fix config file fetching
There was a bug where fetching the configfile object from the parent it would crash the gui, now the config file object is passed to `FilamentTab` as an argument and it can be accessed there.
1 parent be027d8 commit 3cf8d4c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

BlocksScreen/lib/panels/filamentTab.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class FilamentStates(enum.Enum):
3939
def __repr__(self) -> str:
4040
return "<%s.%s>" % (self.__class__.__name__, self._name_)
4141

42-
def __init__(self, parent: QtWidgets.QWidget, printer: Printer, ws, /) -> None:
42+
def __init__(self, parent, printer: Printer, ws, config, /) -> None:
4343
super().__init__(parent)
4444
self.panel = Ui_filamentStackedWidget()
4545
self.panel.setupUi(self)
@@ -54,7 +54,7 @@ def __init__(self, parent: QtWidgets.QWidget, printer: Printer, ws, /) -> None:
5454
self._filament_state = self.FilamentStates.UNKNOWN
5555
self.filament_type = FilamentTypes.UNKNOWN
5656

57-
cfg = parent.config
57+
cfg = config
5858
if cfg.has_section("filament_presence"):
5959
i = cfg.get_section("filament_presence", None)
6060
self.filament_sensor = i.get("name", str, None)

0 commit comments

Comments
 (0)