summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install/NEWS1
-rw-r--r--perl-install/install/pixmaps/desktop-GNOME.pngbin0 -> 977 bytes
-rw-r--r--perl-install/install/pixmaps/desktop-KDE.pngbin0 -> 4219 bytes
-rw-r--r--perl-install/install/steps_gtk.pm36
-rw-r--r--perl-install/install/steps_interactive.pm28
5 files changed, 55 insertions, 10 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index d93b00731..53663b5f4 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -2,6 +2,7 @@
- do not set relatime option for mounting nfs
- nicely adjust mtime of fontconfig cache files
- steps window: do not underline categories (Installation, Configuration)
+- nicer "choose desktop" step with icons
Version 10.4.183 - 31 August 2007, by Pascal "Pixel" Rigaux
diff --git a/perl-install/install/pixmaps/desktop-GNOME.png b/perl-install/install/pixmaps/desktop-GNOME.png
new file mode 100644
index 000000000..2c5184a01
--- /dev/null
+++ b/perl-install/install/pixmaps/desktop-GNOME.png
Binary files differ
diff --git a/perl-install/install/pixmaps/desktop-KDE.png b/perl-install/install/pixmaps/desktop-KDE.png
new file mode 100644
index 000000000..ab83046f0
--- /dev/null
+++ b/perl-install/install/pixmaps/desktop-KDE.png
Binary files differ
diff --git a/perl-install/install/steps_gtk.pm b/perl-install/install/steps_gtk.pm
index ead120918..76f0a2fb4 100644
--- a/perl-install/install/steps_gtk.pm
+++ b/perl-install/install/steps_gtk.pm
@@ -213,6 +213,42 @@ sub selectMouse {
}
}
+sub reallyChooseDesktop {
+ my ($o, $title, $message, $choices) = @_;
+
+ my $w = ugtk2->new($title);
+
+ my $sizegrp = Gtk2::SizeGroup->new('horizontal');
+ my $choice = $choices->[0];
+ my $prev;
+ my @l = map {
+ my $val = $_;
+ $prev = gtknew('RadioButton', text => $val->[1],
+ toggled => sub { $choice = $val if $_[0]->get_active },
+ $prev ? (group => $prev->get_group) : ());
+ $prev->signal_connect(key_press_event => sub {
+ my (undef, $event) = @_;
+ if (!$event || ($event->keyval & 0x7f) == 0xd) {
+ Gtk2->main_quit;
+ }
+ });
+ gtknew('HBox', border_width => 15, spacing => 10, children => [
+ 0, gtknew('Image', file => "desktop-$val->[0]", size_group => $sizegrp),
+ 1, $prev,
+ ]);
+ } @$choices;
+
+ ugtk2::gtkadd($w->{window},
+ gtknew('VBox', children => [
+ 0, gtknew('Label', text => $message),
+ (map { (1, $_) } @l),
+ 0, $w->create_okcancel(N("Next"), undef),
+ ]));
+ $w->main;
+
+ $choice;
+}
+
sub reallyChooseGroups {
my ($o, $size_to_display, $individual, $_compssUsers) = @_;
diff --git a/perl-install/install/steps_interactive.pm b/perl-install/install/steps_interactive.pm
index f7323c2e7..3783bc792 100644
--- a/perl-install/install/steps_interactive.pm
+++ b/perl-install/install/steps_interactive.pm
@@ -409,19 +409,27 @@ The format is the same as auto_install generated files."),
sub _chooseDesktop {
my ($o, $rpmsrate_flags_chosen, $chooseGroups) = @_;
- my @l = (
- N_("Install Mandriva KDE Desktop"),
- N_("Install Mandriva GNOME Desktop"),
- N_("Custom install"),
+ my @l = group_by2(
+ KDE => N("Install Mandriva KDE Desktop"),
+ GNOME => N("Install Mandriva GNOME Desktop"),
+ Custom => N("Custom install"),
);
+ my $title = N("Package Group Selection");
+ my $message = N("You can choose your workstation desktop profile: KDE, GNOME or Custom");
my $choice;
- $o->ask_from_({}, [
- { val => \$choice, list => \@l, type => 'list', format => \&translate },
- ]);
- log::l("chosen Desktop: $choice");
- if (my ($desktop) = $choice =~ /(KDE|GNOME)/) {
- my ($want, $dontwant) = ($desktop, grep { $desktop ne $_ } 'KDE', 'GNOME');
+ if ($o->isa('interactive::gtk') && 0) {
+ $choice = install::steps_gtk::reallyChooseDesktop($o, $title, $message, \@l);
+ } else {
+ $o->ask_from_({ title => $title, message => $message }, [
+ { val => \$choice, list => \@l, type => 'list', format => sub { $_[0][1] } },
+ ]);
+ }
+ my $desktop = $choice->[0];
+ log::l("chosen Desktop: $desktop");
+ my @desktops = ('KDE', 'GNOME');
+ if (member($desktop, @desktops)) {
+ my ($want, $dontwant) = ($desktop, grep { $desktop ne $_ } @desktops);
$rpmsrate_flags_chosen->{"CAT_$want"} = 1;
$rpmsrate_flags_chosen->{"CAT_$dontwant"} = 0;
my @flags = map_each { if_($::b, $::a) } %$rpmsrate_flags_chosen;