From 00443a806e5d2b626f2621053c536345dafc90eb Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 28 Oct 2009 16:19:34 +0000 Subject: factorize in update_req_size helper --- perl-install/fs/partitioning_wizard.pm | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'perl-install') diff --git a/perl-install/fs/partitioning_wizard.pm b/perl-install/fs/partitioning_wizard.pm index 3f1b44276..99d87e72a 100644 --- a/perl-install/fs/partitioning_wizard.pm +++ b/perl-install/fs/partitioning_wizard.pm @@ -361,20 +361,17 @@ sub create_display_box { $mdv_size_label->set_label(" Mandriva (" . formatXiB($part->{size} - $part->{req_size}, 512) . ")"); 0; }; - $hpane->signal_connect('size-allocate' => sub { - my (undef, $alloc) = @_; + my $update_req_size = sub { $part->{req_size} = int($hpane->get_position * $part->{size} / $part->{width}); $update_size_labels->(); + }; + $hpane->signal_connect('size-allocate' => sub { + my (undef, $alloc) = @_; + $update_req_size->(); }); $update_size_labels->(); - $hpane->signal_connect('motion-notify-event' => sub { - $part->{req_size} = int($hpane->get_position * $part->{size} / $part->{width}); - $update_size_labels->(); - }); - $hpane->signal_connect('move-handle' => sub { - $part->{req_size} = int($hpane->get_position * $part->{size} / $part->{width}); - $update_size_labels->(); - }); + $hpane->signal_connect('motion-notify-event' => $update_req_size); + $hpane->signal_connect('move-handle' => $update_req_size); $hpane->signal_connect('button-press-event' => sub { $button->activate; 0; -- cgit v1.2.1