diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-03-21 12:51:25 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-03-21 12:51:25 +0000 |
commit | 7aead5e685921b1603f3cbf03f4f417ca6803a78 (patch) | |
tree | f5221e23653015606bd7bacd4e5d9746e1eba4d6 /perl-install/standalone/net_applet | |
parent | 9c249bd41876f525f37fe5df70ebcc234313755a (diff) | |
download | drakx-7aead5e685921b1603f3cbf03f4f417ca6803a78.tar drakx-7aead5e685921b1603f3cbf03f4f417ca6803a78.tar.gz drakx-7aead5e685921b1603f3cbf03f4f417ca6803a78.tar.bz2 drakx-7aead5e685921b1603f3cbf03f4f417ca6803a78.tar.xz drakx-7aead5e685921b1603f3cbf03f4f417ca6803a78.zip |
don't modify autostart config file value if started with --force
Diffstat (limited to 'perl-install/standalone/net_applet')
-rw-r--r-- | perl-install/standalone/net_applet | 16 |
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, |