]> git.proxmox.com Git - pve-installer.git/commitdiff
Fix #2009: Recreate hdsize_adj with new hdsize
authorStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 7 Dec 2018 11:35:31 +0000 (12:35 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 10 Dec 2018 09:17:51 +0000 (10:17 +0100)
Creating $hdsize_size_adjustment once with a passed hdsize, breaks changing
the disk to a smaller/larger one, since the installer is stuck with the limits
set with the initial disk.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
proxinstall

index 9945dd1fe543cefa1f97e1ca5570d4175a6e9784..159c7277f1f49322c7446abf7bd70cf76b361789 100755 (executable)
@@ -2501,11 +2501,13 @@ my $hdsize_entry_buffer;
 my $get_hdsize_spinbtn = sub {
     my $hdsize = shift;
 
-    if (!defined($hdsize_size_adj)) {
-       die "called get_hdsize_spinbtn with \$hdsize_size_adj not defined but did not pass hdsize!\n"
-           if !defined($hdsize);
+    $hdsize_entry_buffer //= Gtk3::EntryBuffer->new(undef, 1);
+
+    if (defined($hdsize)) {
        $hdsize_size_adj = Gtk3::Adjustment->new($config_options->{hdsize} || $hdsize, 0, $hdsize+1, 1, 1, 1);
-       $hdsize_entry_buffer = Gtk3::EntryBuffer->new(undef, 1);
+    } else {
+       die "called get_hdsize_spinbtn with \$hdsize_size_adj not defined but did not pass hdsize!\n"
+           if !defined($hdsize_size_adj);
     }
 
     my $spinbutton_hdsize = Gtk3::SpinButton->new($hdsize_size_adj, 1, 1);