move list hook
This commit is contained in:
parent
dfe5c250b3
commit
efc7df3aa7
@ -88,9 +88,9 @@ class ClanList(Gtk.Box):
|
||||
remount_list: Callable[[], None],
|
||||
remount_edit: Callable[[], None],
|
||||
set_selected: Callable[[VMBase | None], None],
|
||||
show_join: Callable[[], None],
|
||||
selected_vm: VMBase | None,
|
||||
show_toolbar: bool = True,
|
||||
show_join: Callable[[], None],
|
||||
) -> None:
|
||||
super().__init__(orientation=Gtk.Orientation.VERTICAL, expand=True)
|
||||
|
||||
|
@ -13,9 +13,9 @@ from gi.repository import GdkPixbuf, Gio, Gtk
|
||||
|
||||
|
||||
class Trust(Gtk.Box):
|
||||
def __init__(self, url: str, next: Callable[[], None]) -> None:
|
||||
def __init__(self, url: str, show_next: Callable[[], None]) -> None:
|
||||
super().__init__()
|
||||
self.next = next
|
||||
self.show_next = show_next
|
||||
|
||||
icon = Gtk.Image.new_from_pixbuf(
|
||||
GdkPixbuf.Pixbuf.new_from_file_at_scale(
|
||||
@ -52,13 +52,13 @@ class Trust(Gtk.Box):
|
||||
def on_trust(self, widget: Gtk.Widget) -> None:
|
||||
print("trusted")
|
||||
print(self.entry.get_text())
|
||||
self.next()
|
||||
self.show_next()
|
||||
|
||||
|
||||
class Details(Gtk.Box):
|
||||
def __init__(self, url: str, next: Callable[[], None]) -> None:
|
||||
def __init__(self, url: str, show_next: Callable[[], None]) -> None:
|
||||
super().__init__()
|
||||
self.next = next
|
||||
self.show_next = show_next
|
||||
|
||||
icon = Gtk.Image.new_from_pixbuf(
|
||||
GdkPixbuf.Pixbuf.new_from_file_at_scale(
|
||||
@ -99,7 +99,7 @@ class Details(Gtk.Box):
|
||||
|
||||
def on_join(self, widget: Gtk.Widget) -> None:
|
||||
print("join")
|
||||
self.next()
|
||||
self.show_next()
|
||||
|
||||
|
||||
class JoinWindow(Gtk.ApplicationWindow):
|
||||
@ -125,12 +125,14 @@ class JoinWindow(Gtk.ApplicationWindow):
|
||||
self.stack = Gtk.Stack()
|
||||
|
||||
self.stack.add_titled(
|
||||
Details(str(initial_values.url), next=self.show_details),
|
||||
Details(str(initial_values.url), show_next=self.show_details),
|
||||
"details",
|
||||
"Details",
|
||||
)
|
||||
self.stack.add_titled(
|
||||
Trust(str(initial_values.url), next=self.show_details), "trust", "Trust"
|
||||
Trust(str(initial_values.url), show_next=self.show_details),
|
||||
"trust",
|
||||
"Trust",
|
||||
)
|
||||
|
||||
vbox.add(self.stack)
|
||||
|
@ -34,10 +34,9 @@ class OverviewWindow(Gtk.ApplicationWindow):
|
||||
"remount_list": self.remount_list_view,
|
||||
"remount_edit": self.remount_edit_view,
|
||||
"set_selected": self.set_selected,
|
||||
"show_join": cbs.show_join,
|
||||
}
|
||||
clan_list = ClanList(
|
||||
**self.list_hooks, selected_vm=None, show_join=cbs.show_join
|
||||
) # type: ignore
|
||||
clan_list = ClanList(**self.list_hooks, selected_vm=None) # type: ignore
|
||||
# Add named stacks
|
||||
self.stack.add_titled(clan_list, "list", "List")
|
||||
self.stack.add_titled(
|
||||
|
Loading…
Reference in New Issue
Block a user