From e44a107c6d3465a5f3afc9a5c243be86b341c099 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 1 Apr 2016 10:21:50 +0200 Subject: fix displaying partitions (mga#18076) when there's only one disk, just add a dummy disk tab, then remove it. this fixes the reported crash --- perl-install/diskdrake/hd_gtk.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'perl-install/diskdrake') diff --git a/perl-install/diskdrake/hd_gtk.pm b/perl-install/diskdrake/hd_gtk.pm index c08a0928d..a8f4894f3 100644 --- a/perl-install/diskdrake/hd_gtk.pm +++ b/perl-install/diskdrake/hd_gtk.pm @@ -113,6 +113,8 @@ sub main { # ensure partitions bar is properly sized on first display: $notebook_widget->signal_connect(realize => $update_all); $w->sync; + # add a bogus tab so that gtk+ displayed everything when there's only one disk: + $notebook_widget->prepend_page(Gtk3::Label->new, Gtk3::Label->new); $notebook_widget->set_current_page(0); # there's always at least one child (at least a button for create a new part on empty discs): my @children = $current_kind->{display_box} ? $current_kind->{display_box}->get_children : (); @@ -123,6 +125,10 @@ sub main { $update_all->(2); } undef $initializing; + # remove bogus tab we added just to be sure gtk+ displayed everything: + $notebook_widget->remove_page(0); + # restore position when there's several disks: + $notebook_widget->set_current_page(0); $done_button->grab_focus; if (!$::testing) { $in->ask_from_list_(N("Read carefully"), N("Please make a backup of your data first"), -- cgit v1.2.1