diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2003-02-14 13:12:38 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2003-02-14 13:12:38 +0000 |
commit | df4ba1f5dfad7c66ceeec37e5fdfb88ec12776b9 (patch) | |
tree | 5e899a44b51bee90b8e61bbf3f9a10325e0e2f9e /perl-install/install_gtk.pm | |
parent | 9634d884835a471353402b8870116349c206be21 (diff) | |
download | drakx-backup-do-not-use-df4ba1f5dfad7c66ceeec37e5fdfb88ec12776b9.tar drakx-backup-do-not-use-df4ba1f5dfad7c66ceeec37e5fdfb88ec12776b9.tar.gz drakx-backup-do-not-use-df4ba1f5dfad7c66ceeec37e5fdfb88ec12776b9.tar.bz2 drakx-backup-do-not-use-df4ba1f5dfad7c66ceeec37e5fdfb88ec12776b9.tar.xz drakx-backup-do-not-use-df4ba1f5dfad7c66ceeec37e5fdfb88ec12776b9.zip |
- update steps window to 9.1 theme (blue/white bullets)
- don't destroy steps window between each step => better looking
Diffstat (limited to 'perl-install/install_gtk.pm')
-rw-r--r-- | perl-install/install_gtk.pm | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/perl-install/install_gtk.pm b/perl-install/install_gtk.pm index bebf9eb6c..c211b6ea4 100644 --- a/perl-install/install_gtk.pm +++ b/perl-install/install_gtk.pm @@ -110,35 +110,59 @@ sub create_help_window { } #------------------------------------------------------------------------------ +my %steps; sub create_steps_window { my ($o) = @_; return if $::stepswidth == 0; - $o->{steps_window}->destroy if $o->{steps_window}; - my $w = bless {}, 'ugtk2'; $w->{rwindow} = $w->{window} = Gtk2::Window->new('toplevel'); - $w->{rwindow}->set_uposition(0, 100); + $w->{rwindow}->set_uposition(8, 160); $w->{rwindow}->set_size_request($::stepswidth, $::stepsheight); $w->{rwindow}->set_name('Steps'); $w->{rwindow}->set_title('skip'); - my @l = ('', '', N("System installation")); - my $s; + $steps{$_} = gtkcreate_pixbuf("steps_$_") foreach qw(on off); + + gtkpack__(my $vb = Gtk2::VBox->new(0, 3), $steps{inst} = Gtk2::Label->new(N("System installation")), ''); foreach (grep { !eval $o->{steps}{$_}{hidden} } @{$o->{orderedSteps}}) { - if ($_ eq 'setRootPassword') { - push @l, $s, N("System configuration"); - $s = ''; - } - $s .= ($o->{steps}{$_}{done} ? '+' : '-') . ' ' . translate($o->{steps}{$_}{text}) . "\n"; + $_ eq 'setRootPassword' + and gtkpack__($vb, '', '', $steps{conf} = Gtk2::Label->new(N("System configuration")), ''); + $steps{steps}{$_} = { img => gtkcreate_img('steps_off.png'), + txt => Gtk2::Label->new($o->{steps}{$_}{text}) }; + gtkpack__($vb, gtkpack__(Gtk2::HBox->new(0, 7), $steps{steps}{$_}{img}, $steps{steps}{$_}{txt})); + } - gtkadd($w->{window}, gtkpack__(Gtk2::VBox->new(0,15), @l, $s)); + gtkadd($w->{window}, $vb); $w->show; $o->{steps_window} = $w; } +sub update_steps_position { + my ($o) = @_; + return if !$steps{steps}; + my $last_step; + foreach (@{$o->{orderedSteps}}) { + exists $steps{steps}{$_} or next; + if ($o->{steps}{$_}{entered} && !$o->{steps}{$_}{done}) { + $steps{steps}{$_}{img}->set_from_pixbuf($steps{on}); + $last_step and $steps{steps}{$last_step}{img}->set_from_pixbuf($steps{off}); + return; + } + $last_step = $_; + } +} + +sub update_steps_labels { + my ($o) = @_; + return if !$steps{steps}; + $steps{inst}->set_label(N("System installation")); + $steps{conf}->set_label(N("System configuration")); + $steps{steps}{$_}{txt}->set_label(translate($o->{steps}{$_}{text})) foreach keys %{$steps{steps}}; +} + #------------------------------------------------------------------------------ sub create_logo_window { my ($o) = @_; |