From 24f8b57f04273cbfab21ba00b01c828a91506b9b Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 23 Feb 2000 13:18:48 +0000 Subject: no_comment --- perl-install/ChangeLog | 10 ++++++++ perl-install/Xconfigurator.pm | 7 ++---- perl-install/commands.pm | 2 +- perl-install/install2.pm | 2 +- perl-install/install_steps_gtk.pm | 41 ++++++++++++++------------------- perl-install/interactive_gtk.pm | 3 +-- perl-install/my_gtk.pm | 2 +- perl-install/share/themes-blackwhite.rc | 1 + perl-install/share/themes-blue.rc | 1 + perl-install/share/themes-marble3d.rc | 1 + perl-install/share/themes-savane.rc | 1 + 11 files changed, 37 insertions(+), 34 deletions(-) diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog index a9f87b068..893caaae4 100644 --- a/perl-install/ChangeLog +++ b/perl-install/ChangeLog @@ -1,3 +1,13 @@ +2000-02-23 Pixel + + * my_gtk.pm and interactive_gtk: resize the list and tree based on + root window size + + * install_steps_gtk: $width and $height goes $::rootwidth and + $::rootheight, also other dimensions goes global (main::) + + * commands.pm (strings): replace the typo \{$n,} by {$n,} + 2000-02-23 François Pons * build_archive, extract_archive: changed format of TOC to speed diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index 8b2089120..8a567234c 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -13,7 +13,7 @@ use my_gtk qw(:wrappers); my $tmpconfig = "/tmp/Xconfig"; -my ($prefix, %cards, %monitors); +my ($prefix, %monitors); 1; @@ -31,13 +31,10 @@ sub setVirtual($) { sub readCardsDB { my ($file) = @_; - my ($card); - -# %cards and return; + my ($card, %cards); local *F; open F, $file or die "file $file not found"; - print "readCardsDB\n"; my ($lineno, $cmd, $val) = 0; my $fs = { diff --git a/perl-install/commands.pm b/perl-install/commands.pm index 8fd032fa3..ea09c200a 100644 --- a/perl-install/commands.pm +++ b/perl-install/commands.pm @@ -339,7 +339,7 @@ sub strings { $h and die "usage: strings [-o] [-n min-length] []\n"; $n = $n ? shift : 4; $/ = "\0"; @ARGV = @_; my $l = 0; while (<>) { - while (/[$printable_chars]\{$n,}/og) { + while (/[$printable_chars]{$n,}/og) { printf "%07d ", ($l + length $') if $o; print "$&\n" ; } diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 5a43da7c3..cfb40c913 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -430,7 +430,7 @@ sub configureTimezone { $o->timeConfig($f, $clicked); } #------------------------------------------------------------------------------ -sub configureServices { $o->servicesConfig } +sub configureServices { $::expert and $o->servicesConfig } #------------------------------------------------------------------------------ sub configurePrinter { $o->printerConfig } #------------------------------------------------------------------------------ diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index b3564c3d6..b07ccc1e7 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -34,13 +34,6 @@ my $w_help; my $itemsNB = 1; my (@background1, @background2); -#- initialised in function init_sizes -my ($width, $height); -my ($stepswidth, $stepsheight); -my ($logowidth, $logoheight); -my ($helpwidth, $helpheight); -my ($windowwidth, $windowheight); - my @themes_vga16 = qw(blue blackwhite savane); my @themes = qw(DarkMarble marble3d blueHeart); @@ -231,7 +224,7 @@ sub new($$) { install_theme($o); create_logo_window($o); - $my_gtk::force_center = [ $width - $windowwidth, $logoheight, $windowwidth, $windowheight ]; + $my_gtk::force_center = [ $::rootwidth - $::windowwidth, $::logoheight, $::windowwidth, $::windowheight ]; (bless {}, ref $type || $type)->SUPER::new($o); } @@ -524,7 +517,7 @@ sub choosePackagesTree { #- keep show more or less [ _("Show more") => sub { &$show_add(-10) } ], ) )); - $w->{window}->set_usize(map { $_ - 2 * $my_gtk::border - 4 } $windowwidth, $windowheight); + $w->{window}->set_usize(map { $_ - 2 * $my_gtk::border - 4 } $::windowwidth, $::windowheight); $w->show; &$show_add(0); &$update(); @@ -539,7 +532,7 @@ sub installPackages { my ($current_total_size, $last_size, $nb, $total_size, $start_time, $last_dtime, $trans_progress_total); my $w = my_gtk->new(_("Installing"), grab => 1); - $w->{window}->set_usize($windowwidth * 0.8, $windowheight * 0.5); + $w->{window}->set_usize($::windowwidth * 0.8, $::windowheight * 0.5); my $text = new Gtk::Label; my ($msg, $msg_time_remaining, $msg_time_total) = map { new Gtk::Label($_) } '', (_("Estimating")) x 2; my ($progress, $progress_total) = map { new Gtk::ProgressBar } (1..2); @@ -603,7 +596,7 @@ _("There was an error ordering packages:"), $1, _("Go on anyway?") ], 1) and ret #------------------------------------------------------------------------------ sub load_rc($) { - if (my ($f) = grep { -r $_ } map { "$_/$_[0].rc" } (".", "/usr/share", dirname(__FILE__))) { + if (my ($f) = grep { -r $_ } map { "$_/$_[0].rc" } ("share", "/usr/share", dirname(__FILE__))) { Gtk::Rc->parse($f); foreach (cat_($f)) { if (/style\s+"background"/ .. /^\s*$/) { @@ -646,8 +639,8 @@ widget "*Steps*" style "steps" #------------------------------------------------------------------------------ sub create_big_help { - my $w = my_gtk->new('', grab => 1, force_position => [ $stepswidth, $logoheight ]); - $w->{rwindow}->set_usize($logowidth, $height - $logoheight); + my $w = my_gtk->new('', grab => 1, force_position => [ $::stepswidth, $::logoheight ]); + $w->{rwindow}->set_usize($::logowidth, $::rootheight - $::logoheight); gtkadd($w->{window}, gtkpack_(new Gtk::VBox(0,0), 1, createScrolledWindow(gtktext_insert(new Gtk::Text, @@ -669,8 +662,8 @@ sub create_help_window { } else { $w = bless {}, 'my_gtk'; $w->{rwindow} = $w->{window} = new Gtk::Window; - $w->{rwindow}->set_uposition($width - $helpwidth, $height - $helpheight); - $w->{rwindow}->set_usize($helpwidth, $helpheight); + $w->{rwindow}->set_uposition($::rootwidth - $::helpwidth, $::rootheight - $::helpheight); + $w->{rwindow}->set_usize($::helpwidth, $::helpheight); $w->sync; } @@ -725,7 +718,7 @@ sub create_steps_window { my $w = bless {}, 'my_gtk'; $w->{rwindow} = $w->{window} = new Gtk::Window; $w->{rwindow}->set_uposition(0, 0); - $w->{rwindow}->set_usize($stepswidth, $stepsheight); + $w->{rwindow}->set_usize($::stepswidth, $::stepsheight); $w->{rwindow}->set_name("Steps"); $w->{rwindow}->set_events('button_press_mask'); $w->{rwindow}->signal_connect(button_press_event => sub { @@ -780,8 +773,8 @@ sub create_logo_window() { gtkdestroy($o->{logo_window}); my $w = bless {}, 'my_gtk'; $w->{rwindow} = $w->{window} = new Gtk::Window; - $w->{rwindow}->set_uposition($stepswidth, 0); - $w->{rwindow}->set_usize($logowidth, $logoheight); + $w->{rwindow}->set_uposition($::stepswidth, 0); + $w->{rwindow}->set_usize($::logowidth, $::logoheight); $w->{rwindow}->set_name("background"); $w->show; my $file = "logo-mandrake.xpm"; @@ -795,12 +788,12 @@ sub create_logo_window() { } sub init_sizes() { -# ($height, $width) = (480, 640); - ($height, $width) = my_gtk::gtkroot()->get_size; - ($stepswidth, $stepsheight) = (140, $height); - ($logowidth, $logoheight) = ($width - $stepswidth, 40); - ($helpwidth, $helpheight) = ($width - $stepswidth, 100); - ($windowwidth, $windowheight) = ($width - $stepswidth, $height - $helpheight - $logoheight); + ($::rootheight, $::rootwidth) = (480, 640); + ($::rootheight, $::rootwidth) = my_gtk::gtkroot()->get_size; + ($::stepswidth, $::stepsheight) = (140, $::rootheight); + ($::logowidth, $::logoheight) = ($::rootwidth - $::stepswidth, 40); + ($::helpwidth, $::helpheight) = ($::rootwidth - $::stepswidth, 100); + ($::windowwidth, $::windowheight) = ($::rootwidth - $::stepswidth, $::rootheight - $::helpheight - $::logoheight); } #------------------------------------------------------------------------------ diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm index 6b9d89fb9..6e5e8eb4f 100644 --- a/perl-install/interactive_gtk.pm +++ b/perl-install/interactive_gtk.pm @@ -98,13 +98,12 @@ sub ask_from_treelistW { $w->{retval} = join $separator, @l; 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($w->create_box_with_title(@$messages), gtkpack_(new Gtk::VBox(0,7), - 1, gtkset_usize(createScrolledWindow($tree), 300, 350), + 1, gtkset_usize(createScrolledWindow($tree), 300, min(400, $::windowheight - 60)), 0, $w->create_okcancel))); $tree->set_column_auto_resize(0, 1); $tree->set_selection_mode('browse'); diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm index 97030b29d..9cf9a7551 100644 --- a/perl-install/my_gtk.pm +++ b/perl-install/my_gtk.pm @@ -513,7 +513,7 @@ sub _ask_from_list { gtkadd($o->{window}, gtkpack($o->create_box_with_title(@$messages), gtkpack_(new Gtk::VBox(0,7), - 1, @$l > 15 ? gtkset_usize(createScrolledWindow($list), 200, 280) : $list, + 1, @$l > 15 ? gtkset_usize(createScrolledWindow($list), 200, min(400, $::windowheight - 60)) : $list, @okcancel || !ref $title ? (0, create_okcancel($o, @okcancel)) : ()) )); $o->show; #- otherwise the moveto is not done diff --git a/perl-install/share/themes-blackwhite.rc b/perl-install/share/themes-blackwhite.rc index 76ab4f800..ece77fe1d 100644 --- a/perl-install/share/themes-blackwhite.rc +++ b/perl-install/share/themes-blackwhite.rc @@ -56,6 +56,7 @@ widget_class "*" style "any" widget_class "*GtkSpin*" style "entry" widget_class "*GtkEntry*" style "entry" widget_class "*Gtk*List*" style "entry" +widget_class "*GtkCTree*" style "entry" widget_class "*GtkNotebook*" style "notebook" widget "*GtkButton*" style "button" widget "*background*" style "background" diff --git a/perl-install/share/themes-blue.rc b/perl-install/share/themes-blue.rc index bc8b2f4c0..3cc921861 100644 --- a/perl-install/share/themes-blue.rc +++ b/perl-install/share/themes-blue.rc @@ -56,6 +56,7 @@ widget_class "*" style "any" widget_class "*GtkSpin*" style "entry" widget_class "*GtkEntry*" style "entry" widget_class "*Gtk*List*" style "entry" +widget_class "*GtkCTree*" style "entry" widget_class "*GtkNotebook*" style "notebook" widget "*GtkButton*" style "button" widget "*background*" style "background" diff --git a/perl-install/share/themes-marble3d.rc b/perl-install/share/themes-marble3d.rc index b09e4eba9..32c11b025 100644 --- a/perl-install/share/themes-marble3d.rc +++ b/perl-install/share/themes-marble3d.rc @@ -194,6 +194,7 @@ widget_class "*" style "any" widget_class "*GtkSpin*" style "entry" widget_class "*GtkEntry*" style "entry" widget_class "*Gtk*List*" style "entry" +widget_class "*GtkCTree*" style "entry" widget_class "*GtkNotebook*" style "notebook" widget "*GtkButton" style "button" widget "*background*" style "background" diff --git a/perl-install/share/themes-savane.rc b/perl-install/share/themes-savane.rc index 4d903660e..d3c09d7f4 100644 --- a/perl-install/share/themes-savane.rc +++ b/perl-install/share/themes-savane.rc @@ -56,6 +56,7 @@ widget_class "*" style "any" widget_class "*GtkSpin*" style "entry" widget_class "*GtkEntry*" style "entry" widget_class "*Gtk*List*" style "entry" +widget_class "*GtkCTree*" style "entry" widget_class "*GtkNotebook*" style "notebook" widget "*GtkButton*" style "button" widget "*background*" style "background" -- cgit v1.2.1