summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfigurator.pm
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2001-02-28 07:39:25 +0000
committerdamien <damien@mandriva.com>2001-02-28 07:39:25 +0000
commit3623a47ba356b47a389e28251e4c217b54b98781 (patch)
treee05303798f5b8fa93f74649780425badd48df7c5 /perl-install/Xconfigurator.pm
parente80f9075577d0ad9861adc53e9d9100e31181a09 (diff)
downloaddrakx-3623a47ba356b47a389e28251e4c217b54b98781.tar
drakx-3623a47ba356b47a389e28251e4c217b54b98781.tar.gz
drakx-3623a47ba356b47a389e28251e4c217b54b98781.tar.bz2
drakx-3623a47ba356b47a389e28251e4c217b54b98781.tar.xz
drakx-3623a47ba356b47a389e28251e4c217b54b98781.zip
new look.
Diffstat (limited to 'perl-install/Xconfigurator.pm')
-rw-r--r--perl-install/Xconfigurator.pm44
1 files changed, 35 insertions, 9 deletions
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm
index 38452f0a3..ca95fc335 100644
--- a/perl-install/Xconfigurator.pm
+++ b/perl-install/Xconfigurator.pm
@@ -11,6 +11,8 @@ use run_program;
use Xconfigurator_consts;
use any;
use modules;
+use Data::Dumper;
+use my_gtk qw(:helpers :wrappers);
my $tmpconfig = "/tmp/Xconfig";
@@ -576,7 +578,7 @@ sub chooseResolutionsGtk($$;$) {
my $W = my_gtk->new(_("Resolution"));
my %txt2depth = reverse %depths;
- my ($r, $depth_combo, %w2depth, %w2h, %w2widget);
+ my ($r, $depth_combo, %w2depth, %w2h, %w2widget, $pix_monitor, $pix_colors, $w2_combo);
my $best_w;
while (my ($depth, $res) = each %{$card->{depth}}) {
@@ -593,6 +595,7 @@ sub chooseResolutionsGtk($$;$) {
#- the set function is usefull to toggle the CheckButton with the callback being ignored
my $ignore;
+ my $no_human; # is the w2_combo->entry changed by a human?
my $set = sub { $ignore = 1; $_[0]->set_active(1); $ignore = 0; };
while (my ($w, $h) = each %w2h) {
@@ -602,6 +605,8 @@ sub chooseResolutionsGtk($$;$) {
$r->signal_connect("clicked" => sub {
$ignore and return;
$chosen_w = $w;
+ $no_human=1;
+ $w2_combo->entry->set_text($w . "x" . $w2h{$w});
unless (member($chosen_depth, @{$w2depth{$w}})) {
$chosen_depth = max(@{$w2depth{$w}});
&$set_depth();
@@ -614,13 +619,21 @@ sub chooseResolutionsGtk($$;$) {
_("Graphic card: %s", $card->{type}) :
_("XFree86 server: %s", $card->{server})) . ")"
),
- 1, gtkpack(new Gtk::HBox(0,20),
- $depth_combo = new Gtk::Combo,
- gtkpack_(new Gtk::VBox(0,0),
- map {; 0, $w2widget{$_} } ikeys(%w2widget),
- ),
+ 1, gtkpack2(new Gtk::VBox(0,0),
+ gtkpack2__(new Gtk::VBox(0, $::isEmbedded ? 15 : 0),
+ if_($::isEmbedded, $pix_monitor = gtkpng ("monitor")),
+ if_(!$::isEmbedded, map {$w2widget{$_} } ikeys(%w2widget)),
+ gtkpack2(new Gtk::HBox(0,0),
+ create_packtable({ col_spacings => 5, row_spacings => 5},
+ [ if_($::isEmbedded,$w2_combo = new Gtk::Combo) , new Gtk::Label("")],
+ [ $depth_combo = new Gtk::Combo, gtkadd(gtkset_shadow_type(new Gtk::Frame, 'etched_out'), $pix_colors = gtkpng ("colors")) ],
+ ),
+ ),
+ ),
),
0, gtkadd($W->create_okcancel,
+ $::isEmbedded ?
+ gtksignal_connect(new Gtk::Button(_("Expert Mode")), clicked => sub { system ("XFdrake --expert --testing"); }) :
gtksignal_connect(new Gtk::Button(_("Show all")), clicked => sub { $W->{retval} = 1; $chosen_w = 0; Gtk->main_quit })),
));
$depth_combo->disable_activate;
@@ -628,10 +641,23 @@ sub chooseResolutionsGtk($$;$) {
$depth_combo->entry->set_editable(0);
$depth_combo->set_popdown_strings(map { translate($depths{$_}) } ikeys(%{$card->{depth}}));
$depth_combo->entry->signal_connect(changed => sub {
- $chosen_depth = $txt2depth{untranslate($depth_combo->entry->get_text, keys %txt2depth)};
- my $w = $card->{depth}{$chosen_depth}[0][0];
- $chosen_w > $w and &$set($w2widget{$chosen_w = $w});
+ $chosen_depth = $txt2depth{untranslate($depth_combo->entry->get_text, keys %txt2depth)};
+ my $w = $card->{depth}{$chosen_depth}[0][0];
+ $chosen_w > $w and &$set($w2widget{$chosen_w = $w});
+ $pix_colors->set(gtkcreate_png("colors8.png")) if $chosen_depth >= 8;
+ $pix_colors->set(gtkcreate_png("colors16.png")) if $chosen_depth >= 15;
+ $pix_colors->set(gtkcreate_png("colors.png")) if $chosen_depth >=24;
});
+ if ($::isEmbedded) {
+ $w2_combo->disable_activate;
+ $w2_combo->set_use_arrows_always(1);
+ $w2_combo->entry->set_editable(0);
+ $w2_combo->set_popdown_strings(map { $_ . "x" . $w2h{$_} } keys %w2h);
+ $w2_combo->entry->signal_connect(changed => sub {
+ ($chosen_w) = $w2_combo->entry->get_text =~ /([^x]*)x.*/;
+ $no_human ? $no_human=0 : $w2widget{$chosen_w}->set_active(1);
+ });
+ }
&$set_depth();
$W->{ok}->grab_focus;
:42 +0000'>2003-05-191-1/+1 * updated Spanish translationsFabián Mandelbaum2003-05-191-221/+176 * simplifyThierry Vignaud2003-05-191-5/+2 * do not drop return values from regexp but use them to ensure we do notThierry Vignaud2003-05-191-1/+1 * move expert stuff under the "advanced" button like in all other drakx/drakxto...Thierry Vignaud2003-05-191-7/+6 * %langs: first column is supposed to be localized in englishThierry Vignaud2003-05-191-3/+3 * last 9.1-38mdk bitsThierry Vignaud2003-05-191-1/+7 * update perl-gtk0 users list (drakcronat being ported to gtk+2)Thierry Vignaud2003-05-191-1/+4 * first bits of 9.1-38mdkThierry Vignaud2003-05-161-2/+5 * updated pot filePablo Saratxaga2003-05-16