From 7994bf988c1c8600761188f9d0e896323f93c606 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Thu, 13 Aug 2026 13:27:40 +0900 Subject: [PATCH] chore: clear typehinting errors --- dzgui/managers/filter.py | 6 +++--- dzgui/util/map_count.py | 6 +++--- dzgui/views/components/filter_panel.py | 16 +++++++--------- dzgui/views/dialogs/early_alert.py | 2 +- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/dzgui/managers/filter.py b/dzgui/managers/filter.py index b4c02e5..634bf8b 100644 --- a/dzgui/managers/filter.py +++ b/dzgui/managers/filter.py @@ -21,11 +21,11 @@ class FilterManager: strings.filter_3pp: True, strings.filter_night: True, strings.filter_full: show_full, - strings.filter_lowpop: True, - strings.filter_nonascii: False, - strings.filter_duplicate: False, strings.filter_official: True, + strings.filter_nonascii: False, + strings.filter_lowpop: True, strings.filter_unofficial: True, + strings.filter_duplicate: False, strings.filter_modded: True, } diff --git a/dzgui/util/map_count.py b/dzgui/util/map_count.py index 280cb2b..41897fa 100644 --- a/dzgui/util/map_count.py +++ b/dzgui/util/map_count.py @@ -48,14 +48,14 @@ def set_map_count() -> None: return conf = "/etc/sysctl.d/dayz.conf" - count = f"vm.max_map_count={MIN_COUNT}" + value = f"vm.max_map_count={MIN_COUNT}" try: - 1/0 + 1 / 0 msg = map_count.prompt.format(conf) print(msg) with tempfile.NamedTemporaryFile(delete=False) as f: tmp = f.name - Path(tmp).write_text(count) + Path(tmp).write_text(value) mv_cmd = f"sudo mv {tmp} {conf}" reload_cmd = f"sudo sysctl -p {conf}" diff --git a/dzgui/views/components/filter_panel.py b/dzgui/views/components/filter_panel.py index c79ee0c..4554cf8 100644 --- a/dzgui/views/components/filter_panel.py +++ b/dzgui/views/components/filter_panel.py @@ -33,15 +33,15 @@ class ButtonGrid(Gtk.Grid): super().__init__( halign=Gtk.Align.CENTER, column_spacing=5, column_homogeneous=True ) - row = 1 - col = 0 - self.controller = controller self.emitter = controller.get_emitter() self.checks: list[Gtk.CheckButton] = [] - # TODO: use enumerated checks + flowbox = Gtk.FlowBox( + halign=Gtk.Align.CENTER, min_children_per_line=3, max_children_per_line=3 + ) + for check in defaults.keys(): checkbox = Gtk.CheckButton(label=check) label = checkbox.get_child() @@ -51,14 +51,12 @@ class ButtonGrid(Gtk.Grid): if defaults[check]: checkbox.set_active(True) - col = col + 1 - if col > 3: - row += 1 - col = 1 - self.attach(checkbox, col, row, 1, 1) checkbox.connect("toggled", self._on_check_toggled) + flowbox.add(checkbox) self.checks.append(checkbox) + self.add(flowbox) + def block_toggles(self, state: bool) -> None: for check in self.checks: self.controller.suppress_signal( diff --git a/dzgui/views/dialogs/early_alert.py b/dzgui/views/dialogs/early_alert.py index 1ef51f9..9e034ba 100644 --- a/dzgui/views/dialogs/early_alert.py +++ b/dzgui/views/dialogs/early_alert.py @@ -23,7 +23,7 @@ class AbortDialog(Gtk.MessageDialog): self.format_secondary_text(msg) ma = self.get_message_area() - label = ma.get_children()[1] + label = ma.get_children()[1] # type: ignore label.set_justify(Gtk.Justification.CENTER) aa = self.get_action_area()