diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-10-28 17:36:05 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-10-28 17:36:05 +0000 |
commit | a4212397b9f6f8931a4567848baa2eb4273b357f (patch) | |
tree | 6839fb1cc1b3d7afa3b3069824692957d41a8368 /perl-install | |
parent | e6c756c60b445cc836c91b44ef4858eb1e1ecc50 (diff) | |
download | drakx-a4212397b9f6f8931a4567848baa2eb4273b357f.tar drakx-a4212397b9f6f8931a4567848baa2eb4273b357f.tar.gz drakx-a4212397b9f6f8931a4567848baa2eb4273b357f.tar.bz2 drakx-a4212397b9f6f8931a4567848baa2eb4273b357f.tar.xz drakx-a4212397b9f6f8931a4567848baa2eb4273b357f.zip |
factorize resized partition info creation
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/fs/partitioning_wizard.pm | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/perl-install/fs/partitioning_wizard.pm b/perl-install/fs/partitioning_wizard.pm index 7b7550e62..68d7a7d9e 100644 --- a/perl-install/fs/partitioning_wizard.pm +++ b/perl-install/fs/partitioning_wizard.pm @@ -333,24 +333,24 @@ sub create_display_box { ugtk2::gtkset_size_request($hpane, $entry->{width}, 0); ugtk2::gtkpack__($display_box, $hpane); + my $add_part_info = sub { + my ($name, $label) = @_; + my $color_widget = Gtk2::EventBox->new; + $color_widget->add(Gtk2::Label->new(" " x 4)); + $color_widget->set_name($name); + ugtk2::gtkpack__($desc, $color_widget); + ugtk2::gtkpack__($desc, $label); + $label->set_alignment(0,0.5); + ugtk2::gtkset_size_request($label, 150, 20); + }; $desc = Gtk2::HBox->new(0,0); - $ev2 = Gtk2::EventBox->new; - $ev2->add(Gtk2::Label->new(" " x 4)); - $ev2->set_name("PART_vfat"); - ugtk2::gtkpack__($desc, $ev2); + my $win_size_label = Gtk2::Label->new; - - ugtk2::gtkset_size_request($win_size_label, 150, 20); - ugtk2::gtkpack__($desc, $win_size_label); - $win_size_label->set_alignment(0,0.5); - $ev2 = Gtk2::EventBox->new; - $ev2->add(Gtk2::Label->new(" " x 4)); - $ev2->set_name("PART_new"); - ugtk2::gtkpack__($desc, $ev2); + $add_part_info->("PART_vfat", $win_size_label); + my $mdv_size_label = Gtk2::Label->new; - ugtk2::gtkset_size_request($mdv_size_label, 150, 20); - ugtk2::gtkpack__($desc, $mdv_size_label); - $mdv_size_label->set_alignment(0,0.5); + $add_part_info->("PART_new", $mdv_size_label); + my $update_size_labels = sub { $win_size_label->set_label(" Windows (" . formatXiB($entry->{req_size}, 512) . ")"); $mdv_size_label->set_label(" Mandriva (" . formatXiB($entry->{size} - $entry->{req_size}, 512) . ")"); |