summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/net_monitor
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2001-04-07 23:00:23 +0000
committerdamien <damien@mandriva.com>2001-04-07 23:00:23 +0000
commit3cdee7cb91f1e6808b080560acf11dd9dff077c6 (patch)
tree68cda9d6717d788d803bacf93a5c03548ab8d96a /perl-install/standalone/net_monitor
parente5866166bc3ffb8cdff922d82598e3d37e68a325 (diff)
downloaddrakx-backup-do-not-use-3cdee7cb91f1e6808b080560acf11dd9dff077c6.tar
drakx-backup-do-not-use-3cdee7cb91f1e6808b080560acf11dd9dff077c6.tar.gz
drakx-backup-do-not-use-3cdee7cb91f1e6808b080560acf11dd9dff077c6.tar.bz2
drakx-backup-do-not-use-3cdee7cb91f1e6808b080560acf11dd9dff077c6.tar.xz
drakx-backup-do-not-use-3cdee7cb91f1e6808b080560acf11dd9dff077c6.zip
net_monitor incorporation
Diffstat (limited to 'perl-install/standalone/net_monitor')
-rwxr-xr-xperl-install/standalone/net_monitor9
1 files changed, 7 insertions, 2 deletions
diff --git a/perl-install/standalone/net_monitor b/perl-install/standalone/net_monitor
index 254fe98df..393ec532b 100755
--- a/perl-install/standalone/net_monitor
+++ b/perl-install/standalone/net_monitor
@@ -28,10 +28,12 @@ use common qw(:common :file :functional :system);
use strict;
use netconnect;
-my $default_intf;
+my ($connect, $default_intf);
init Gtk;
+my $in = vnew interactive('su');
$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/;
($default_intf) = "@ARGV" =~ /--defaultintf (\w+)/;
+$connect = "@ARGV" =~ /--connect/;
my $window1 = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel;
$window1->signal_connect ( delete_event => sub { Gtk->exit(0); });
$window1->set_position(1);
@@ -61,7 +63,7 @@ gtkadd($window1,
),
0, gtksignal_connect(my $button_connect = new Gtk::Button(), clicked => \&connection),
0, new Gtk::HSeparator,
- 0, gtksignal_connect(new Gtk::Button(_("Close")), clicked => sub { Gtk->exit(0) })
+ 0, gtksignal_connect(my $button_close = new Gtk::Button(_("Close")), clicked => sub { Gtk->exit(0) })
)
),
0, my $statusbar = new Gtk::Statusbar
@@ -86,12 +88,14 @@ my ($labelr, $labelt);
my $time_tag = Gtk->timeout_add(1000, \&rescan);
my $time_tag2 = Gtk->timeout_add(5000, \&update);
rescan();
+connection() if $connect && ! $isconnected;
Gtk->main;
Gtk->exit(0);
sub connection {
my $isconnected2 = $isconnected;
$button_connect->set_sensitive(0);
+ $button_close->set_sensitive(0);
$statusbar->pop(1);
$statusbar->push(1, $isconnected2 ? _("Disconnecting from internet ") : _("Connecting to internet "));
my $nb_point=1;
@@ -119,6 +123,7 @@ sub connection {
0;
});
$button_connect->set_sensitive(1);
+ $button_close->set_sensitive(1);
0;
});
Gtk->main_iteration while Gtk->events_pending;