From 9fbed9ab76940bea1d9285057c33bcb4a585b0ee Mon Sep 17 00:00:00 2001
From: Thierry Vignaud <tvignaud@mandriva.org>
Date: Sun, 31 Aug 2003 21:10:50 +0000
Subject: in non expert mode, only display the list of *installed* display
 managers. (interface team request)

if no dm is installed, then switch back to expert mode behaviour and display
all dm and install them if needed.
---
 perl-install/standalone/drakedm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/perl-install/standalone/drakedm b/perl-install/standalone/drakedm
index 7e6a824ea..9106dd051 100644
--- a/perl-install/standalone/drakedm
+++ b/perl-install/standalone/drakedm
@@ -41,6 +41,9 @@ foreach (cat_($cfg_file)) {
     $dm = uc($1) if /^DISPLAYMANAGER=(.*)$/; 
 }
 
+my @raw_list = sort keys %dm;
+my @list = $::expert ? @raw_list : (grep { -e $dm{$_}->[1] } @raw_list) or @raw_list;
+
 start:
 if ($in->ask_from(N("Choosing a display manager"),
                                formatAlaTeX(N("X11 Display Manager allows you to graphically log
@@ -48,7 +51,8 @@ into your system with the X Window System running and supports running
 several different X sessions on your local machine at the same time.")),
                                [
                                 {
-                                 list => [ sort keys %dm ],
+                                 allow_empty_list => 1,
+                                 list => \@list,
                                  val => \$dm,
                                  type => 'list',
                                  format => sub { $dm{$_[0]}[0] },
-- 
cgit v1.2.1