summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-02-22 17:19:02 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-02-22 17:19:02 +0000
commit3caefbe5aa7c8be8057a0292032264145735fd7b (patch)
tree96f8936f20ffc9d4bbe797ac36e5fb538ce5a96c /perl-install
parentac30a22beaaefdc87db803fb35e586d7ab3db4f2 (diff)
downloaddrakx-backup-do-not-use-3caefbe5aa7c8be8057a0292032264145735fd7b.tar
drakx-backup-do-not-use-3caefbe5aa7c8be8057a0292032264145735fd7b.tar.gz
drakx-backup-do-not-use-3caefbe5aa7c8be8057a0292032264145735fd7b.tar.bz2
drakx-backup-do-not-use-3caefbe5aa7c8be8057a0292032264145735fd7b.tar.xz
drakx-backup-do-not-use-3caefbe5aa7c8be8057a0292032264145735fd7b.zip
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/ChangeLog4
-rw-r--r--perl-install/Makefile4
-rw-r--r--perl-install/Makefile.drakxtools2
-rw-r--r--perl-install/Xconfigurator.pm40
-rw-r--r--perl-install/interactive_gtk.pm6
-rwxr-xr-xperl-install/standalone/XFdrake2
6 files changed, 41 insertions, 17 deletions
diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog
index 82aa826d0..13e6198de 100644
--- a/perl-install/ChangeLog
+++ b/perl-install/ChangeLog
@@ -1,5 +1,9 @@
2000-02-22 Pixel <pixel@mandrakesoft.com>
+ * Xconfigurator.pm: load "Cards" database only to translate NAME
+ to fields. Added file CardsNames created from Cards using
+ share/Cards2CardsNames. Kind of list of normalized NAMEs
+
* MonitorsDB: replace the ` ' separator for vendor by `|'
* install_steps_interactive.pm (timeConfig): use ask_from_treelist
diff --git a/perl-install/Makefile b/perl-install/Makefile
index 62f5dd7fe..6e3ed41c7 100644
--- a/perl-install/Makefile
+++ b/perl-install/Makefile
@@ -16,7 +16,7 @@ tar-drakxtools: clean
$(MAKE) -C ../tools clean
cd .. ; rm -rf drakxtools ; cp -af perl-install drakxtools ; cp -af tools/ddcprobe tools/pnp_serial drakxtools
cd ../drakxtools ; rm -rf install* pkgs.pm ftp.pm t.pm */CVS ; mv Makefile.drakxtools Makefile ; mv -f standalone/* share/* .
- cd .. ; tar cfy drakxtools.tar.bz2 --exclude CVS $(patsubst %,drakxtools/%,Makefile Makefile.config MonitorsDB Newt c ddcprobe pnp_serial po pci_probing resize_fat diskdrake.rc $(STANDALONEPMS) icons *.pm)
+ cd .. ; tar cfy drakxtools.tar.bz2 --exclude CVS $(patsubst %,drakxtools/%,Makefile Makefile.config MonitorsDB CardsNames Newt c ddcprobe pnp_serial po pci_probing resize_fat diskdrake.rc $(STANDALONEPMS) icons *.pm)
cd .. ; rm -rf drakxtools
$(DIRS):
@@ -114,7 +114,7 @@ endif
cd share ; cp -a keymaps $(DEST)/usr/share
cd share ; cp -a consolefonts $(DEST)/usr/share
cd share ; cp template.in/*.in $(DEST)/usr/share
- cd share ; cp MonitorsDB $(DEST)/usr/X11R6/lib/X11
+ cd share ; cp MonitorsDB CardsNames $(DEST)/usr/X11R6/lib/X11
cd share ; cp logo-mandrake.xpm $(DEST)/usr/share
cd share ; cp -a themes $(DEST)/usr/share/gtk
cd share ; cp compss compssUsers compssList $(ROOTDEST)/Mandrake/base
diff --git a/perl-install/Makefile.drakxtools b/perl-install/Makefile.drakxtools
index b0e1eff52..475940106 100644
--- a/perl-install/Makefile.drakxtools
+++ b/perl-install/Makefile.drakxtools
@@ -27,7 +27,7 @@ install:
ln -s ../../$(patsubst $(PREFIX)/usr%,%,$(SBINDEST))/XFdrake $(BINX11DEST)/Xdrakres
for i in *.pm ; do perl -pe '$$_ = "\n" if /\s*use\s+(diagnostics|vars|strict)/' $$i > $(LIBDEST)/$$i ; done
- install -m 644 MonitorsDB $(LIBX11DEST)
+ install -m 644 MonitorsDB CardsNames $(LIBX11DEST)
install -m 644 diskdrake.rc $(ETCDEST)
install -m 644 po/*.po $(LIBDEST)/po
install -m 644 $(patsubst %,Newt/%.pm,Newt) $(LIBDEST)/Newt
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm
index 6811ec4b4..2257b1785 100644
--- a/perl-install/Xconfigurator.pm
+++ b/perl-install/Xconfigurator.pm
@@ -37,6 +37,7 @@ sub readCardsDB {
local *F;
open F, $file or die "file $file not found";
+ print "readCardsDB\n";
my ($lineno, $cmd, $val) = 0;
my $fs = {
@@ -84,6 +85,25 @@ sub readCardsDB {
$cards{I128}{flags}{noclockprobe} = 1;
\%cards;
}
+sub readCardsNames {
+ my $file = "$prefix/usr/X11R6/lib/X11/CardsNames";
+ local *F; open F, $file or die "can't find $file\n";
+ map { (split '=>')[0] } <F>;
+}
+sub cardName2RealName {
+ my $file = "$prefix/usr/X11R6/lib/X11/CardsNames";
+ my ($name) = @_;
+ local *F; open F, $file or die "can't find $file\n";
+ foreach (<F>) { chop;
+ my ($name_, $real) = split '=>';
+ return $real if $name eq $name_;
+ }
+ $name;
+}
+sub cardName2card {
+ my ($name) = @_;
+ readCardsDB("$prefix/usr/X11R6/lib/X11/Cards")->{$name};
+}
sub readMonitorsDB {
my ($file) = @_;
@@ -110,7 +130,7 @@ sub readMonitorsDB {
$monitors{$l{type}} = \%l;
}
while (my ($k, $v) = each %standard_monitors) {
- $monitors{" " . translate($k)} =
+ $monitors{_("Generic") . "|" . translate($k)} =
{ hsyncrange => $v->[1], vsyncrange => $v->[2] };
}
}
@@ -155,16 +175,14 @@ sub cardConfiguration(;$$$) {
my ($card, $noauto, $allowFB) = @_;
$card ||= {};
- readCardsDB("$prefix/usr/X11R6/lib/X11/Cards");
-
- add2hash($card, $cards{$card->{type}}) if $card->{type}; #- try to get info from given type
+ add2hash($card, cardName2card($card->{type})) if $card->{type}; #- try to get info from given type
undef $card->{type} unless $card->{server}; #- bad type as we can't find the server
add2hash($card, cardConfigurationAuto()) unless $card->{server} || $noauto;
$card->{server} = 'FBDev' unless !$allowFB || $card->{server} || $card->{type} || $noauto;
- $card->{type} = $in->ask_from_list(_("Graphic card"), _("Select a graphic card"), ['Unlisted', keys %cards]) unless $card->{type} || $card->{server};
+ $card->{type} = cardName2RealName($in->ask_from_treelist(_("Graphic card"), _("Select a graphic card"), '|', ['Unlisted', readCardsNames()])) unless $card->{type} || $card->{server};
undef $card->{type}, $card->{server} = $in->ask_from_list(_("X server"), _("Choose a X server"), $allowFB ? \@allservers : \@allbutfbservers ) if $card->{type} eq "Unlisted";
- add2hash($card, $cards{$card->{type}}) if $card->{type};
+ add2hash($card, cardName2card($card->{type})) if $card->{type};
add2hash($card, { vendor => "Unknown", board => "Unknown" });
$card->{prog} = "/usr/X11R6/bin/XF86_$card->{server}";
@@ -222,9 +240,9 @@ sub monitorConfiguration(;$$) {
} else {
$monitor->{hsyncrange} && $monitor->{vsyncrange} and return $monitor;
- readMonitorsDB(-e "MonitorsDB" ? "MonitorsDB" : "/usr/X11R6/lib/X11/MonitorsDB");
+ readMonitorsDB("/usr/X11R6/lib/X11/MonitorsDB");
- add2hash($monitor, { type => $in->ask_from_treelist(_("Monitor"), _("Choose a monitor"), '|', ['Unlisted', keys %monitors], ' ' . translate($default_monitor)) }) unless $monitor->{type};
+ add2hash($monitor, { type => $in->ask_from_treelist(_("Monitor"), _("Choose a monitor"), '|', ['Unlisted', keys %monitors], _("Generic") . '|' . translate($default_monitor)) }) unless $monitor->{type};
if ($monitor->{type} eq 'Unlisted') {
$in->ask_from_entries_ref('',
_("The two critical parameters are the vertical refresh rate, which is the rate
@@ -473,9 +491,9 @@ sub chooseResolutionsGtk($$;$) {
}
gtkadd($W->{window},
gtkpack_($W->create_box_with_title(_("Choose resolution and color depth"),
- "(" . ($o->{card}{type} ?
- _("Graphic card: %s\n", $o->{card}{type}) :
- _("XFree86 server: %s\n", $o->{card}{server})) . ")"
+ "(" . ($card->{type} ?
+ _("Graphic card: %s", $card->{type}) :
+ _("XFree86 server: %s", $card->{server})) . ")"
),
1, gtkpack(new Gtk::HBox(0,20),
$depth_combo = new Gtk::Combo,
diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm
index 62f0c3603..8d45913fe 100644
--- a/perl-install/interactive_gtk.pm
+++ b/perl-install/interactive_gtk.pm
@@ -53,7 +53,7 @@ sub ask_from_listW {
$r or die "ask_from_list cancel";
}
-sub ask_from_treelist {
+sub ask_from_treelistW {
my ($o, $title, $messages, $separator, $l, $def) = @_;
my $sep = quotemeta $separator;
my $w = my_gtk->new($title);
@@ -95,9 +95,11 @@ sub ask_from_treelist {
Gtk->main_quit;
};
+ $w->{ok_clicked} = $leave;
+ $w->{cancel_clicked} = sub { $o->destroy; die "ask_from_list cancel" }; #- make sure windows doesn't live any more.
gtkadd($w->{window},
gtkpack_(new Gtk::VBox(0,0),
- 1, gtkset_usize(createScrolledWindow($tree), 200, 280),
+ 1, gtkset_usize(createScrolledWindow($tree), 400, 350),
0, $w->create_okcancel));
$tree->set_selection_mode('browse');
$tree->signal_connect(tree_select_row => sub { $curr = $_[1]; });
diff --git a/perl-install/standalone/XFdrake b/perl-install/standalone/XFdrake
index 6ebfbca0a..4ec8ef611 100755
--- a/perl-install/standalone/XFdrake
+++ b/perl-install/standalone/XFdrake
@@ -17,7 +17,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-use lib qw(/usr/lib/libDrakX);
+use lib qw(.); #/usr/lib/libDrakX);
use interactive;
use Xconfigurator;