mirror of
https://github.com/aclist/dztui.git
synced 2026-08-29 03:06:56 +02:00
chore: drop unused code
This commit is contained in:
parent
8e6cff4bf0
commit
d45d0a8da0
@ -12,11 +12,6 @@ if TYPE_CHECKING:
|
|||||||
from dzgui.model.model_factory import FastInsertListStore
|
from dzgui.model.model_factory import FastInsertListStore
|
||||||
from dzgui.model.servers import NewPlayerCount
|
from dzgui.model.servers import NewPlayerCount
|
||||||
|
|
||||||
import gi
|
|
||||||
|
|
||||||
gi.require_version("Gtk", "3.0")
|
|
||||||
from gi.repository.Gtk import TreeIter
|
|
||||||
|
|
||||||
|
|
||||||
class ProxyModelManager:
|
class ProxyModelManager:
|
||||||
"""
|
"""
|
||||||
@ -32,7 +27,6 @@ class ProxyModelManager:
|
|||||||
|
|
||||||
def __init__(self, filter_man: "FilterManager") -> None:
|
def __init__(self, filter_man: "FilterManager") -> None:
|
||||||
self.filter_cache = {}
|
self.filter_cache = {}
|
||||||
self.ping_cache: dict[str, int] = {}
|
|
||||||
|
|
||||||
self.proxy_model: "FastInsertListStore" = None
|
self.proxy_model: "FastInsertListStore" = None
|
||||||
self.filter_man = filter_man
|
self.filter_man = filter_man
|
||||||
@ -103,17 +97,6 @@ class ProxyModelManager:
|
|||||||
self.set_filtered(self.filter_toggle_off(filters, f))
|
self.set_filtered(self.filter_toggle_off(filters, f))
|
||||||
rows = self.filtered
|
rows = self.filtered
|
||||||
|
|
||||||
# case FilterMode.TOGGLE_ON:
|
|
||||||
# rows = self.filter_toggle_on(filters)
|
|
||||||
# # rows = self.filter_toggle_on(filters, *args)
|
|
||||||
|
|
||||||
# TODO: unimplemented
|
|
||||||
# just write pings into control model instead
|
|
||||||
# if mode is not FilterMode.INITIAL:
|
|
||||||
# for row in rows:
|
|
||||||
# if row[7] in self.ping_cache:
|
|
||||||
# row[9] = self.ping_cache[row[7]]
|
|
||||||
|
|
||||||
# NOTE: this FastInsertListStore manipulation must remain local to the thread
|
# NOTE: this FastInsertListStore manipulation must remain local to the thread
|
||||||
clone = ModelFactory().make_server_store()
|
clone = ModelFactory().make_server_store()
|
||||||
if len(rows) > 0:
|
if len(rows) > 0:
|
||||||
@ -273,25 +256,9 @@ class ProxyModelManager:
|
|||||||
def get_control(self) -> list:
|
def get_control(self) -> list:
|
||||||
return self.control_model
|
return self.control_model
|
||||||
|
|
||||||
# @deprecated("Legacy code")
|
|
||||||
# def set_success(self, result: bool) -> None:
|
|
||||||
# self.success = result
|
|
||||||
|
|
||||||
# @deprecated("Legacy code")
|
|
||||||
# def get_success(self) -> bool:
|
|
||||||
# return self.success
|
|
||||||
|
|
||||||
# NOTE: used when adding/removing rows in-situ in the proxy model
|
|
||||||
# and syncing changes to control model, but ignored for player count/ping updates
|
|
||||||
# cf. remove_from_history(), remove_server()
|
|
||||||
# NOTE: this can most likely be simplified for v7
|
|
||||||
def wipe_cache(self, full=False) -> None:
|
def wipe_cache(self, full=False) -> None:
|
||||||
# self.set_success(True)
|
|
||||||
self.filtered = None
|
self.filtered = None
|
||||||
self.filter_cache = {}
|
self.filter_cache = {}
|
||||||
self.ping_cache = {}
|
|
||||||
# if full:
|
|
||||||
# self.control_model = None
|
|
||||||
|
|
||||||
def push(self, data: list[Any]) -> None:
|
def push(self, data: list[Any]) -> None:
|
||||||
self.wipe_cache()
|
self.wipe_cache()
|
||||||
|
|||||||
@ -6,7 +6,7 @@ from dzgui.views.components.buttonbox import ButtonBox
|
|||||||
from dzgui.views.components.filter_panel import FilterPanel
|
from dzgui.views.components.filter_panel import FilterPanel
|
||||||
from dzgui.views.components.mod_panel import ModSelectionPanel
|
from dzgui.views.components.mod_panel import ModSelectionPanel
|
||||||
from dzgui.views.components.buttons import RefreshButton, KeysButton
|
from dzgui.views.components.buttons import RefreshButton, KeysButton
|
||||||
from dzgui.const.constants import EXPAND, NO_EXPAND, NO_FILL, FILL, NO_PADDING
|
from dzgui.const.constants import NO_EXPAND, NO_FILL, FILL, NO_PADDING
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
|
|
||||||
@ -58,7 +58,9 @@ class RightPanel(Gtk.Box):
|
|||||||
self.pack_start(self.sel_panel, NO_EXPAND, NO_FILL, NO_PADDING)
|
self.pack_start(self.sel_panel, NO_EXPAND, NO_FILL, NO_PADDING)
|
||||||
self.pack_start(eb, NO_EXPAND, FILL, NO_PADDING)
|
self.pack_start(eb, NO_EXPAND, FILL, NO_PADDING)
|
||||||
|
|
||||||
def _on_server_page_changed(self, emitter: "Emitter", page: "ServerTreeView") -> None:
|
def _on_server_page_changed(
|
||||||
|
self, emitter: "Emitter", page: "ServerTreeView"
|
||||||
|
) -> None:
|
||||||
"""Initially set filter area to disabled"""
|
"""Initially set filter area to disabled"""
|
||||||
if page.loaded is True:
|
if page.loaded is True:
|
||||||
return
|
return
|
||||||
@ -66,7 +68,7 @@ class RightPanel(Gtk.Box):
|
|||||||
|
|
||||||
def _on_servers_loaded(self, emitter: "Emitter", context: "ServerTab") -> None:
|
def _on_servers_loaded(self, emitter: "Emitter", context: "ServerTab") -> None:
|
||||||
# TODO: similar logic on notebook page change
|
# TODO: similar logic on notebook page change
|
||||||
print('servers loaded')
|
print("servers loaded")
|
||||||
state = self.controller.has_server_model()
|
state = self.controller.has_server_model()
|
||||||
for widget in (self.refresh_button, self.filters_vbox):
|
for widget in (self.refresh_button, self.filters_vbox):
|
||||||
widget.set_sensitive(state)
|
widget.set_sensitive(state)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user