From 9c46bcf3d81dd0a8fc5bcc9e8bef6eea6d384060 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 13 Jan 2004 17:45:11 +0000 Subject: sanitize buttons through reusing create_okcancel() --- perl-install/standalone/drakfloppy | 50 ++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 26 deletions(-) (limited to 'perl-install/standalone/drakfloppy') diff --git a/perl-install/standalone/drakfloppy b/perl-install/standalone/drakfloppy index a1fcc48b8..6dac2a782 100755 --- a/perl-install/standalone/drakfloppy +++ b/perl-install/standalone/drakfloppy @@ -99,17 +99,13 @@ $window->{window}->add( ), ), 1, Gtk2::VBox->new, - 0, gtkpack__(new Gtk2::HButtonBox(), - gtksignal_connect(Gtk2::Button->new(N("Cancel")), - clicked => sub { ugtk2->exit(0) } - ), - gtksignal_connect(Gtk2::Button->new(N("Preferences")), clicked => \&pref_dialog), - gtksignal_connect(gtkset_tip($tips, - Gtk2::Button->new(N("Ok")), - N("Build the disk")), - clicked => \&build_it - ), - ), + 0, create_okcancel({ + cancel_clicked => sub { ugtk2->exit(0) }, + ok_clicked => \&build_it, + }, + undef, undef, '', + [ N("Preferences"), \&pref_dialog, 0 ], + ), ), ); @@ -188,21 +184,23 @@ sub pref_dialog() { $remove_but->set_sensitive(scalar @modules); @temp_modules = (); - gtkpack($dialog->action_area, - gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => sub { $dialog->destroy }), - gtksignal_connect(Gtk2::Button->new(N("Ok")), clicked => sub { - # save values: - $options{$_} = $buttons{$_}->get_active foreach keys %buttons; - my $val; - @modules = (); - $list_model->foreach(sub { - my ($model, $_path, $iter) = @_; - push @modules, $model->get($iter, 0); - return 0; - }, $val); - $dialog->destroy; - }), - ); + gtkadd($dialog->action_area, + create_okcancel({ + cancel_clicked => sub { $dialog->destroy }, + ok_clicked => sub { + # save values: + $options{$_} = $buttons{$_}->get_active foreach keys %buttons; + my $val; + @modules = (); + $list_model->foreach(sub { + my ($model, $_path, $iter) = @_; + push @modules, $model->get($iter, 0); + return 0; + }, $val); + $dialog->destroy; + }, + }), + ); $dialog->show_all; $dialog->run; } -- cgit v1.2.1