summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/net_applet
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-07-22 03:55:24 +0000
committerOlivier Blin <oblin@mandriva.org>2005-07-22 03:55:24 +0000
commit5f023dd8327f25e64308d6893a33643e143e33a0 (patch)
tree2e01aef0fc3d2c83317ddeaf67dc33cb60ce599b /perl-install/standalone/net_applet
parent5197633882c4b3887851ef179a217f67332dee5d (diff)
downloaddrakx-5f023dd8327f25e64308d6893a33643e143e33a0.tar
drakx-5f023dd8327f25e64308d6893a33643e143e33a0.tar.gz
drakx-5f023dd8327f25e64308d6893a33643e143e33a0.tar.bz2
drakx-5f023dd8327f25e64308d6893a33643e143e33a0.tar.xz
drakx-5f023dd8327f25e64308d6893a33643e143e33a0.zip
use run_program
Diffstat (limited to 'perl-install/standalone/net_applet')
-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;