summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-11-17 15:32:54 +0000
committerOlivier Blin <oblin@mandriva.com>2008-11-17 15:32:54 +0000
commit37e707a44ec8b621b12eddf4755a78a20f01fb7a (patch)
tree6edc28799cc00045126a51ec9ab455cc7691182b
parentb59a5dce8ac32cb6d23d13b0aeffbee7246ed875 (diff)
downloaddrakx-net-37e707a44ec8b621b12eddf4755a78a20f01fb7a.tar
drakx-net-37e707a44ec8b621b12eddf4755a78a20f01fb7a.tar.gz
drakx-net-37e707a44ec8b621b12eddf4755a78a20f01fb7a.tar.bz2
drakx-net-37e707a44ec8b621b12eddf4755a78a20f01fb7a.tar.xz
drakx-net-37e707a44ec8b621b12eddf4755a78a20f01fb7a.zip
show interface type name instead of just the interface
-rwxr-xr-xbin/net_applet14
1 files changed, 12 insertions, 2 deletions
diff --git a/bin/net_applet b/bin/net_applet
index d20f5ed..0890113 100755
--- a/bin/net_applet
+++ b/bin/net_applet
@@ -103,9 +103,18 @@ Run the \"%s\" assistant from the Mandriva Linux Control Center", N("Set up a ne
);
}
+sub get_interface_name {
+ my ($interface) = @_;
+ my $ifcfg = $net->{ifcfg}{$interface};
+ require network::connection;
+ my $type = $ifcfg && network::connection->find_ifcfg_type($ifcfg);
+ my $type_name = $type && $type->get_type_name;
+ $type_name ? "$type_name ($interface)" : $interface;
+}
+
my %actions = (
- 'upNetwork' => { name => sub { N("Connect %s", $_[0]) }, launch => sub { network::tools::start_interface($_[0], 1) } },
- 'downNetwork' => { name => sub { N("Disconnect %s", $_[0]) }, launch => sub { network::tools::stop_interface($_[0], 1) } },
+ 'upNetwork' => { name => sub { N("Connect %s", get_interface_name($_[0])) }, launch => sub { network::tools::start_interface($_[0], 1) } },
+ 'downNetwork' => { name => sub { N("Disconnect %s", get_interface_name($_[0])) }, launch => sub { network::tools::stop_interface($_[0], 1) } },
'monitorNetwork' => { name => N("Monitor Network"), launch => \&run_net_monitor },
'monitorIFW' => { name => N("Interactive Firewall"), launch => \&run_drakids },
'wireless' => { name => N("Manage wireless networks"), launch => sub { run_drakroam() } },
@@ -132,6 +141,7 @@ my %actions = (
my ($is_up, $_gw) = network::tools::get_interface_status($_[0]);
$is_up;
},
+ format_choice => sub { get_interface_name($_[0]) },
get_icon => sub {
my $ifcfg = $net->{ifcfg}{$_[0]};
require network::connection;