diff options
-rw-r--r-- | lib/network/connection_manager.pm | 6 | ||||
-rwxr-xr-x | lib/network/netcenter.pm | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm index 81a5a20..74c490b 100644 --- a/lib/network/connection_manager.pm +++ b/lib/network/connection_manager.pm @@ -149,6 +149,12 @@ sub stop_connection { update_on_status_change($cmanager); } +sub monitor_connection { + my ($cmanager) = @_; + my $interface = $cmanager->{connection} && $cmanager->{connection}->get_interface or return; + run_program::raw({ detach => 1 }, '/usr/sbin/net_monitor', '--defaultintf', $interface); +} + sub toggle_would_disconnect { my ($cmanager) = @_; diff --git a/lib/network/netcenter.pm b/lib/network/netcenter.pm index cdbaf9f..1dcf270 100755 --- a/lib/network/netcenter.pm +++ b/lib/network/netcenter.pm @@ -84,7 +84,10 @@ sub main { gtkset_image(gtknew('Button', clicked => sub { network::connection_manager::stop_connection($cmanager); }), 'disconnected'), - gtkset_image(gtknew('Button'), 'monitor-24'), + $cmanager->{gui}{buttons}{monitor} = + gtkset_image(gtknew('Button', clicked => sub { + network::connection_manager::monitor_connection($cmanager); + }), 'monitor-24'), $cmanager->{gui}{buttons}{configure} = gtkset_image(gtknew('Button', clicked => sub { network::connection_manager::configure_connection($cmanager); |