mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 22:52:42 +01:00
fix: pass mods and iters to callback
This commit is contained in:
1 parent
e41bef7b00
commit
4e7c831a53
1 file changed
+8
-6
@@ -118,8 +118,7 @@ class ModManager:
|
|||||||
self.thread_man.increment_dialog()
|
self.thread_man.increment_dialog()
|
||||||
time.sleep(API_RATE_LIMIT)
|
time.sleep(API_RATE_LIMIT)
|
||||||
|
|
||||||
iters = [_iter for mod, _iter in mods]
|
func = StoredFunc(self._on_mods_unsubbed, mods)
|
||||||
func = StoredFunc(self._on_mods_unsubbed, iters)
|
|
||||||
self.thread_man.set_cleanup_func(func)
|
self.thread_man.set_cleanup_func(func)
|
||||||
|
|
||||||
def unsub_atomic_mod(self, mod: str) -> None:
|
def unsub_atomic_mod(self, mod: str) -> None:
|
||||||
@@ -146,18 +145,21 @@ class ModManager:
|
|||||||
pass
|
pass
|
||||||
time.sleep(API_RATE_LIMIT)
|
time.sleep(API_RATE_LIMIT)
|
||||||
|
|
||||||
def _on_mods_unsubbed(self, iters: list[Gtk.TreeIter]) -> None:
|
def _on_mods_unsubbed(self, mod_iter: list[tuple[str, Gtk.TreeIter]]) -> None:
|
||||||
|
mods = [int(mod) for mod, _iter in mod_iter]
|
||||||
|
iters = [_iter for mod, _iter in mod_iter]
|
||||||
if self.store is None:
|
if self.store is None:
|
||||||
return
|
return
|
||||||
for _iter in iters:
|
for _iter in iters:
|
||||||
self.store.remove(_iter)
|
self.store.remove(_iter)
|
||||||
remove_stale_signatures(self.prefs.paths.config, self.prefs.paths.version)
|
# TODO: process config path in called function
|
||||||
|
remove_stale_signatures(self.prefs.paths.config, self.prefs.paths.version, mods)
|
||||||
model = self.treeview.get_model()
|
model = self.treeview.get_model()
|
||||||
if model is None:
|
if model is None:
|
||||||
return
|
return
|
||||||
mods = len(model)
|
total_mods = len(model)
|
||||||
msg = self.format_mod_statusbar()
|
msg = self.format_mod_statusbar()
|
||||||
self.emitter.emit("mods_updated", msg, mods)
|
self.emitter.emit("mods_updated", msg, total_mods)
|
||||||
|
|
||||||
def uncolorize_mods(self) -> None:
|
def uncolorize_mods(self) -> None:
|
||||||
model = self.treeview.get_model()
|
model = self.treeview.get_model()
|
||||||
|
|||||||
Reference in new issue
Block a user