summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-01-30 22:33:11 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-01-30 22:33:11 +0000
commitf5204831c0709c93972d0579a6cdaf19d0df2a9c (patch)
tree22a5634c1f0edaaebc8fa4cd84287616af3bff62
parent39b5acfff89f77e50dbc65d3699d0acfb0cef215 (diff)
downloaddrakx-f5204831c0709c93972d0579a6cdaf19d0df2a9c.tar
drakx-f5204831c0709c93972d0579a6cdaf19d0df2a9c.tar.gz
drakx-f5204831c0709c93972d0579a6cdaf19d0df2a9c.tar.bz2
drakx-f5204831c0709c93972d0579a6cdaf19d0df2a9c.tar.xz
drakx-f5204831c0709c93972d0579a6cdaf19d0df2a9c.zip
(ask_window_manager_to_logout, running_window_manager): created from Xconfigurator and cleaned
(selectLanguage): if $langs is empty, don't ask for "other languages"
-rw-r--r--perl-install/any.pm31
1 files changed, 28 insertions, 3 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 22929ef64..726d19139 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -816,7 +816,8 @@ Do you want to use this feature?"),
}
sub selectLanguage {
- my ($in, $lang, $langs) = @_;
+ my ($in, $lang, $langs_) = @_;
+ my $langs = $langs_ || {};
$in->ask_from_(
{ messages => _("Please choose a language to use."),
title => 'language choice',
@@ -827,12 +828,12 @@ sub selectLanguage {
},
[ { val => \$lang, separator => '|',
format => \&lang::lang2text, list => [ lang::list() ] },
- (map {;
+ if_($langs_, (map {;
{ val => \$langs->{$_->[0]}, type => 'bool', disabled => sub { $langs->{all} },
text => $_->[1], advanced => 1,
}
} sort { $a->[1] cmp $b->[1] } map { [ $_, lang::lang2text($_) ] } lang::list()),
- { val => \$langs->{all}, type => 'bool', text => _("All"), advanced => 1 }
+ { val => \$langs->{all}, type => 'bool', text => _("All"), advanced => 1 }),
]) or return;
$lang;
}
@@ -1029,4 +1030,28 @@ Security features are at their maximum.")),
);
}
+sub running_window_manager {
+ my @window_managers = (
+ 'kdeinit: kwin',
+ qw(gnome-session icewm wmaker kwm afterstep fvwm fvwm2 fvwm95 mwm twm enlightenment xfce blackbox sawfish olvwm),
+ );
+ foreach (@window_managers) {
+ return $_ if `/sbin/pidof "$_"` > 0;
+ }
+ '';
+}
+
+sub ask_window_manager_to_logout {
+ my ($wm) = @_;
+
+ my %h = (
+ 'kwm' => "kwmcom logout",
+ 'kdeinit: kwin' => "dcop kdesktop default logout",
+ 'gnome-session' => "save-session --kill",
+ 'icewm' => "killall -QUIT icewm",
+ );
+ system($h{$wm} || return);
+ 1;
+}
+
1;