From ef917dd0683bc51e6d8d9628f8476aa54d1e2b01 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 15 Jul 2005 05:23:04 +0000 Subject: don't show choices menus if only one choice is possible --- perl-install/standalone/net_applet | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perl-install/standalone/net_applet b/perl-install/standalone/net_applet index 43dfad3fb..601201ecf 100644 --- a/perl-install/standalone/net_applet +++ b/perl-install/standalone/net_applet @@ -216,7 +216,8 @@ sub generate_menu { my ($action) = @_; my $name = ref($actions{$action}{name}) eq 'CODE' ? $actions{$action}{name}->($interface) : $actions{$action}{name}; my $launch = $actions{$action}{launch}; - if ($actions{$action}{choices}) { + my @choices = exists $actions{$action}{choices} && $actions{$action}{choices}->(); + if (@choices > 1) { my $selected = $actions{$action}{choice_selected}; gtkshow(create_menu($name, map { my $choice = $_; -- cgit v1.2.1