diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-08-16 15:36:00 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-08-16 15:36:00 +0000 |
commit | 2db552576786ffc38ed81b2ddde3d6e761207140 (patch) | |
tree | be031ce55b2036555d99423b66d66e41ff681acf /perl-install | |
parent | 21d7055da0ea939bb17729a63ec745a67e9b7bdb (diff) | |
download | drakx-2db552576786ffc38ed81b2ddde3d6e761207140.tar drakx-2db552576786ffc38ed81b2ddde3d6e761207140.tar.gz drakx-2db552576786ffc38ed81b2ddde3d6e761207140.tar.bz2 drakx-2db552576786ffc38ed81b2ddde3d6e761207140.tar.xz drakx-2db552576786ffc38ed81b2ddde3d6e761207140.zip |
(create_okcancel): do not display "Cancel" when {cancel} is empty string
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/my_gtk.pm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm index eb041a4b0..343657ba8 100644 --- a/perl-install/my_gtk.pm +++ b/perl-install/my_gtk.pm @@ -149,12 +149,11 @@ sub exit { sub create_okcancel { my ($w, $ok, $cancel, $spread, @other) = @_; - my $one = ($ok xor $cancel); $spread ||= $::isWizard ? "end" : "spread"; - $ok ||= $::isWizard ? ($::Wizard_finished ? _("Finish") : _("Next ->")) : _("Ok"); - $cancel ||= $::isWizard ? _("<- Previous") : _("Cancel"); + $cancel = $::isWizard ? _("<- Previous") : _("Cancel") if !defined $cancel && !defined $ok; + $ok = $::isWizard ? ($::Wizard_finished ? _("Finish") : _("Next ->")) : _("Ok") if !defined $ok; my $b1 = gtksignal_connect($w->{ok} = new Gtk::Button($ok), clicked => $w->{ok_clicked} || sub { $w->{retval} = 1; Gtk->main_quit }); - my $b2 = !$one && gtksignal_connect($w->{cancel} = new Gtk::Button($cancel), clicked => $w->{cancel_clicked} || sub { log::l("default cancel_clicked"); undef $w->{retval}; Gtk->main_quit }); + my $b2 = $cancel && gtksignal_connect($w->{cancel} = new Gtk::Button($cancel), clicked => $w->{cancel_clicked} || sub { log::l("default cancel_clicked"); undef $w->{retval}; Gtk->main_quit }); $::isWizard and gtksignal_connect($w->{wizcancel} = new Gtk::Button(_("Cancel")), clicked => sub { die 'wizcancel' }); my @l = grep { $_ } $::isWizard ? ($w->{wizcancel}, $::Wizard_no_previous ? () : $b2, $b1): ($b1, $b2); push @l, map { gtksignal_connect(new Gtk::Button($_->[0]), clicked => $_->[1]) } @other; |