Skip to content

Commit

Permalink
More work on search install
Browse files Browse the repository at this point in the history
  • Loading branch information
heliguy4599 committed Nov 8, 2023
1 parent 94161ff commit 740338d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
4 changes: 0 additions & 4 deletions src/search_install.blp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ template SearchInstallWindow : Adw.Window {
[start]
MenuButton remotes_dropdown {
label: _("All Remotes");
menu-model: remotes_menu;
}
}
}
Expand Down Expand Up @@ -78,7 +77,4 @@ template SearchInstallWindow : Adw.Window {
}
};
}
}

menu remotes_menu {
}
32 changes: 15 additions & 17 deletions src/search_install_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class SearchInstallWindow (Adw.Window):
# search_bar = Gtk.Template.Child()
search_entry = Gtk.Template.Child()
remotes_dropdown = Gtk.Template.Child()
remotes_menu = Gtk.Template.Child()

def searchResponse(self, a, b):
self.results_list_box.remove_all()
Expand Down Expand Up @@ -48,7 +47,6 @@ def searchThread(self):
if self.remote_to_search:
command += self.remote_to_search


output = subprocess.run(command, capture_output=True, text=True, env=self.new_env).stdout
lines = output.strip().split("\n")
columns = lines[0].split("\t")
Expand All @@ -72,21 +70,21 @@ def set_choice(self, index):
print(index)

def remotesChooserCreator(self):


# self.remote_to_search = [self.host_remotes[index][0], f"--{self.host_remotes[index][7]}"]
# self.create_action("all", lambda *_: set_choice(0))
# self.remotes_menu.append_item(Gio.Menu)

# self.create_action(("downgrade" + str(index)), lambda *_, row=self.flatpak_rows[index]: DowngradeWindow(self, row))
# downgrade_item = Gio.MenuItem.new(_("Downgrade"), f"win.downgrade{index}")
# advanced_menu_model.append_item(downgrade_item)

# self.remotes_dropdown
for i in range(len(self.host_remotes)):
self.create_action(("remote" + str(i)), lambda *_: print("g"))
test = Gio.MenuItem.new(self.host_remotes[i][1], f"win.remote{i}")
self.remotes_menu.append_item(test)
remotes_pop = Gtk.Popover()
remotes_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
remotes_pop.set_size_request(400, 1)
scroll = Gtk.ScrolledWindow()
remotes_pop.set_child(scroll)
scroll.set_child(remotes_box)
for i in range(1, 3):
x = 0
height = remotes_pop.get_size(x)
all = Gtk.Button(label="all")
all.add_css_class("flat")
remotes_box.append(all)
print(x)

self.remotes_dropdown.set_popover(remotes_pop)

def key_handler(self, _a, event, _c, _d):
if event == Gdk.KEY_Escape:
Expand Down

0 comments on commit 740338d

Please sign in to comment.