summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-06-17 23:48:49 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-06-17 23:48:49 +0000
commit38a62ff48b3ca032cf5bb9cff7ddce6602b2872e (patch)
treec744f0b0a8a093ecd5822fe8d96e9033aa196acc /perl-install
parent401602eb9a8d365d64dc6c79fbe2aec2bd6f3654 (diff)
downloaddrakx-backup-do-not-use-38a62ff48b3ca032cf5bb9cff7ddce6602b2872e.tar
drakx-backup-do-not-use-38a62ff48b3ca032cf5bb9cff7ddce6602b2872e.tar.gz
drakx-backup-do-not-use-38a62ff48b3ca032cf5bb9cff7ddce6602b2872e.tar.bz2
drakx-backup-do-not-use-38a62ff48b3ca032cf5bb9cff7ddce6602b2872e.tar.xz
drakx-backup-do-not-use-38a62ff48b3ca032cf5bb9cff7ddce6602b2872e.zip
add infrastructure for per class help (and add missing space around brackets
that perl_checker did miss :-()
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/standalone/harddrake2140
1 files changed, 76 insertions, 64 deletions
diff --git a/perl-install/standalone/harddrake2 b/perl-install/standalone/harddrake2
index af46cd9c2..da5892be9 100755
--- a/perl-install/standalone/harddrake2
+++ b/perl-install/standalone/harddrake2
@@ -15,65 +15,67 @@ use POSIX qw(:sys_wait_h);
# { field => [ short_translation, full_description] }
my %fields =
(
- "alternative_drivers" => [ N("Alternative drivers"),
- N("the list of alternative drivers for this sound card") ],
- "bus" =>
- [ N("Bus"),
- N("this is the physical bus on which the device is plugged (eg: PCI, USB, ...)") ],
- "channel" => [ N("Channel"), N("EIDE/SCSI channel") ],
- "bogomips" => [ N("Bogomips"), N("the GNU/Linux kernel needs to run a calculation loop at boot time to initialize a timer counter. Its result is stored as bogomips as a way to \"benchmark\" the cpu.") ],
- "bus_id" =>
- [ N("Bus identification"),
- N("- PCI and USB devices: this lists the vendor, device, subvendor and subdevice PCI/USB ids") ],
- "bus_location" =>
- [ N("Location on the bus"),
- N("- pci devices: this gives the PCI slot, device and function of this card
+ generic =>
+ {
+ "alternative_drivers" => [ N("Alternative drivers"),
+ N("the list of alternative drivers for this sound card") ],
+ "bus" =>
+ [ N("Bus"),
+ N("this is the physical bus on which the device is plugged (eg: PCI, USB, ...)") ],
+ "channel" => [ N("Channel"), N("EIDE/SCSI channel") ],
+ "bogomips" => [ N("Bogomips"), N("the GNU/Linux kernel needs to run a calculation loop at boot time to initialize a timer counter. Its result is stored as bogomips as a way to \"benchmark\" the cpu.") ],
+ "bus_id" =>
+ [ N("Bus identification"),
+ N("- PCI and USB devices: this lists the vendor, device, subvendor and subdevice PCI/USB ids") ],
+ "bus_location" =>
+ [ N("Location on the bus"),
+ N("- pci devices: this gives the PCI slot, device and function of this card
- eide devices: the device is either a slave or a master device
- scsi devices: the scsi bus and the scsi device ids") ],
- "cache size" => [ N("Cache size"), N("size of the (second level) cpu cache") ],
- "capacity" => [ N("Drive capacity"), N("special capacities of the driver (burning ability and or DVD support)") ],
- "coma_bug" => [
- #-PO: here "comas" is the medical coma, not the lexical coma!!
- N("Coma bug"), N("whether this cpu has the Cyrix 6x86 Coma bug") ],
- "cpu family" => [ N("Cpuid family"), N("family of the cpu (eg: 6 for i686 class)") ],
- "cpuid level" => [ N("Cpuid level"), N("information level that can be obtained through the cpuid instruction") ],
- "cpu MHz" => [ N("Frequency (MHz)"), N("the CPU frequency in MHz (Megahertz which in first approximation may be coarsely assimilated to number of instructions the cpu is able to execute per second)") ],
- "description" => [ N("Description"), N("this field describes the device") ],
- "device" => [ N("Old device file"),
- N("old static device name used in dev package") ],
- "devfs_device" => [ N("New devfs device"),
- N("new dynamic device name generated by core kernel devfs") ],
- "driver" => [
- #-PO: here "module" is the "jargon term" for a kernel driver
- N("Module"), N("the module of the GNU/Linux kernel that handles the device") ],
- "extended_partitions" => [ N("Extended partitions"), N("the number of extended partitions") ],
- "flags" => [ N("Flags"), N("CPU flags reported by the kernel") ],
- "fdiv_bug" => [ N("Fdiv bug"),
- N("Early Intel Pentium chips manufactured have a bug in their floating point processor which did not achieve the required precision when performing a Floating point DIVision (FDIV)") ],
- "fpu" => [ N("Is FPU present"), N("yes means the processor has an arithmetic coprocessor") ],
- "fpu_exception" => [ N("Whether the FPU has an irq vector"), N("yes means the arithmetic coprocessor has an exception vector attached") ],
- "f00f_bug" => [N("F00f bug"), N("early pentiums were buggy and freezed when decoding the F00F bytecode")],
- "geometry" => [N("Geometry"), N("Cylinder/head/sectors geometry of the disk")],
- "hlt_bug" => [ N("Halt bug"),
- N("Some of the early i486DX-100 chips cannot reliably return to operating mode after the \"halt\" instruction is used") ],
-
- "info" => [N("Floppy format"), N("format of floppies supported by the drive")],
- "level" => [N("Level"), N("sub generation of the cpu")],
- "media_type" => [ N("Media class"), N("class of hardware device") ],
- "Model" => [N("Model"), N("hard disk model")],
- "model" => [N("Model"), N("generation of the cpu (eg: 8 for PentiumIII, ...)")],
- "model name" => [N("Model name"), N("official vendor name of the cpu")],
- "nbuttons" => [ N("Number of buttons"), N("the number of buttons the mouse has") ],
- "name" => [ N("Name"), N("the name of the CPU") ],
- "port" => [N("Port"), N("network printer port")],
- "processor" => [ N("Processor ID"), N("the number of the processor") ],
- "primary_partitions" => [ N("Primary partitions"), N("the number of the primary partitions") ],
- "stepping" => [ N("Model stepping"), N("stepping of the cpu (sub model (generation) number)") ],
- "type" => [ N("Type"), N("the type of bus on which the mouse is connected") ],
- "Vendor" => [ N("Vendor"), N("the vendor name of the device") ],
- "vendor_id" => [ N("Vendor"), N("the vendor name of the processor") ],
- "wp" => [ N("Write protection"), N("the WP flag in the CR0 register of the cpu enforce write proctection at the memory page level, thus enabling the processor to prevent unchecked kernel accesses to user memory (aka this is a bug guard)") ],
- );
+ "cache size" => [ N("Cache size"), N("size of the (second level) cpu cache") ],
+ "capacity" => [ N("Drive capacity"), N("special capacities of the driver (burning ability and or DVD support)") ],
+ "coma_bug" => [
+ #-PO: here "comas" is the medical coma, not the lexical coma!!
+ N("Coma bug"), N("whether this cpu has the Cyrix 6x86 Coma bug") ],
+ "cpu family" => [ N("Cpuid family"), N("family of the cpu (eg: 6 for i686 class)") ],
+ "cpuid level" => [ N("Cpuid level"), N("information level that can be obtained through the cpuid instruction") ],
+ "cpu MHz" => [ N("Frequency (MHz)"), N("the CPU frequency in MHz (Megahertz which in first approximation may be coarsely assimilated to number of instructions the cpu is able to execute per second)") ],
+ "description" => [ N("Description"), N("this field describes the device") ],
+ "device" => [ N("Old device file"),
+ N("old static device name used in dev package") ],
+ "devfs_device" => [ N("New devfs device"),
+ N("new dynamic device name generated by core kernel devfs") ],
+ "driver" => [
+ #-PO: here "module" is the "jargon term" for a kernel driver
+ N("Module"), N("the module of the GNU/Linux kernel that handles the device") ],
+ "extended_partitions" => [ N("Extended partitions"), N("the number of extended partitions") ],
+ "flags" => [ N("Flags"), N("CPU flags reported by the kernel") ],
+ "fdiv_bug" => [ N("Fdiv bug"),
+ N("Early Intel Pentium chips manufactured have a bug in their floating point processor which did not achieve the required precision when performing a Floating point DIVision (FDIV)") ],
+ "fpu" => [ N("Is FPU present"), N("yes means the processor has an arithmetic coprocessor") ],
+ "fpu_exception" => [ N("Whether the FPU has an irq vector"), N("yes means the arithmetic coprocessor has an exception vector attached") ],
+ "f00f_bug" => [ N("F00f bug"), N("early pentiums were buggy and freezed when decoding the F00F bytecode") ],
+ "geometry" => [ N("Geometry"), N("Cylinder/head/sectors geometry of the disk") ],
+ "hlt_bug" => [ N("Halt bug"),
+ N("Some of the early i486DX-100 chips cannot reliably return to operating mode after the \"halt\" instruction is used") ],
+ "info" => [ N("Floppy format"), N("format of floppies supported by the drive") ],
+ "level" => [ N("Level"), N("sub generation of the cpu") ],
+ "media_type" => [ N("Media class"), N("class of hardware device") ],
+ "Model" => [ N("Model"), N("hard disk model") ],
+ "model" => [ N("Model"), N("generation of the cpu (eg: 8 for PentiumIII, ...)") ],
+ "model name" => [ N("Model name"), N("official vendor name of the cpu") ],
+ "nbuttons" => [ N("Number of buttons"), N("the number of buttons the mouse has") ],
+ "name" => [ N("Name"), N("the name of the CPU") ],
+ "port" => [ N("Port"), N("network printer port") ],
+ "processor" => [ N("Processor ID"), N("the number of the processor") ],
+ "primary_partitions" => [ N("Primary partitions"), N("the number of the primary partitions") ],
+ "stepping" => [ N("Model stepping"), N("stepping of the cpu (sub model (generation) number)") ],
+ "type" => [ N("Type"), N("the type of bus on which the mouse is connected") ],
+ "Vendor" => [ N("Vendor"), N("the vendor name of the device") ],
+ "vendor_id" => [ N("Vendor"), N("the vendor name of the processor") ],
+ "wp" => [ N("Write protection"), N("the WP flag in the CR0 register of the cpu enforce write proctection at the memory page level, thus enabling the processor to prevent unchecked kernel accesses to user memory (aka this is a bug guard)") ],
+ },
+ );
my ($in, $pid, $w);
@@ -81,7 +83,7 @@ my ($in, $pid, $w);
my (%options, %check_boxes);
my $conffile = "/etc/sysconfig/harddrake2/ui.conf";
-my ($current_device, $current_configurator);
+my ($current_device, $current_class, $current_configurator);
my %menus = (
@@ -114,8 +116,11 @@ my @menu_items =
if ($current_device) {
create_dialog(N("Harddrake help"),
N("Description of the fields:\n\n")
-#-PO: Do not alter the <span ..> and </span> tags
- . join("\n\n", map { if_($fields{$_}[0], formatAlaTeX(qq(<span foreground="royalblue3">$fields{$_}[0]:</span> $fields{$_}[1]))) } sort keys %$current_device), { use_markup => 1, if_(!$::isEmbedded, transient => $w->{window}), height => 400, scroll => 1 })
+ . join("\n\n", map {
+ my $info = lookup_field($_);
+ if_($info->[0], formatAlaTeX(qq(<span foreground="royalblue3">$info->[0]:</span> $info->[1])))
+ } sort keys %$current_device),
+ { use_markup => 1, if_(!$::isEmbedded, transient => $w->{window}), height => 400, scroll => 1 })
} else {
create_dialog(N("Select a device !"), N("Once you've selected a device, you'll be able to see the device information in fields displayed on the right frame (\"Information\")"), { if_(!$::isEmbedded, transient => $w->{window}) })
@@ -210,7 +215,7 @@ $tree->get_selection->signal_connect('changed' => sub {
my ($model, $iter) = $select->get_selected;
if ($model) {
my $idx = $model->get($iter, 2);
- $current_device = $data[$idx];
+ ($current_device, $current_class) = @{$data[$idx]};
if ($idx ne -1) {
use Gtk2::Pango;
@@ -218,7 +223,8 @@ $tree->get_selection->signal_connect('changed' => sub {
# The U+200E character is to force LTR display, as what what follows the colon is always in LTR (device names, paths, etc),
# this ensures proper displaying of names like /dev/fd0 (otherwise it gets 'dev/fd0/').
# it must come *after* the space, as the space must follow the colon following the direction of writting.
- if_($_ && $fields{$_}[0], [ $fields{$_}[0] . ": \x{200e}", { 'foreground' => 'royalblue3', 'weight' => Gtk2::Pango->PANGO_WEIGHT_BOLD } ],
+ my $field = lookup_field($_);
+ if_($_ && $field->[0], [ $field->[0] . ": \x{200e}", { 'foreground' => 'royalblue3', 'weight' => Gtk2::Pango->PANGO_WEIGHT_BOLD } ],
[ ($current_device->{$_} =~ /^(unknown)/ ? N("unknown") :
$current_device->{$_} =~ /^(Unknown)/ ? N("Unknown") :
$current_device->{$_} eq 'yes' ? N("Yes") :
@@ -227,7 +233,7 @@ $tree->get_selection->signal_connect('changed' => sub {
} sort keys %$current_device ]);
foreach (keys %$current_device) {
- print qq(Warning: skip "$_" field => "$current_device->{$_}"\n\n) unless $fields{$_}[0];
+ print qq(Warning: skip "$_" field => "$current_device->{$_}"\n\n) unless (lookup_field($_))[0];
};
# if we've valid driver, let's offer to configure it, else hide buttons
@@ -330,7 +336,7 @@ foreach (@classes) {
$_->{$field} = '/dev/'.$_->{$field} if $_->{$field};
}
$tree_model->append_set($parent_iter, [ 1 => $custom_id, 2 => $index++ ]);
- push @data, $_;
+ push @data, [ $_, $Ident ];
push @configurators, $configurator;
}
$tree->expand_row($tree_model->get_path($parent_iter), 1) unless $title eq N("Unknown/Others");
@@ -381,6 +387,12 @@ sub strip_first_underscore {
join '', map { s/_//; $_ } @_;
}
+sub lookup_field {
+ my ($field) = @_;
+ my $class = find { defined $fields{$_} && defined $fields{$_}{$field} } ($current_class, 'generic');
+ $fields{$class}{$field};
+}
+
sub rename_field {
my ($dev, $field, $new_field) = @_;
if ($dev->{$field}) {