diff --git a/dzgui/controllers/emitter.py b/dzgui/controllers/emitter.py index 1331160..17a59d0 100644 --- a/dzgui/controllers/emitter.py +++ b/dzgui/controllers/emitter.py @@ -156,7 +156,7 @@ class Emitter(GObject.GObject): pass @GObject.Signal(flags=GObject.SignalFlags.RUN_LAST, arg_types=(object, str, bool)) - def custom_mods_loaded(self, store: "FastInsertListStore", folder: str, has_duplicates: bool) -> None: + def custom_mods_loaded(self, store: "FastInsertListStore", folder: str) -> None: pass @GObject.Signal(flags=GObject.SignalFlags.RUN_LAST, arg_types=(str, bool)) diff --git a/dzgui/managers/offline.py b/dzgui/managers/offline.py index 952b56f..e6584b9 100644 --- a/dzgui/managers/offline.py +++ b/dzgui/managers/offline.py @@ -54,16 +54,7 @@ class OfflineManager: store = ModelFactory().make_mod_store() store.extend(mods) - has_duplicates = False - seen = set() - for row in store: - mod_id = row[1] - if mod_id in seen: - row[-1]=True - has_duplicates = True - seen.add(mod_id) - - func = StoredFunc(lambda: self.emitter.emit("custom_mods_loaded", store, folder, has_duplicates)) + func = StoredFunc(lambda: self.emitter.emit("custom_mods_loaded", store, folder)) self.thread_man.set_cleanup_func(func) def setup( diff --git a/dzgui/views/pages/offline.py b/dzgui/views/pages/offline.py index e3c448b..05b48a7 100644 --- a/dzgui/views/pages/offline.py +++ b/dzgui/views/pages/offline.py @@ -117,6 +117,7 @@ class ModFrame(HeadingFrame): sel.connect("changed", self._on_selection_changed) # TODO: inherit icons from warnings area in preconnect dialog + # TODO: strings self.error_label = Gtk.Label(label="No mods found", halign=Gtk.Align.START, margin_start=10, margin_bottom=5) self.vbox.pack_end(self.error_label, expand=True, fill=True, padding=3) @@ -209,19 +210,12 @@ class CustomModFrame(ModFrame): emitter: "Emitter", store: "FastInsertListStore", folder: str, - has_duplicates: bool, ) -> None: if len(store) == 0: self.hide_tree() else: self.present_tree() - if has_duplicates: - # TODO: block button access - # TODO: update error message - # cf hide_tree - pass - def _on_custom_button_clicked(self, button: Gtk.Button) -> None: local_mods = self.get_mods() self.parent.offline_man.get_custom_mods(local_mods) @@ -373,11 +367,12 @@ class OfflineLoader(Gtk.Box): self.controller.open_page(NotebookPage.MODS) def _on_ok_clicked(self, button: Gtk.Button) -> None: + # TODO: grab all values in one pass # appid = self.radio_frame.get_appid() # mission = self.mission_frame.get_mission() # local_mods = self.local_frame.get_mods() # custom_mods = self.custom_frame.get_mods() # cf. api.mods._hash(uid, use_custom=True) - # TODO: dynamically calculate new symlink hashes + # TODO: set up all symlinks prior to launch, including custom ones # self.offline_man.setup(appid, mission, local_mods, custom_mods) pass