Discussion:
[pve-devel] [PATCH installer 0/2] fix spinbutton_hdsize initial value display
Stoiko Ivanov
2018-11-28 11:40:55 UTC
Permalink
Setting the (shared) input buffer for $spinbutton_hdsize after initializing
the widget with its adjustment, resulted in the spinbutton being empty,
instead of showing the hdsize (sorry for not noticing the difference to the
behaviour before!).

This lead to odd errors: if you click in the hdsize widget (without changing
anything) - it set the hdsize to 0, and aborting the installation when trying
to partition the disk(s).

Additionally I noticed a small typo.

Stoiko Ivanov (2):
Fix typo in get_hdsize_spinbtn errormessage
Reset adjustment for spinbutton_hdsize

proxinstall | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.11.0
Stoiko Ivanov
2018-11-28 11:40:57 UTC
Permalink
After setting the input buffer for the spinbutton the default value
wasn't displayed anymore, resulting in odd behaviour when clicking in the field
w/o entering/changing a value.

Setting the adjustment again, sets the default value as before

Signed-off-by: Stoiko Ivanov <***@proxmox.com>
---
proxinstall | 1 +
1 file changed, 1 insertion(+)

diff --git a/proxinstall b/proxinstall
index 97c5394..eee8208 100755
--- a/proxinstall
+++ b/proxinstall
@@ -2509,6 +2509,7 @@ my $get_hdsize_spinbtn = sub {

my $spinbutton_hdsize = Gtk3::SpinButton->new($hdsize_size_adj, 1, 1);
$spinbutton_hdsize->set_buffer($hdsize_entry_buffer);
+ $spinbutton_hdsize->set_adjustment($hdsize_size_adj);
$spinbutton_hdsize->set_tooltip_text("only use specified size (GB) of the harddisk (rest left unpartitioned)");
return $spinbutton_hdsize;
};
--
2.11.0
Stoiko Ivanov
2018-11-28 11:40:56 UTC
Permalink
Signed-off-by: Stoiko Ivanov <***@proxmox.com>
---
proxinstall | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/proxinstall b/proxinstall
index 2f665dc..97c5394 100755
--- a/proxinstall
+++ b/proxinstall
@@ -2500,9 +2500,8 @@ 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 hsize!\n"
+ die "called get_hdsize_spinbtn with \$hdsize_size_adj not defined but did not pass hdsize!\n"
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);
--
2.11.0
Thomas Lamprecht
2018-11-28 12:14:49 UTC
Permalink
Post by Stoiko Ivanov
Setting the (shared) input buffer for $spinbutton_hdsize after initializing
the widget with its adjustment, resulted in the spinbutton being empty,
instead of showing the hdsize (sorry for not noticing the difference to the
behaviour before!).
I really should have catched that reviewing it... Applied, but re-added an empty
line you deleted in 1/2 ;-) thanks!
Post by Stoiko Ivanov
This lead to odd errors: if you click in the hdsize widget (without changing
anything) - it set the hdsize to 0, and aborting the installation when trying
to partition the disk(s).
Additionally I noticed a small typo.
Fix typo in get_hdsize_spinbtn errormessage
Reset adjustment for spinbutton_hdsize
proxinstall | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Loading...