aboutsummaryrefslogtreecommitdiffstats
path: root/MandrivaUpdate
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-03-23 06:05:14 +0000
committerThierry Vignaud <tv@mandriva.org>2007-03-23 06:05:14 +0000
commit2acc954ebc7cebfc8c1c20c169a5811d47b780a1 (patch)
tree62521d5e04aed35c6e6760c8204d6898ea8309c2 /MandrivaUpdate
parent6a96d5a8d89c7a0d09a4f6f4919f230d31c9f91e (diff)
downloadrpmdrake-2acc954ebc7cebfc8c1c20c169a5811d47b780a1.tar
rpmdrake-2acc954ebc7cebfc8c1c20c169a5811d47b780a1.tar.gz
rpmdrake-2acc954ebc7cebfc8c1c20c169a5811d47b780a1.tar.bz2
rpmdrake-2acc954ebc7cebfc8c1c20c169a5811d47b780a1.tar.xz
rpmdrake-2acc954ebc7cebfc8c1c20c169a5811d47b780a1.zip
(toggle) introduce this wrapper arount toggle_nodes() in oder to handle
deps while toggling
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>!;