summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-03-21 12:51:25 +0000
committerOlivier Blin <oblin@mandriva.org>2005-03-21 12:51:25 +0000
commit7aead5e685921b1603f3cbf03f4f417ca6803a78 (patch)
treef5221e23653015606bd7bacd4e5d9746e1eba4d6 /perl-install/standalone
parent9c249bd41876f525f37fe5df70ebcc234313755a (diff)
downloaddrakx-backup-do-not-use-7aead5e685921b1603f3cbf03f4f417ca6803a78.tar
drakx-backup-do-not-use-7aead5e685921b1603f3cbf03f4f417ca6803a78.tar.gz
drakx-backup-do-not-use-7aead5e685921b1603f3cbf03f4f417ca6803a78.tar.bz2
drakx-backup-do-not-use-7aead5e685921b1603f3cbf03f4f417ca6803a78.tar.xz
drakx-backup-do-not-use-7aead5e685921b1603f3cbf03f4f417ca6803a78.zip
don't modify autostart config file value if started with --force
Diffstat (limited to 'perl-install/standalone')
-rw-r--r--perl-install/standalone/net_applet16
1 files changed, 10 insertions, 6 deletions
diff --git a/perl-install/standalone/net_applet b/perl-install/standalone/net_applet
index 0972e0890..e06c786a5 100644
--- a/perl-install/standalone/net_applet
+++ b/perl-install/standalone/net_applet
@@ -99,8 +99,6 @@ $eventbox->signal_connect(button_press_event => sub {
}
$_[1]->button == 3 && $menu and $menu->popup(undef, undef, undef, undef, $_[1]->button, $_[1]->time);
});
-my ($opt) = @ARGV;
-if ($opt eq '--force' || $opt eq '-f') { setAutoStart('TRUE') }
shouldStart() or die "$onstartupfile should be set to TRUE or use net_applet --force";
@@ -136,9 +134,11 @@ sub is_running {
} `ps -o '%P %p %c' -u $ENV{USER}`;
}
sub shouldStart() {
- my %p = getVarsFromSh($onstartupfile);
- my $ret = $p{AUTOSTART} eq 'FALSE' ? 0 : 1;
- $ret;
+ my ($opt) = @ARGV;
+ if ($opt eq '--force' || $opt eq '-f') {
+ return 1;
+ }
+ return getAutoStart();
}
sub md5file {
my @md5;
@@ -219,7 +219,7 @@ sub setState {
$activefw->get_interactive),
toggled => sub { $activefw->set_interactive(to_bool($_[0]->get_active)) })));
}
- $menu->append(gtkshow(gtksignal_connect(gtkset_active(Gtk2::CheckMenuItem->new_with_label(N("Always launch on startup")), shouldStart()),
+ $menu->append(gtkshow(gtksignal_connect(gtkset_active(Gtk2::CheckMenuItem->new_with_label(N("Always launch on startup")), getAutoStart()),
toggled => sub { setAutoStart(uc(bool2text($_[0]->get_active))) })));
$menu->append(gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label(N("Quit"))), activate => sub { mainQuit() }));
$menu;
@@ -228,6 +228,10 @@ sub mainQuit() {
Glib::Source->remove($timeout) if $timeout;
Gtk2->main_quit;
}
+sub getAutoStart {
+ my %p = getVarsFromSh($onstartupfile);
+ return to_bool($p{AUTOSTART} ne 'FALSE');
+}
sub setAutoStart {
my $state = shift;
output_p $onstartupfile,