mirror of
https://github.com/aclist/dztui.git
synced 2026-10-31 15:12:48 +01:00
feat: launch offline (WIP))
This commit is contained in:
1 parent
0070fe4061
commit
831bd9145d
9 files changed
+82
-6
No files matched your search
@@ -11,21 +11,38 @@ if TYPE_CHECKING:
|
||||
from dzgui.controllers.mc import Controller
|
||||
|
||||
|
||||
|
||||
class Mods(NoOverlayScrolledWindow):
|
||||
def __init__(self, controller: "Controller") -> None:
|
||||
super().__init__()
|
||||
|
||||
self.box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
|
||||
self.controller = controller
|
||||
self.emitter = controller.get_emitter()
|
||||
self.tree = ModTreeView(controller)
|
||||
self.tree.set_vexpand(True)
|
||||
|
||||
self.add(self.tree)
|
||||
self.offline_button = Gtk.Button(
|
||||
label="Play offline",
|
||||
halign=Gtk.Align.START,
|
||||
margin_top=10,
|
||||
margin_bottom=10,
|
||||
)
|
||||
self.offline_button.connect("clicked", self._on_offline_clicked)
|
||||
|
||||
self.box.add(self.offline_button)
|
||||
self.box.add(self.tree)
|
||||
|
||||
self.add(self.box)
|
||||
self.controller.register_widget("modtreeview", self.tree)
|
||||
|
||||
self.connect("map", self._on_map)
|
||||
self.connect("unmap", self._on_unmap)
|
||||
|
||||
def _on_offline_clicked(self, button: Gtk.Button) -> None:
|
||||
self.controller.open_offline(self.tree.get_model())
|
||||
# TODO: add offline page
|
||||
|
||||
def _on_unmap(self, widget: Self) -> None:
|
||||
self.emitter.emit("mod_page_toggled", False)
|
||||
|
||||
|
||||
Reference in new issue
Block a user