fix: accept emitter as arg
Some checks are pending
Mirror to Codeberg / mirror-to-codeberg (push) Waiting to run

This commit is contained in:
aclist 2026-06-10 19:23:14 +09:00
parent 486da7749a
commit 45fd180dcb
2 changed files with 13 additions and 8 deletions

View File

@ -1,13 +1,10 @@
import logging
import sys
from pathlib import Path
from dzgui.config.query import lookup
from dzgui.const.constants import APPID_DAYZ, APP_NAME, LIBRARYFOLDERS_PATH
from dzgui.const.enum import Preferences
from dzgui.strings.errors import dayz_not_found
from dzgui.views.dialogs.early_alert import EarlyAlertDialog
import dzgui.api.pefile as PeFile

View File

@ -1,3 +1,4 @@
from __future__ import annotations
from pathlib import Path
from typing import Self, Sequence, TYPE_CHECKING
@ -19,7 +20,6 @@ from dzgui.views.components.scrollable import NoOverlayScrolledWindow
from dzgui.views.trees.tree_mods import OfflineModTreeView
import gi
gi.require_version("Gtk", "3.0")
@ -108,6 +108,8 @@ class ModFrame(HeadingFrame):
def get_mods(self) -> list[str]:
model = self.tree.get_model()
if model is None:
return []
return [row[1] for row in model]
def collapse_tree(self) -> None:
@ -139,7 +141,9 @@ class ModFrame(HeadingFrame):
class CustomModFrame(ModFrame):
def __init__(self, parent: Gtk.Widget, controller: "Controller", heading: str) -> None:
def __init__(
self, parent: OfflineLoader, controller: "Controller", heading: str
) -> None:
super().__init__(controller, heading)
self.parent = parent
@ -155,8 +159,13 @@ class CustomModFrame(ModFrame):
self.emitter.connect("custom_mods_loaded", self._on_custom_mods_loaded)
def _on_custom_mods_loaded(self, emitter: "Emitter", store: "FastInsertListStore", folder: str, has_duplicates: bool) -> None:
def _on_custom_mods_loaded(
self,
emitter: "Emitter",
store: "FastInsertListStore",
folder: str,
has_duplicates: bool,
) -> None:
if len(store) == 0:
# TODO: pop error dialog area
# block button access
@ -171,7 +180,6 @@ class CustomModFrame(ModFrame):
# duplicates should block button access
pass
def _on_custom_button_clicked(self, button: Gtk.Button) -> None:
self.parent.parse_mods()