Skip to content

Commit

Permalink
fix opt deps selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Benoit committed Dec 16, 2023
1 parent 875fd63 commit 2996d46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/choose_pkgs_dialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ namespace Pamac {
unowned Gtk.ListBoxRow row = widget as Gtk.ListBoxRow;
unowned Gtk.Widget child = row.get_child ();
unowned Gtk.CheckButton radiobutton = child as Gtk.CheckButton;
child = radiobutton.get_child ();
unowned Gtk.Label label = child as Gtk.Label;
if (radiobutton.active) {
selected.add (radiobutton.label);
selected.add (label.label);
}
widget = widget.get_next_sibling ();
}
Expand Down
9 changes: 4 additions & 5 deletions src/choose_provider_dialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,14 @@ namespace Pamac {
public async int choose_provider () {
int index = 0;
yield this.choose (null);
unowned Gtk.Widget child = box.get_first_child ();
var radiobutton = child as Gtk.CheckButton;
while (radiobutton != null) {
unowned Gtk.Widget? widget = box.get_first_child ();
while (widget != null) {
unowned Gtk.CheckButton radiobutton = widget as Gtk.CheckButton;
if (radiobutton.active) {
break;
}
index++;
child = radiobutton.get_next_sibling ();
radiobutton = child as Gtk.CheckButton;
widget = radiobutton.get_next_sibling ();
}
return index;
}
Expand Down

0 comments on commit 2996d46

Please sign in to comment.