mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 14:42:54 +01:00
chore: clear errors
This commit is contained in:
1 parent
f3ad104b1b
commit
e64feac425
19 files changed
+56
-72
No files matched your search
+15
-15
@@ -110,21 +110,21 @@ def get_missing_mods(local: list, remote: list) -> list:
|
|||||||
return [mod for mod in remote if mod not in local]
|
return [mod for mod in remote if mod not in local]
|
||||||
|
|
||||||
|
|
||||||
# FIXME: steam path is missing when comparing to local mods
|
# TODO: drop
|
||||||
def get_server_modlist(server: Record, steam: Path) -> list:
|
# def get_server_modlist(server: Record, steam: Path) -> list:
|
||||||
try:
|
# try:
|
||||||
rules = dayzquery.dayz_rules((server.ip, server.qport))
|
# rules = dayzquery.dayz_rules((server.ip, server.qport))
|
||||||
except Exception as e:
|
# except Exception as e:
|
||||||
raise e
|
# raise e
|
||||||
remote_mods = [[mod.name, mod.workshop_id] for mod in rules.mods]
|
# remote_mods = [[mod.name, mod.workshop_id] for mod in rules.mods]
|
||||||
remote_mods.sort(key=lambda row: row[0])
|
# remote_mods.sort(key=lambda row: row[0])
|
||||||
local_mods = get_local_mod_ids(steam)
|
# local_mods = get_local_mod_ids(steam)
|
||||||
for mod in remote_mods:
|
# for mod in remote_mods:
|
||||||
if mod[1] in local_mods:
|
# if mod[1] in local_mods:
|
||||||
mod.append(checkmark)
|
# mod.append(checkmark)
|
||||||
else:
|
# else:
|
||||||
mod.append("")
|
# mod.append("")
|
||||||
return remote_mods
|
# return remote_mods
|
||||||
|
|
||||||
|
|
||||||
def _hash(uid: str) -> str:
|
def _hash(uid: str) -> str:
|
||||||
|
|||||||
@@ -436,18 +436,11 @@ def validate_ip(addr: str) -> Record:
|
|||||||
return record
|
return record
|
||||||
|
|
||||||
|
|
||||||
# TODO: do not return empty list in event of failure
|
|
||||||
def get_rules(record: Record) -> list["DayzMod"]:
|
def get_rules(record: Record) -> list["DayzMod"]:
|
||||||
ip = record.ip
|
ip = record.ip
|
||||||
qport = record.qport
|
qport = record.qport
|
||||||
#try:
|
|
||||||
mods = dayzquery.dayz_rules((ip, qport)).mods
|
mods = dayzquery.dayz_rules((ip, qport)).mods
|
||||||
return [mod for mod in mods]
|
return [mod for mod in mods]
|
||||||
#except Exception as e:
|
|
||||||
# logger.critical(e)
|
|
||||||
# raise e
|
|
||||||
# TODO: supposed to skip failing servers for highlight action
|
|
||||||
#return []
|
|
||||||
|
|
||||||
|
|
||||||
def query_by_id(addr: str, key: str, full: bool = False) -> dict[Any] | None:
|
def query_by_id(addr: str, key: str, full: bool = False) -> dict[Any] | None:
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ logger = logging.getLogger(APP_NAME)
|
|||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from dayzquery import DayzMod
|
from dayzquery import DayzMod
|
||||||
from dzgui.api.servers import Record
|
from dzgui.api.servers import PreReqs, Record
|
||||||
from dzgui.const.enum import ServerTab
|
from dzgui.const.enum import ServerTab
|
||||||
from dzgui.managers.filter import FilterManager
|
from dzgui.managers.filter import FilterManager
|
||||||
from dzgui.util.dist import Haversine
|
from dzgui.util.dist import Haversine
|
||||||
@@ -458,7 +458,7 @@ class Controller(GObject.GObject):
|
|||||||
def set_exit_event(self) -> None:
|
def set_exit_event(self) -> None:
|
||||||
self.exit_event.set()
|
self.exit_event.set()
|
||||||
|
|
||||||
def open_connection_assistant(self, res: dict[Any], mods: list["DayzMod"]) -> None:
|
def open_connection_assistant(self, res: "PreReqs", mods: list["DayzMod"]) -> None:
|
||||||
self.open_page(NotebookPage.CONNECTION)
|
self.open_page(NotebookPage.CONNECTION)
|
||||||
self.mediator.preconnect.populate(res, mods)
|
self.mediator.preconnect.populate(res, mods)
|
||||||
# TODO: populate assistant
|
# TODO: populate assistant
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ def migrate_legacy_conf(config: Path) -> None:
|
|||||||
old_conf = Path.home() / LEGACY_CONFIG_PATH
|
old_conf = Path.home() / LEGACY_CONFIG_PATH
|
||||||
if old_conf.is_file():
|
if old_conf.is_file():
|
||||||
j = rc2json(old_conf)
|
j = rc2json(old_conf)
|
||||||
# FIXME: superfluous use of Path()
|
config.parent.mkdir(parents=True, exist_ok=True)
|
||||||
Path(config).parent.mkdir(parents=True, exist_ok=True)
|
|
||||||
config.write_text(j)
|
config.write_text(j)
|
||||||
else:
|
else:
|
||||||
print("Unimplemented. You must have a working dztuirc.")
|
print("Unimplemented. You must have a working dztuirc.")
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ def main() -> None:
|
|||||||
is_dayz_running()
|
is_dayz_running()
|
||||||
is_steam_running()
|
is_steam_running()
|
||||||
|
|
||||||
|
# NOTE: clear versions file of unlinked mods
|
||||||
rebuild_symlinks(XDG.config)
|
rebuild_symlinks(XDG.config)
|
||||||
remove_stale_signatures(XDG.config, XDG.version)
|
remove_stale_signatures(XDG.config, XDG.version)
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ class ConnectionManager:
|
|||||||
info = res.source
|
info = res.source
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# TODO: proper error handling (currently returns empty list)
|
|
||||||
mods = self._query_modlist(record)
|
mods = self._query_modlist(record)
|
||||||
except Exception:
|
except Exception:
|
||||||
self.thread_man.set_cleanup_func(failure_func, destroy_first=True)
|
self.thread_man.set_cleanup_func(failure_func, destroy_first=True)
|
||||||
@@ -94,13 +93,6 @@ class ConnectionManager:
|
|||||||
mods = Servers.get_rules(record)
|
mods = Servers.get_rules(record)
|
||||||
steam_path = self.controller.query_config(Preferences.DEFAULT)
|
steam_path = self.controller.query_config(Preferences.DEFAULT)
|
||||||
local = get_local_mod_ids(steam_path)
|
local = get_local_mod_ids(steam_path)
|
||||||
# if len(mods) == 0:
|
|
||||||
# # TODO: separate message for no mods
|
|
||||||
# # TODO: separate message for actual timeout
|
|
||||||
# self.thread_man.set_cleanup_func(
|
|
||||||
# StoredFunc(self._server_timeout), destroy_first=True
|
|
||||||
# )
|
|
||||||
# return
|
|
||||||
alpha_mods = [
|
alpha_mods = [
|
||||||
[
|
[
|
||||||
mod.name,
|
mod.name,
|
||||||
|
|||||||
@@ -180,14 +180,7 @@ class ModManager:
|
|||||||
# TODO: strings
|
# TODO: strings
|
||||||
@call_on_thread("working")
|
@call_on_thread("working")
|
||||||
def highlight_stale(self) -> None:
|
def highlight_stale(self) -> None:
|
||||||
# try:
|
|
||||||
stale = find_stale_mods(self.prefs.paths.config)
|
stale = find_stale_mods(self.prefs.paths.config)
|
||||||
# except Exception:
|
|
||||||
# # TODO: clearer error message
|
|
||||||
# func = StoredFunc(self._server_timeout)
|
|
||||||
# self.thread_man.set_cleanup_func(func)
|
|
||||||
# return
|
|
||||||
|
|
||||||
func = StoredFunc(self._on_stale_mods_found, stale)
|
func = StoredFunc(self._on_stale_mods_found, stale)
|
||||||
self.thread_man.set_cleanup_func(func)
|
self.thread_man.set_cleanup_func(func)
|
||||||
|
|
||||||
|
|||||||
@@ -328,10 +328,8 @@ class ServerModelManager:
|
|||||||
ips = config_man.lookup(Preferences.IP_LIST)
|
ips = config_man.lookup(Preferences.IP_LIST)
|
||||||
self.thread_man.set_job_count(len(ips))
|
self.thread_man.set_job_count(len(ips))
|
||||||
|
|
||||||
# TODO: customize statusbar to mention how records can be added via contextmenu
|
|
||||||
if len(ips) == 0:
|
if len(ips) == 0:
|
||||||
# FIXME: this is not a failure, just a quiet exit with custom statusbar
|
# TODO: customize statusbar to mention how records can be added via contextmenu
|
||||||
# TODO: add custom statusbar parameters
|
|
||||||
self.thread_man.set_cleanup_func(
|
self.thread_man.set_cleanup_func(
|
||||||
StoredFunc(self._cleanup_on_failure, False)
|
StoredFunc(self._cleanup_on_failure, False)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -28,19 +28,18 @@ def rebuild_symlinks(config: Path) -> None:
|
|||||||
source = Path(dayz_path / md5sum)
|
source = Path(dayz_path / md5sum)
|
||||||
if source.exists() is False:
|
if source.exists() is False:
|
||||||
source.symlink_to(workshop / uid)
|
source.symlink_to(workshop / uid)
|
||||||
|
clone_symlinks(steam_path)
|
||||||
|
|
||||||
|
|
||||||
def clone_symlinks(config: Path) -> None:
|
def clone_symlinks(steam_path: Path) -> None:
|
||||||
"""
|
"""
|
||||||
Used after any symlink operation
|
Used after any symlink operation
|
||||||
"""
|
"""
|
||||||
path = lookup(config, Preferences.DEFAULT)
|
|
||||||
steam_path = Path(path)
|
|
||||||
try:
|
try:
|
||||||
dayz_path = PeFile.get_nested_app_path(steam_path, APPID_DAYZ)
|
dayz_path = PeFile.get_nested_app_path(steam_path, APPID_DAYZ)
|
||||||
exp_path = PeFile.get_nested_app_path(steam_path, APPID_DAYZ_EXP)
|
exp_path = PeFile.get_nested_app_path(steam_path, APPID_DAYZ_EXP)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.critical(e)
|
logger.warning(e)
|
||||||
return
|
return
|
||||||
|
|
||||||
# TODO: test these two operations
|
# TODO: test these two operations
|
||||||
|
|||||||
+6
-3
@@ -161,15 +161,18 @@ class Notebook(ScrollableMixin, Gtk.Notebook): # type: ignore
|
|||||||
self.connect_after("switch-page", self._on_page_changed)
|
self.connect_after("switch-page", self._on_page_changed)
|
||||||
self.connect("key-press-event", self._on_keypress)
|
self.connect("key-press-event", self._on_keypress)
|
||||||
|
|
||||||
def _on_keypress(self, widget: Gtk.Widget, event: Gdk.EventKey) -> None:
|
def _on_keypress(self, widget: Gtk.Widget, event: Gdk.EventKey) -> bool:
|
||||||
match event.keyval:
|
match event.keyval:
|
||||||
case Gdk.KEY_Right | Gdk.KEY_l:
|
case Gdk.KEY_Right | Gdk.KEY_l:
|
||||||
# FIXME: propagation bool
|
|
||||||
if event.state is Gdk.ModifierType.CONTROL_MASK:
|
if event.state is Gdk.ModifierType.CONTROL_MASK:
|
||||||
return
|
return False
|
||||||
MainController.get_emitter().emit("request_button_box_focus")
|
MainController.get_emitter().emit("request_button_box_focus")
|
||||||
|
return True
|
||||||
case Gdk.KEY_question:
|
case Gdk.KEY_question:
|
||||||
self.toggle_keybindings()
|
self.toggle_keybindings()
|
||||||
|
return True
|
||||||
|
case _:
|
||||||
|
return False
|
||||||
|
|
||||||
def return_prior(self) -> None:
|
def return_prior(self) -> None:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ class ButtonBox(Gtk.Box):
|
|||||||
context=side_button,
|
context=side_button,
|
||||||
)
|
)
|
||||||
|
|
||||||
# FIXME: if debug log fails to load, still opens table
|
|
||||||
size = (10, 10) if prefs.is_steam_deck else (50, 50)
|
size = (10, 10) if prefs.is_steam_deck else (50, 50)
|
||||||
x, y = size
|
x, y = size
|
||||||
button.set_size_request(x, y)
|
button.set_size_request(x, y)
|
||||||
|
|||||||
@@ -126,7 +126,6 @@ class WaitDialog(GenericDialog):
|
|||||||
|
|
||||||
class QuitDialog(GenericDialog):
|
class QuitDialog(GenericDialog):
|
||||||
def __init__(self, controller: "Controller", secondary: str):
|
def __init__(self, controller: "Controller", secondary: str):
|
||||||
# FIXME: do not pass controller to every dialog
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
controller=controller,
|
controller=controller,
|
||||||
text=strings.wait,
|
text=strings.wait,
|
||||||
@@ -173,6 +172,7 @@ class ExceptionDialog(GenericDialog):
|
|||||||
propagate_natural_height=True, max_content_height=500
|
propagate_natural_height=True, max_content_height=500
|
||||||
)
|
)
|
||||||
box = Gtk.Box(hexpand=True, vexpand=True, orientation=Gtk.Orientation.VERTICAL)
|
box = Gtk.Box(hexpand=True, vexpand=True, orientation=Gtk.Orientation.VERTICAL)
|
||||||
|
# TODO: wrap/truncate long messages
|
||||||
textview = Gtk.TextView(
|
textview = Gtk.TextView(
|
||||||
wrap_mode=Gtk.WrapMode.WORD, editable=False, left_margin=10, right_margin=10
|
wrap_mode=Gtk.WrapMode.WORD, editable=False, left_margin=10, right_margin=10
|
||||||
)
|
)
|
||||||
@@ -182,7 +182,7 @@ class ExceptionDialog(GenericDialog):
|
|||||||
|
|
||||||
content = self.get_content_area()
|
content = self.get_content_area()
|
||||||
content.set_spacing(0)
|
content.set_spacing(0)
|
||||||
# FIXME: padding around top of content area when traceback is long
|
# TODO: padding around top of content area when traceback is long
|
||||||
content.add(scrollable)
|
content.add(scrollable)
|
||||||
|
|
||||||
copy_button = ClipboardButton(controller, self.get_trace)
|
copy_button = ClipboardButton(controller, self.get_trace)
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class ServerModDialog(GenericDialog):
|
|||||||
dialogBox.pack_end(self.scrollable, EXPAND, FILL, 0)
|
dialogBox.pack_end(self.scrollable, EXPAND, FILL, 0)
|
||||||
|
|
||||||
mod_count = len(mods)
|
mod_count = len(mods)
|
||||||
self.set_markup(f"Modlist ({mod_count} mods")
|
self.set_markup(f"Modlist ({mod_count} mods)")
|
||||||
for mod in mods:
|
for mod in mods:
|
||||||
self.mod_store.append(mod)
|
self.mod_store.append(mod)
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
from typing import Self, TYPE_CHECKING
|
from typing import Self, TYPE_CHECKING
|
||||||
|
|
||||||
from dzgui.const.constants import EXPAND, FILL, NO_PADDING
|
from dzgui.const.constants import EXPAND, FILL
|
||||||
from dzgui.model.model_factory import ModelFactory
|
from dzgui.model.model_factory import ModelFactory
|
||||||
from dzgui.util import css
|
from dzgui.util import css
|
||||||
from dzgui.util import strings
|
from dzgui.util import strings
|
||||||
from dzgui.util.format import format_hyperlinks, format_server_mods
|
from dzgui.util.format import format_hyperlinks, format_server_mods
|
||||||
|
from dzgui.strings import server_mods
|
||||||
from dzgui.views.dialogs.generic import GenericDialog
|
from dzgui.views.dialogs.generic import GenericDialog
|
||||||
from dzgui.views.trees.tree_base import TreeView
|
from dzgui.views.trees.tree_base import TreeView
|
||||||
|
|
||||||
@@ -121,7 +122,7 @@ class ServerModDialog(ServerDialog):
|
|||||||
def __init__(self, controller: "Controller", mods: list[list[str]]):
|
def __init__(self, controller: "Controller", mods: list[list[str]]):
|
||||||
|
|
||||||
name = controller.get_server_name()
|
name = controller.get_server_name()
|
||||||
super().__init__(controller, strings.modlist, name)
|
super().__init__(controller, server_mods.modlist, name)
|
||||||
|
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
self.mod_store = ModelFactory().make_server_mod_store()
|
self.mod_store = ModelFactory().make_server_mod_store()
|
||||||
@@ -130,17 +131,22 @@ class ServerModDialog(ServerDialog):
|
|||||||
self.view.set_model(self.mod_store)
|
self.view.set_model(self.mod_store)
|
||||||
self.view.connect("row-activated", self._on_row_activated)
|
self.view.connect("row-activated", self._on_row_activated)
|
||||||
|
|
||||||
for i, column_title in enumerate(strings.server_mod_cols):
|
# TODO: inherit from ServerModTreeView
|
||||||
|
columns = [
|
||||||
|
server_mods.mod,
|
||||||
|
server_mods.mod_id,
|
||||||
|
server_mods.installed,
|
||||||
|
]
|
||||||
|
for i, column_title in enumerate(columns):
|
||||||
renderer = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END)
|
renderer = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END)
|
||||||
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
||||||
column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
|
column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
|
||||||
self.view.append_column(column)
|
self.view.append_column(column)
|
||||||
column.set_sort_column_id(i)
|
column.set_sort_column_id(i)
|
||||||
# FIXME: do not recycle generic string vars
|
|
||||||
match column_title:
|
match column_title:
|
||||||
case strings.mod:
|
case server_mods.mod:
|
||||||
column.set_fixed_width(350)
|
column.set_fixed_width(350)
|
||||||
case strings._id:
|
case server_mods.mod_id:
|
||||||
column.set_fixed_width(200)
|
column.set_fixed_width(200)
|
||||||
case _:
|
case _:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ class ContextMixin(TreeView):
|
|||||||
(path, col, cellx, celly) = pathinfo
|
(path, col, cellx, celly) = pathinfo
|
||||||
if path is None:
|
if path is None:
|
||||||
return True
|
return True
|
||||||
# return True
|
|
||||||
selection = self.get_selection()
|
selection = self.get_selection()
|
||||||
model, selected_paths = selection.get_selected_rows()
|
model, selected_paths = selection.get_selected_rows()
|
||||||
if path not in selected_paths:
|
if path not in selected_paths:
|
||||||
@@ -90,7 +89,6 @@ class ContextMixin(TreeView):
|
|||||||
selection.unselect_path(p)
|
selection.unselect_path(p)
|
||||||
self.set_cursor(path, col, False)
|
self.set_cursor(path, col, False)
|
||||||
return True
|
return True
|
||||||
# FIXME: if selection is not multiple, change cursor
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ from dzgui.const.constants import (
|
|||||||
)
|
)
|
||||||
from dzgui.const.endpoints import STEAM_API_SETUP, BM_API_SETUP
|
from dzgui.const.endpoints import STEAM_API_SETUP, BM_API_SETUP
|
||||||
from dzgui.const.enum import Preferences, ServerTab
|
from dzgui.const.enum import Preferences, ServerTab
|
||||||
|
from dzgui.strings import errors
|
||||||
from dzgui.util import strings, css, open_links
|
from dzgui.util import strings, css, open_links
|
||||||
from dzgui.views.components.labels import LeftLabel
|
from dzgui.views.components.labels import LeftLabel
|
||||||
from dzgui.views.components.eventbox import InfoEventBox
|
from dzgui.views.components.eventbox import InfoEventBox
|
||||||
@@ -300,8 +301,7 @@ class Options(Gtk.Box):
|
|||||||
|
|
||||||
def _on_api_change_failed(self, emitter: "Emitter") -> None:
|
def _on_api_change_failed(self, emitter: "Emitter") -> None:
|
||||||
self.old_entry.set_text(self.old_text)
|
self.old_entry.set_text(self.old_text)
|
||||||
# FIXME: ambiguous error message
|
dialog = ExceptionDialog(self.controller, errors.api_validation_error)
|
||||||
dialog = ExceptionDialog(self.controller, strings.api_error)
|
|
||||||
dialog.run()
|
dialog.run()
|
||||||
|
|
||||||
def restore_api_text(self, text: str, entry: Gtk.Entry) -> None:
|
def restore_api_text(self, text: str, entry: Gtk.Entry) -> None:
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ from dzgui.views.trees.tree_server_mods import ServerModTreeView
|
|||||||
import gi
|
import gi
|
||||||
|
|
||||||
gi.require_version("Gtk", "3.0")
|
gi.require_version("Gtk", "3.0")
|
||||||
from gi.repository import Gtk # type: ignore # noqa E402
|
from gi.repository import Gdk, Gtk # type: ignore # noqa E402
|
||||||
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ class MenuTreeView(TreeView):
|
|||||||
def _parent_row_activated(
|
def _parent_row_activated(
|
||||||
self, tree: TreeView, path: Gtk.TreePath, column: Gtk.TreeViewColumn
|
self, tree: TreeView, path: Gtk.TreePath, column: Gtk.TreeViewColumn
|
||||||
) -> None:
|
) -> None:
|
||||||
# FIXME: may be expected to return str, not enum
|
|
||||||
row_type = self.get_value_at_index(1)
|
row_type = self.get_value_at_index(1)
|
||||||
|
|
||||||
match row_type:
|
match row_type:
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
from dzgui.const.enum import ContextMenuGroup
|
from dzgui.const.enum import ContextMenuGroup
|
||||||
from dzgui.model.model_factory import ModelFactory
|
from dzgui.model.model_factory import ModelFactory
|
||||||
|
from dzgui.strings import server_mods
|
||||||
from dzgui.views.mixins.context_mixin import ContextMixin
|
from dzgui.views.mixins.context_mixin import ContextMixin
|
||||||
from dzgui.views.trees.tree_base import TreeView
|
from dzgui.views.trees.tree_base import TreeView
|
||||||
from dzgui.util import strings
|
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
@@ -29,17 +29,21 @@ class ServerModTreeView(ContextMixin, TreeView): # type: ignore
|
|||||||
self.connect("key-press-event", self.present_menu)
|
self.connect("key-press-event", self.present_menu)
|
||||||
self.connect("row-activated", self._on_row_activated)
|
self.connect("row-activated", self._on_row_activated)
|
||||||
|
|
||||||
for i, column_title in enumerate(strings.server_mod_cols):
|
columns = [
|
||||||
|
server_mods.mod,
|
||||||
|
server_mods.mod_id,
|
||||||
|
server_mods.installed,
|
||||||
|
]
|
||||||
|
for i, column_title in enumerate(columns):
|
||||||
renderer = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END)
|
renderer = Gtk.CellRendererText(ellipsize=Pango.EllipsizeMode.END)
|
||||||
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
||||||
column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
|
column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
|
||||||
self.append_column(column)
|
self.append_column(column)
|
||||||
column.set_sort_column_id(i)
|
column.set_sort_column_id(i)
|
||||||
# FIXME: do not recycle generic string vars
|
|
||||||
match column_title:
|
match column_title:
|
||||||
case strings.mod:
|
case server_mods.mod:
|
||||||
column.set_fixed_width(350)
|
column.set_fixed_width(350)
|
||||||
case strings._id:
|
case server_mods.mod_id:
|
||||||
column.set_fixed_width(200)
|
column.set_fixed_width(200)
|
||||||
case _:
|
case _:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in new issue
Block a user