chore: move mod actions into ModManager (WIP)

This commit is contained in:
aclist committed 2026-04-25 22:00:14 +09:00
1 parent 39e3bb8d2d
commit 4535a19020
4 files changed
+81 -97

No files matched your search

+1 -6
View File
@@ -1,6 +1,5 @@
import re
from collections import deque
from typing import Any, Optional, TYPE_CHECKING
from warnings import deprecated
@@ -97,7 +96,6 @@ class ProxyModelManager:
if skip_cache is False:
if filters in self.filter_cache:
print("already in cache, not updating proxy model")
cache = self.filter_cache[filters]
self.set_proxy_model(cache[0])
self.set_filtered(cache[1])
@@ -106,17 +104,14 @@ class ProxyModelManager:
match mode:
case FilterMode.INITIAL:
rows = self.filter_initial(filters)
# TODO: consolidate into one enum
case FilterMode.TOGGLE_ON:
rows = self.filter_toggle_on(filters)
case FilterMode.TOGGLE_OFF:
for f in filters[2:]:
self.set_filtered(self.filter_toggle_off(filters, f))
rows = self.filtered
# NOTE: this FastInsertListStore manipulation must remain local to the thread
# NOTE: FastInsertListStore manipulation must remain local to the thread
clone = ModelFactory().make_server_store()
if len(rows) > 0:
rows = self.sort_rows(rows)
-9
View File
@@ -31,10 +31,6 @@ if TYPE_CHECKING:
logger = logging.getLogger(__name__)
# TODO: failure should spawn error dialog
# TODO: non failure with empty model: updates statusbar with help text
@dataclass
class NewPlayerCount:
treeiter: Gtk.TreeIter
@@ -357,11 +353,6 @@ class ServerModelManager:
proxy = self._get_proxy_man().get_proxy_model()
self.tv.set_model(proxy)
# TODO: make sure control model len is N + 1
# TODO: signals or other approach to deferring map
# model insertion after thread closes
# cf. servers_loaded signal
# TODO: servers_loaded vs servers_reloaded
self.emitter.emit("servers_loaded", self.enum)