diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-09-03 17:01:26 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-09-03 17:01:26 +0000 |
commit | ff9b44a245ff217232d0feb8eebac9df5d1dd5f9 (patch) | |
tree | c961c6da4a2b12e42796649570524fa536054d51 /perl-install/install/steps_gtk.pm | |
parent | 62135b5ce9b002b7d6b676d0183b985e1c23900c (diff) | |
download | drakx-ff9b44a245ff217232d0feb8eebac9df5d1dd5f9.tar drakx-ff9b44a245ff217232d0feb8eebac9df5d1dd5f9.tar.gz drakx-ff9b44a245ff217232d0feb8eebac9df5d1dd5f9.tar.bz2 drakx-ff9b44a245ff217232d0feb8eebac9df5d1dd5f9.tar.xz drakx-ff9b44a245ff217232d0feb8eebac9df5d1dd5f9.zip |
- nicer "choose desktop" step with icons
Diffstat (limited to 'perl-install/install/steps_gtk.pm')
-rw-r--r-- | perl-install/install/steps_gtk.pm | 36 |
1 files changed, 36 insertions, 0 deletions
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) = @_; |