From ff9b44a245ff217232d0feb8eebac9df5d1dd5f9 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 3 Sep 2007 17:01:26 +0000 Subject: - nicer "choose desktop" step with icons --- perl-install/install/steps_gtk.pm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'perl-install/install/steps_gtk.pm') 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) = @_; -- cgit v1.2.1