aboutsummaryrefslogtreecommitdiffstats
path: root/MandrivaUpdate
diff options
context:
space:
mode:
Diffstat (limited to 'MandrivaUpdate')
-rwxr-xr-xMandrivaUpdate19
1 files changed, 19 insertions, 0 deletions
diff --git a/MandrivaUpdate b/MandrivaUpdate
index bb96e62d..2657cb73 100755
--- a/MandrivaUpdate
+++ b/MandrivaUpdate
@@ -52,6 +52,8 @@ warn_about_user_mode();
open_db();
+my (%data, $initialized);
+
sub refresh_packages_list {
my ($list, $info, $button) = @_;
# select packages to update:
@@ -67,6 +69,23 @@ or you already installed all of them."))) if !@{$list->{data}};
$button->set_sensitive(scalar(@{$list->{data}}));
}
+sub toggle {
+ my ($list, @names) = @_;
+ my $name = $names[0];
+ my $val = $pkgs->{$name}{selected};
+ my $old_status = $val ? 'to_install' : 'to_update';
+ my $done;
+ $pkgs->{$name}{pkg}->set_flag_skip(0);
+ toggle_nodes($w->{real_window}->window, $list->get_model, sub {
+ my ($leaf, $state, $model) = @_;
+ $done = 1;
+ $list->{data}[$data{$leaf}][0] = $pkgs->{$name}{selected};
+ },
+ $old_status, @names);
+ # handle canceling:
+ $list->{data}[$data{$name}][0] = !$list->{data}[$data{$name}][0] if !$done;
+}
+
sub get_name {
my ($name) = @_;
($name) = $name =~ m!<b>(.*)</b>!;