summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-08-21 20:04:54 +0000
committerOlivier Blin <oblin@mandriva.com>2007-08-21 20:04:54 +0000
commit41bcc023ef7919a56315241d96e53d359cee5181 (patch)
tree1b8489de90fb2158afb4293c6cc2c4990ee5ea9c
parent3e930bd60a65fd75cdcc917751e0c22c2052dc9a (diff)
downloaddrakx-net-41bcc023ef7919a56315241d96e53d359cee5181.tar
drakx-net-41bcc023ef7919a56315241d96e53d359cee5181.tar.gz
drakx-net-41bcc023ef7919a56315241d96e53d359cee5181.tar.bz2
drakx-net-41bcc023ef7919a56315241d96e53d359cee5181.tar.xz
drakx-net-41bcc023ef7919a56315241d96e53d359cee5181.zip
do not show empty menus
-rw-r--r--bin/net_applet4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/net_applet b/bin/net_applet
index d4eb999..f879ac3 100644
--- a/bin/net_applet
+++ b/bin/net_applet
@@ -406,12 +406,14 @@ sub create_action_item {
my ($action) = @_;
my $name = ref($actions{$action}{name}) eq 'CODE' ? $actions{$action}{name}->($current_interface) : $actions{$action}{name};
if (exists $actions{$action}{choices}) {
+ my @menu = create_menu_choices($action);
+ @menu || $actions{$action}{header} or return ();
gtkshow(create_menu($name,
if_($actions{$action}{header},
create_action_item($actions{$action}{header}),
gtkshow(Gtk2::SeparatorMenuItem->new),
),
- create_menu_choices($action),
+ @menu,
));
} else {
gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label($name)), activate => sub { $actions{$action}{launch}->($current_interface) });