summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-02-14 13:12:38 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-02-14 13:12:38 +0000
commitdf4ba1f5dfad7c66ceeec37e5fdfb88ec12776b9 (patch)
tree5e899a44b51bee90b8e61bbf3f9a10325e0e2f9e /perl-install
parent9634d884835a471353402b8870116349c206be21 (diff)
downloaddrakx-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')
-rw-r--r--perl-install/install_gtk.pm46
-rw-r--r--perl-install/install_steps_gtk.pm5
-rw-r--r--perl-install/pixmaps/steps_off.pngbin0 -> 401 bytes
-rw-r--r--perl-install/pixmaps/steps_on.pngbin0 -> 372 bytes
4 files changed, 38 insertions, 13 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) = @_;
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 28da2e56a..34043ec7d 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -124,6 +124,7 @@ sub new($$) {
install_gtk::init_sizes();
install_gtk::install_theme($o);
install_gtk::create_logo_window($o);
+ install_gtk::create_steps_window($o);
$ugtk2::force_center = [ $::rootwidth - $::windowwidth, $::logoheight, $::windowwidth, $::windowheight ];
@@ -137,7 +138,7 @@ sub enteringStep {
printf "Entering step `%s'\n", $o->{steps}{$step}{text};
$o->SUPER::enteringStep($step);
- install_gtk::create_steps_window($o);
+ install_gtk::update_steps_position($o);
# install_gtk::create_help_window($o); #- HACK: without this it doesn't work (reaches step doPartitionDisks then fail)
}
sub leavingStep {
@@ -149,7 +150,7 @@ sub leavingStep {
sub charsetChanged {
my ($o) = @_;
Gtk2->set_locale;
- install_gtk::create_steps_window($o);
+ install_gtk::update_steps_labels($o);
}
#-######################################################################################
diff --git a/perl-install/pixmaps/steps_off.png b/perl-install/pixmaps/steps_off.png
new file mode 100644
index 000000000..66d4235a9
--- /dev/null
+++ b/perl-install/pixmaps/steps_off.png
Binary files differ
diff --git a/perl-install/pixmaps/steps_on.png b/perl-install/pixmaps/steps_on.png
new file mode 100644
index 000000000..21872e396
--- /dev/null
+++ b/perl-install/pixmaps/steps_on.png
Binary files differ