summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-07-27 02:32:44 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-07-27 02:32:44 +0000
commita8cff7628eda76b054d0ab3bd8f2d02b1f4a9cbd (patch)
treea611c000bdecd952d2ba6302c3714947eec966b8 /perl-install
parent0e7b527b6e8ce0c9809e6b132b8d266eabb8073b (diff)
downloaddrakx-a8cff7628eda76b054d0ab3bd8f2d02b1f4a9cbd.tar
drakx-a8cff7628eda76b054d0ab3bd8f2d02b1f4a9cbd.tar.gz
drakx-a8cff7628eda76b054d0ab3bd8f2d02b1f4a9cbd.tar.bz2
drakx-a8cff7628eda76b054d0ab3bd8f2d02b1f4a9cbd.tar.xz
drakx-a8cff7628eda76b054d0ab3bd8f2d02b1f4a9cbd.zip
save/restore options
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/standalone/net_monitor16
1 files changed, 12 insertions, 4 deletions
diff --git a/perl-install/standalone/net_monitor b/perl-install/standalone/net_monitor
index 8116be919..4ec8cea0b 100755
--- a/perl-install/standalone/net_monitor
+++ b/perl-install/standalone/net_monitor
@@ -51,7 +51,7 @@ my $in = 'interactive'->vnew;
my $window1 = ugtk2->new(N("Network Monitoring"));
-$window1->{rwindow}->signal_connect(delete_event => sub { ugtk2->exit(0) });
+$window1->{rwindow}->signal_connect(delete_event => \&main_quit);
unless ($::isEmbedded) {
$window1->{rwindow}->set_position('center');
@@ -80,7 +80,9 @@ my $grid_interval = 30;
my $arrow_space = 6;
my $arrow_size = 5;
-my $use_same_scale = 1;
+my $cfg_file = $< ? "$ENV{HOME}/.net_monitorrc" : "/etc/sysconfig/net_monitorrc";
+my %config = getVarsFromSh($cfg_file);
+my $use_same_scale = text2bool($config{use_same_scale});
network::netconnect::read_net_conf($netcnx, $netc, $intf);
MDK::Common::Globals::init(in => $in);
@@ -113,7 +115,7 @@ gtkadd($window1->{window},
0, gtksignal_connect(gtkset_active(new Gtk2::CheckButton(N("Use same scale for received and transmitted")), $use_same_scale), clicked => sub { $use_same_scale = !$use_same_scale }),
0, gtkpack(create_hbox('edge'),
gtksignal_connect(my $button_connect = gtkset_sensitive(Gtk2::Button->new(N("Wait please")), 0), clicked => \&connection),
- gtksignal_connect(my $button_close = Gtk2::Button->new(N("Close")), clicked => sub { ugtk2->exit(0) }),
+ gtksignal_connect(my $button_close = Gtk2::Button->new(N("Close")), clicked => \&main_quit),
),
0, my $statusbar = Gtk2::Statusbar->new
),
@@ -161,11 +163,17 @@ $SIG{CHLD} = sub {
$window1->main;
-ugtk2->exit(0);
+main_quit();
my $during_connection;
my $first;
+sub main_quit() {
+ $config{use_same_scale} = bool2yesno($use_same_scale);
+ setVarsInSh($cfg_file, \%config);
+ ugtk2->exit(0);
+}
+
sub bg_command_as_root {
my $name = shift;
run_program::raw({ detach => 1 }, [ 'consolehelper', $name ], @_);