mirror of
https://github.com/aclist/dztui.git
synced 2026-11-12 13:00:37 +01:00
fix: update active maps combo on tab change
This commit is contained in:
1 parent
4d0bb2f4f8
commit
c3e2f6e4b4
13 files changed
+200
-231
No files matched your search
@@ -1,14 +1,13 @@
|
||||
import textwrap
|
||||
from typing import Self, TYPE_CHECKING
|
||||
|
||||
from dzgui.const.enum import Popup, Preferences
|
||||
from dzgui.const.constants import NO_EXPAND, NO_FILL
|
||||
from dzgui.util.open_links import open_user_workshop
|
||||
from dzgui.util.strings import notice
|
||||
from dzgui.views.dialogs.generic import GenericDialog
|
||||
from dzgui.views.components.buttons import SteamTextButton, WebButton
|
||||
from dzgui.views.components.buttons import SteamTextButton
|
||||
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, GLib, Gdk, GObject, Pango # noqa E402
|
||||
|
||||
@@ -18,9 +17,17 @@ if TYPE_CHECKING:
|
||||
|
||||
|
||||
class WorkshopLinkDialog(GenericDialog):
|
||||
def __init__(self, controller: "Controller", text: str, button_label: str, uid: str):
|
||||
def __init__(
|
||||
self, controller: "Controller", text: str, button_label: str, uid: str
|
||||
):
|
||||
text = textwrap.dedent(text).replace("\n", " ")
|
||||
super().__init__(controller, text=notice, mtype=Gtk.MessageType.INFO, buttons=Gtk.ButtonsType.OK, secondary=text)
|
||||
super().__init__(
|
||||
controller,
|
||||
text=notice,
|
||||
mtype=Gtk.MessageType.INFO,
|
||||
buttons=Gtk.ButtonsType.OK,
|
||||
secondary=text,
|
||||
)
|
||||
self.controller = controller
|
||||
self.dialogBox = self.get_content_area()
|
||||
self.set_default_response(Gtk.ResponseType.OK)
|
||||
@@ -43,12 +50,10 @@ class WorkshopLinkDialog(GenericDialog):
|
||||
def _on_button_clicked(self, button: Gtk.Button, uid: str) -> None:
|
||||
# TODO: currently checks user id on instantiation
|
||||
self.controller.open_user_workshop(uid)
|
||||
#client = self.controller.query_config(Preferences.CLIENT)
|
||||
#open_user_workshop(uid, client)
|
||||
# client = self.controller.query_config(Preferences.CLIENT)
|
||||
# open_user_workshop(uid, client)
|
||||
|
||||
def _on_dialog_response(
|
||||
self, dialog: Self, resp: Gtk.ResponseType
|
||||
) -> None:
|
||||
def _on_dialog_response(self, dialog: Self, resp: Gtk.ResponseType) -> None:
|
||||
match resp:
|
||||
case Gtk.ResponseType.DELETE_EVENT:
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user