diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-08-21 20:04:54 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-08-21 20:04:54 +0000 |
commit | f2e9d08a554e3e52c7b0b185d7d2889fb82dd168 (patch) | |
tree | 0cf9d30caf8cbea7ec16535c84171f21eafc3e58 /bin | |
parent | 78c3bf2e68f12297524f65dae4ae4b6e9cf733ec (diff) | |
download | drakx-net-f2e9d08a554e3e52c7b0b185d7d2889fb82dd168.tar drakx-net-f2e9d08a554e3e52c7b0b185d7d2889fb82dd168.tar.gz drakx-net-f2e9d08a554e3e52c7b0b185d7d2889fb82dd168.tar.bz2 drakx-net-f2e9d08a554e3e52c7b0b185d7d2889fb82dd168.tar.xz drakx-net-f2e9d08a554e3e52c7b0b185d7d2889fb82dd168.zip |
do not show empty menus
Diffstat (limited to 'bin')
-rw-r--r-- | bin/net_applet | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/net_applet b/bin/net_applet index e96475a..e0a4815 100644 --- a/bin/net_applet +++ b/bin/net_applet @@ -407,12 +407,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) }); |