Skip to content

Commit

Permalink
fix: radio button unlock next button
Browse files Browse the repository at this point in the history
- pass callback for radio button and row to call
  • Loading branch information
jardon committed Oct 3, 2024
1 parent 1718547 commit 3622b75
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions vanilla_first_setup/defaults/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class KeyboardRow(Adw.ActionRow):
suffix_bin = Gtk.Template.Child()

def __init__(
self, title, subtitle, layout, variant, key, selected_keyboard, **kwargs
self, title, subtitle, layout, variant, key, selected_keyboard, toggled_callback, **kwargs
):
super().__init__(**kwargs)
self.__title = title
Expand All @@ -46,11 +46,7 @@ def __init__(
self.set_subtitle(subtitle)
self.suffix_bin.set_label(key)

self.select_button.connect("toggled", self.__on_check_button_toggled)

def __on_check_button_toggled(self, widget):
self.__selected_keyboard["layout"] = self.__layout
self.__selected_keyboard["variant"] = self.__variant
self.select_button.connect("toggled", toggled_callback, self)


@Gtk.Template(resource_path="/org/vanillaos/FirstSetup/gtk/default-keyboard.ui")
Expand Down Expand Up @@ -177,6 +173,7 @@ def __generate_keyboard_list_widgets(self, selected_keyboard):
keyboard_variant,
keyboard_key,
selected_keyboard,
self.__on_check_button_toggled,
)

if len(keyboard_widgets) > 0:
Expand Down Expand Up @@ -260,3 +257,8 @@ def __set_keyboard_layout(self, layout, variant=None):
@property
def step_id(self):
return self.__key

def __on_check_button_toggled(self, __radio_button, widget):
self.selected_keyboard["layout"] = widget._KeyboardRow__layout
self.selected_keyboard["variant"] = widget._KeyboardRow__variant
self.btn_next.set_sensitive(True)

0 comments on commit 3622b75

Please sign in to comment.