Skip to content

Commit

Permalink
Sync work
Browse files Browse the repository at this point in the history
  • Loading branch information
heliguy4599 committed Sep 23, 2023
1 parent 45ae32c commit b8e9c1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
11 changes: 1 addition & 10 deletions src/filter.blp
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,8 @@ template FilterWindow : Adw.Window {
selection-mode: none;
styles["boxed-list"]

Adw.ActionRow runtimes_row {
Adw.SwitchRow runtimes_row {
title: _("Show Runtimes");

[suffix]
Box {
valign: center;
Switch runtimes_switch {
}
}

activatable-widget: runtimes_switch;
}
}
// ListBox install_type_list {
Expand Down
13 changes: 5 additions & 8 deletions src/filter_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,24 @@ class FilterWindow(Adw.Window):
cancel_button = Gtk.Template.Child()
apply_button = Gtk.Template.Child()
remotes_list = Gtk.Template.Child()
runtimes_switch = Gtk.Template.Child()
runtimes_row = Gtk.Template.Child()

def runtimesHandler(self, switch, state):
print(state)
def runtimesHandler(self, switch, _a):
print(switch.get_active())

def generateList(self):
for i in range(len(self.host_remotes)):
name = self.host_remotes[i][0]
title = self.host_remotes[i][1]
install_type = self.host_remotes[i][7]
url = self.host_remotes[i][2]
remote_row = Adw.ActionRow(title=title, subtitle=url)
remote_row = Adw.SwitchRow(title=title, subtitle=url)
if title == "-":
remote_row.set_title(name)
self.remotes_list.append(remote_row)
label = Gtk.Label(label=("{} wide").format(install_type))
label.add_css_class("subtitle")
remote_row.add_suffix(label)
row_select = Gtk.CheckButton()
remote_row.add_suffix(row_select)
remote_row.set_activatable_widget(row_select)

def __init__(self, main_window, **kwargs):
super().__init__(**kwargs)
Expand All @@ -48,7 +45,7 @@ def __init__(self, main_window, **kwargs):
self.apply_button.connect("clicked", lambda *_: main_window.updateFilter(self.filter_list))
self.apply_button.connect("clicked", lambda *_: self.close())
self.cancel_button.connect("clicked", lambda *_: self.close())
self.runtimes_switch.connect("state-set", self.runtimesHandler)
self.runtimes_row.connect("notify::active", self.runtimesHandler)

# Calls
self.generateList()
Expand Down

0 comments on commit b8e9c1f

Please sign in to comment.