summaryrefslogtreecommitdiffstats
path: root/perl-install/install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/install')
-rw-r--r--perl-install/install/steps_gtk.pm49
-rw-r--r--perl-install/install/steps_interactive.pm29
2 files changed, 26 insertions, 52 deletions
diff --git a/perl-install/install/steps_gtk.pm b/perl-install/install/steps_gtk.pm
index eeaa3b42f..1e715d0a8 100644
--- a/perl-install/install/steps_gtk.pm
+++ b/perl-install/install/steps_gtk.pm
@@ -243,37 +243,24 @@ sub setPackages {
}
sub reallyChooseDesktop {
- my ($o, $title, $message, $choices, $default_choice) = @_;
+ my ($o, $title, $message, $choices, $choice) = @_;
+
my $w = ugtk2->new($title);
- my %choice;
- my $n;
my %tips = (
KDE => N("Install %s KDE Desktop", N("Mageia")),
GNOME => N("Install %s GNOME Desktop", N("Mageia")),
- MATE => N("Install %s MATE Desktop", N("Mageia")),
- XFCE => N("Install %s XFCE Desktop", N("Mageia")),
- LXDE => N("Install %s LXDE Desktop", N("Mageia")),
- RAZOR => N("Install %s RazorQT Desktop", N("Mageia")),
- E17 => N("Install %s E17 Desktop", N("Mageia")),
Custom => N("Custom install"),
);
my $prev;
- my $default_set = 0;
my @l = map {
my $val = $_;
- my $sensitive = grep { $_->[0] =~ /$val->[0]/ or $val->[0] eq 'Custom' } map { $_->{flags} } grep { $_->{path} eq 'Graphical Environment' } map { @$_ } $o->{compssUsers};
- $default_set++ if $sensitive;
- $choice{$val->[0]} = '0';
- $prev = gtknew('CheckButton',
- text => $val->[1],
+ $prev = gtknew('RadioButton', child =>
+ gtknew('Label', text => $val->[1]),
tip => $tips{$val->[0]},
- sensitive => $sensitive ? '1' : '0',
- toggled => sub { $choice{$val->[0]} = $_[0]->get_active },
- active => $default_set == 1 && $sensitive ? ($choice{$val->[0]} = '1') : '0',
- );
-
-
+ toggled => sub { $choice = $val if $_[0]->get_active },
+ active => $choice == $val,
+ $prev ? (group => $prev->get_group) : ());
$prev->signal_connect(key_press_event => sub {
my (undef, $event) = @_;
if (!$event || ($event->keyval & 0x7f) == 0xd) {
@@ -281,16 +268,11 @@ sub reallyChooseDesktop {
}
});
my $img = gtksignal_connect(
- gtkadd(Gtk2::EventBox->new, gtknew('Image', sensitive => $sensitive ? '1' : '0', file => "desktop-$val->[0]")),
+ gtkadd(Gtk2::EventBox->new, gtknew('Image', file => "desktop-$val->[0]")),
'button-press-event' => sub {
my %title = (
KDE => N("KDE Desktop"),
GNOME => N("GNOME Desktop"),
- MATE => N("MATE Desktop"),
- XFCE => N("XFCE Desktop"),
- LXDE => N("LXDE Desktop"),
- RAZOR => N("RazorQT Desktop"),
- E17 => N("E17 Desktop"),
Custom => N("Custom Desktop"),
);
@@ -313,26 +295,19 @@ sub reallyChooseDesktop {
$wp->{real_window}->show_all;
$wp->main;
});
- gtknew('VBox', border_width => 5, spacing => 10, children_tight => [
+ gtknew('VBox', border_width => 15, spacing => 10, children_tight => [
$img,
$prev,
]);
} @$choices;
-my @l1 = grep { !($n++ % 2) } @l;
-my @l2 = grep { !(++$n % 2) } @l;
+
ugtk2::gtkadd($w->{window},
gtknew('VBox', children => [
0, gtknew('Title2',
# workaround infamous 6 years old gnome bug #101968:
width => mygtk2::get_label_width(), label => $message . ' ' .
N("Click on images in order to see a bigger preview")),
- 1, gtknew('ScrolledWindow', h_policy => 'never', child =>
- gtknew('VBox', children => [
- 1, gtknew('HButtonBox', spacing => 5, layout => 'edge', children_loose => \@l1),
- 1, gtknew('HButtonBox', spacing => 5, layout => 'edge', children_loose => \@l2),
- ]
- ),
- ),
+ 1, gtknew('HButtonBox', children_loose => \@l),
0, $w->create_okcancel(N("Next"), undef, '',
[ gtknew('Install_Button', text => N("Help"),
clicked => sub {
@@ -341,7 +316,7 @@ my @l2 = grep { !(++$n % 2) } @l;
]));
$w->main;
- %choice;
+ $choice;
}
sub reallyChooseGroups {
diff --git a/perl-install/install/steps_interactive.pm b/perl-install/install/steps_interactive.pm
index e458c1648..1bfea5cd0 100644
--- a/perl-install/install/steps_interactive.pm
+++ b/perl-install/install/steps_interactive.pm
@@ -482,35 +482,34 @@ sub _chooseDesktop {
my @l = group_by2(
KDE => N("KDE"),
GNOME => N("GNOME"),
- MATE => N("MATE"),
- XFCE => N("XFCE"),
- LXDE => N("LXDE"),
- RAZOR => N("RAZOR"),
- E17 => N("E17"),
Custom => N("Custom"),
);
-
my $title = N("Desktop Selection");
- my $message = N("You can choose your workstation desktop profile.\nSelect 'Custom' for multiple desktops or package selection.");
+ my $message = N("You can choose your workstation desktop profile.");
my $default_choice = (find { $rpmsrate_flags_chosen->{"CAT_" . $_->[0]} } @l) || $l[0];
- my $choose = $default_choice;
- my %choice;
+ my $choice = $default_choice;
if ($o->isa('interactive::gtk')) {
# perl_checker: require install::steps_gtk
- %choice = install::steps_gtk::reallyChooseDesktop($o, $title, $message, \@l, $default_choice);
+ $choice = install::steps_gtk::reallyChooseDesktop($o, $title, $message, \@l, $default_choice);
} else {
$o->ask_from_({ title => $title, message => $message }, [
- { val => \$choose, list => \@l, type => 'list', format => sub { $_[0][1] } },
+ { val => \$choice, list => \@l, type => 'list', format => sub { $_[0][1] } },
]);
}
-
- my @want = map { if ($_ eq 'Custom') {
- $$chooseGroups = $choice{$_} } else {
- $rpmsrate_flags_chosen->{"CAT_$_"} = $choice{$_} } } keys %choice;
+ 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;
log::l("flags ", join(' ', sort @flags));
install::any::unselectMostPackages($o);
+ } else {
+ $$chooseGroups = 1;
+ }
}
sub chooseGroups {