mirror of
https://github.com/aclist/dztui.git
synced 2026-11-08 11:00:48 +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
@@ -126,7 +126,6 @@ class WaitDialog(GenericDialog):
|
||||
|
||||
class QuitDialog(GenericDialog):
|
||||
def __init__(self, controller: "Controller", secondary: str):
|
||||
# FIXME: do not pass controller to every dialog
|
||||
super().__init__(
|
||||
controller=controller,
|
||||
text=strings.wait,
|
||||
@@ -173,6 +172,7 @@ class ExceptionDialog(GenericDialog):
|
||||
propagate_natural_height=True, max_content_height=500
|
||||
)
|
||||
box = Gtk.Box(hexpand=True, vexpand=True, orientation=Gtk.Orientation.VERTICAL)
|
||||
# TODO: wrap/truncate long messages
|
||||
textview = Gtk.TextView(
|
||||
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.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)
|
||||
|
||||
copy_button = ClipboardButton(controller, self.get_trace)
|
||||
|
||||
@@ -60,7 +60,7 @@ class ServerModDialog(GenericDialog):
|
||||
dialogBox.pack_end(self.scrollable, EXPAND, FILL, 0)
|
||||
|
||||
mod_count = len(mods)
|
||||
self.set_markup(f"Modlist ({mod_count} mods")
|
||||
self.set_markup(f"Modlist ({mod_count} mods)")
|
||||
for mod in mods:
|
||||
self.mod_store.append(mod)
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
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.util import css
|
||||
from dzgui.util import strings
|
||||
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.trees.tree_base import TreeView
|
||||
|
||||
@@ -121,7 +122,7 @@ class ServerModDialog(ServerDialog):
|
||||
def __init__(self, controller: "Controller", mods: list[list[str]]):
|
||||
|
||||
name = controller.get_server_name()
|
||||
super().__init__(controller, strings.modlist, name)
|
||||
super().__init__(controller, server_mods.modlist, name)
|
||||
|
||||
self.controller = controller
|
||||
self.mod_store = ModelFactory().make_server_mod_store()
|
||||
@@ -130,17 +131,22 @@ class ServerModDialog(ServerDialog):
|
||||
self.view.set_model(self.mod_store)
|
||||
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)
|
||||
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
||||
column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
|
||||
self.view.append_column(column)
|
||||
column.set_sort_column_id(i)
|
||||
# FIXME: do not recycle generic string vars
|
||||
match column_title:
|
||||
case strings.mod:
|
||||
case server_mods.mod:
|
||||
column.set_fixed_width(350)
|
||||
case strings._id:
|
||||
case server_mods.mod_id:
|
||||
column.set_fixed_width(200)
|
||||
case _:
|
||||
pass
|
||||
|
||||
Reference in new issue
Block a user