summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/standalone/net_applet18
1 files changed, 9 insertions, 9 deletions
diff --git a/perl-install/standalone/net_applet b/perl-install/standalone/net_applet
index 06525e7fe..a4c206e88 100644
--- a/perl-install/standalone/net_applet
+++ b/perl-install/standalone/net_applet
@@ -7,7 +7,7 @@ use common;
use standalone;
use network::network;
use network::tools;
-
+use run_program;
use mygtk2 qw(gtknew);
use dbus_object;
use network::activefw;
@@ -54,8 +54,8 @@ Run the \"%s\" assistant from the Mandriva Linux Control Center", N("Set up a ne
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) } },
- 'monitorNetwork' => { name => N("Monitor Network"), launch => \&netMonitor },
- 'wireless' => { name => N("Manage wireless networks"), launch => sub { system("/usr/sbin/drakroam &") } },
+ 'monitorNetwork' => { name => N("Monitor Network"), launch => \&run_net_monitor },
+ 'wireless' => { name => N("Manage wireless networks"), launch => \&run_drakroam },
'confNetwork' => { name => N("Configure Network"), launch => sub { system("/usr/sbin/drakconnect --skip-wizard &") } },
'chooseInterface' => {
name => N("Watched interface"),
@@ -86,7 +86,7 @@ gtkadd(my $icon = Gtk2::TrayIcon->new("Net_Applet"),
)
);
$eventbox->signal_connect(button_press_event => sub {
- $_[1]->button == 1 and netMonitor();
+ $_[1]->button == 1 and run_net_monitor();
$_[1]->button == 3 && $menu and $menu->popup(undef, undef, undef, undef, $_[1]->button, $_[1]->time);
});
@@ -137,11 +137,11 @@ sub shouldStart() {
}
return getAutoStart();
}
-sub netMonitor() {
- unless (is_running('net_monitor')) {
- system("/usr/sbin/net_monitor --defaultintf $current_interface &");
- checkNetwork();
- }
+sub run_net_monitor() {
+ run_program::raw({ detach => 1 }, '/usr/sbin/net_monitor', '--defaultintf', $current_interface) unless is_running('net_monitor');
+}
+sub run_drakroam() {
+ run_program::raw({ detach => 1 }, '/usr/sbin/drakroam') unless is_running('drakroam');
}
sub checkWireless() {
my $networks = $monitor->list_wireless;