mirror of
https://github.com/aclist/dztui.git
synced 2026-08-29 19:27:13 +02:00
fix: rebuild symlinks on load
This commit is contained in:
parent
f839001097
commit
e86040747f
@ -23,6 +23,7 @@ from dzgui.model.model_factory import FastInsertListStore, ModelFactory
|
|||||||
from dzgui.strings import dialogs
|
from dzgui.strings import dialogs
|
||||||
from dzgui.util.format import format_mods
|
from dzgui.util.format import format_mods
|
||||||
from dzgui.util.strings import server_timeout
|
from dzgui.util.strings import server_timeout
|
||||||
|
from dzgui.util.symlink import rebuild_symlinks
|
||||||
from dzgui.views.dialogs.generic import ExceptionDialog
|
from dzgui.views.dialogs.generic import ExceptionDialog
|
||||||
|
|
||||||
|
|
||||||
@ -66,9 +67,13 @@ class ModManager:
|
|||||||
self.thread_man.set_cleanup_func(func)
|
self.thread_man.set_cleanup_func(func)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
prefs = self.controller.get_prefs()
|
||||||
|
rebuild_symlinks(prefs.paths.config)
|
||||||
|
|
||||||
self.store = ModelFactory().make_mod_store()
|
self.store = ModelFactory().make_mod_store()
|
||||||
self.store.extend(mods)
|
self.store.extend(mods)
|
||||||
func = StoredFunc(self._on_mods_loaded)
|
func = StoredFunc(self._on_mods_loaded)
|
||||||
|
|
||||||
self.thread_man.set_cleanup_func(func)
|
self.thread_man.set_cleanup_func(func)
|
||||||
|
|
||||||
def set_store(self, store: "FastInsertListStore") -> None:
|
def set_store(self, store: "FastInsertListStore") -> None:
|
||||||
@ -93,6 +98,7 @@ class ModManager:
|
|||||||
continue
|
continue
|
||||||
mod, _iter = res
|
mod, _iter = res
|
||||||
mods.append((mod, _iter))
|
mods.append((mod, _iter))
|
||||||
|
self.thread_man.set_job_count(len(mods))
|
||||||
self.unsub_all_mods(mods)
|
self.unsub_all_mods(mods)
|
||||||
|
|
||||||
def get_mod_from_tree_path(
|
def get_mod_from_tree_path(
|
||||||
@ -109,6 +115,7 @@ class ModManager:
|
|||||||
def unsub_all_mods(self, mods: list[tuple[str, Gtk.TreeIter]]) -> None:
|
def unsub_all_mods(self, mods: list[tuple[str, Gtk.TreeIter]]) -> None:
|
||||||
for mod, _iter in mods:
|
for mod, _iter in mods:
|
||||||
self.unsub_atomic_mod(mod)
|
self.unsub_atomic_mod(mod)
|
||||||
|
self.thread_man.increment_dialog()
|
||||||
|
|
||||||
iters = [_iter for mod, _iter in mods]
|
iters = [_iter for mod, _iter in mods]
|
||||||
func = StoredFunc(self._on_mods_unsubbed, iters)
|
func = StoredFunc(self._on_mods_unsubbed, iters)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user