aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2002-08-02 14:21:04 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2002-08-02 14:21:04 +0000
commit523eb41c0cfa724ec2737cecbd0ec2d3ed337718 (patch)
tree44e9038896530d6a71c83688f35eb30599376133
parentcd0be8913f2aaae67452ae27a3f989d884e9c510 (diff)
downloadrpmdrake-523eb41c0cfa724ec2737cecbd0ec2d3ed337718.tar
rpmdrake-523eb41c0cfa724ec2737cecbd0ec2d3ed337718.tar.gz
rpmdrake-523eb41c0cfa724ec2737cecbd0ec2d3ed337718.tar.bz2
rpmdrake-523eb41c0cfa724ec2737cecbd0ec2d3ed337718.tar.xz
rpmdrake-523eb41c0cfa724ec2737cecbd0ec2d3ed337718.zip
allow user to cancel on medium changes
-rwxr-xr-xedit-urpm-sources.pl4
-rwxr-xr-xrpmdrake12
-rw-r--r--rpmdrake.pm10
3 files changed, 14 insertions, 12 deletions
diff --git a/edit-urpm-sources.pl b/edit-urpm-sources.pl
index 29bc3184..fec3b165 100755
--- a/edit-urpm-sources.pl
+++ b/edit-urpm-sources.pl
@@ -109,7 +109,7 @@ sub add_callback {
$info->{name_entry}->select_region(0, -1);
interactive_msg('rpmdrake',
_("There is already a medium by that name, do you
-really want to replace it?"), 1) or return 0;
+really want to replace it?"), { yesno => 1 } ) or return 0;
}
1;
};
@@ -244,7 +244,7 @@ _("Welcome to the packages source editor!
This tool will help you configure the packages sources you wish to use on
your computer. They will then be available to install new software package
-or to perform updates.")), 1) or myexit -1;
+or to perform updates.")), { yesno => 1 }) or myexit -1;
push @$already_splashed, basename($0);
}
diff --git a/rpmdrake b/rpmdrake
index 1582f120..94211094 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -405,7 +405,7 @@ _("The following packages have to be removed for others to be upgraded:
%s
-Is it ok to continue?", $formatlistpkg->(sort { $a cmp $b } keys %{$urpm->{state}{ask_remove}})), 1)
+Is it ok to continue?", $formatlistpkg->(sort { $a cmp $b } keys %{$urpm->{state}{ask_remove}})), { yesno => 1 })
or return 0;
}
1;
@@ -479,7 +479,7 @@ sub get_installable_pkgs {
_("I need to contact the mirror to get latest update packages.
Please check that your network is currently running.
-Is it ok to continue?"), 1) or myexit -1;
+Is it ok to continue?"), { yesno => 1 }) or myexit -1;
my $w = wait_msg(_("Please wait, contacting mirror to update packages information."));
system("/usr/sbin/urpmi.update $update_name") == 0
or fatal_msg(_("Error updating medium"),
@@ -502,7 +502,7 @@ This may be due to a broken or temporary unavailable mirror, or when your
Mandrake Linux version (%s) is not yet / no more supported by Mandrake Linux
Official Updates.
-Do you want to try another mirror?", $r), 1) and goto mu_retry_another_mirror;
+Do you want to try another mirror?", $r), { yesno => 1 }) and goto mu_retry_another_mirror;
myexit -1;
}
}
@@ -571,8 +571,8 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
my %sources = $urpm->download_source_packages($local_sources, $list, '',
sub { interactive_msg(_("Change medium"),
- _("Please insert the medium named \"%s\" on device [%s]", @_));
- 1; });
+ _("Please insert the medium named \"%s\" on device [%s]", @_),
+ { yesno => 1, text => { yes => _("Ok"), no => _("Cancel") } }) });
my @rpms_install = grep { $_ !~ /\.src\.rpm$/ } values %{$urpm->extract_packages_to_install(\%sources) || {}};
my @rpms_upgrade = grep { $_ !~ /\.src\.rpm$/ } values %sources;
@@ -672,7 +672,7 @@ computer.")
Your Mandrake Linux system comes with several thousands of software
packages on CDROM or DVD. This tool will help you choose which software
you want to install on your computer."))
- , 1) or myexit -1;
+ , { yesno => 1 }) or myexit -1;
push @$already_splashed, $MODE;
}
diff --git a/rpmdrake.pm b/rpmdrake.pm
index 1bf4d172..189e5ebf 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -61,14 +61,16 @@ sub writeconf {
}
sub interactive_msg {
- my ($title, $contents, $yesno) = @_;
+ my ($title, $contents, $options) = @_;
my $d = my_gtk->new($title);
gtkadd($d->{window},
gtkpack_(new Gtk::VBox(0,5),
1, new Gtk::Label($contents),
0, gtkpack(create_hbox(),
- $yesno ? (gtksignal_connect(new Gtk::Button(_("Yes")), clicked => sub { $d->{retval} = 1; Gtk->main_quit }),
- gtksignal_connect(new Gtk::Button(_("No")), clicked => sub { $d->{retval} = 0; Gtk->main_quit }))
+ $options->{yesno} ? (gtksignal_connect(new Gtk::Button($options->{text}{yes} || _("Yes")),
+ clicked => sub { $d->{retval} = 1; Gtk->main_quit }),
+ gtksignal_connect(new Gtk::Button($options->{test}{no} || _("No")), clicked =>
+ sub { $d->{retval} = 0; Gtk->main_quit }))
: gtksignal_connect(new Gtk::Button(_("Ok")), clicked => sub { Gtk->main_quit })
)));
$d->main;
@@ -215,7 +217,7 @@ sub choose_mirror {
_("I need to contact MandrakeSoft website to get the mirrors list.
Please check that your network is currently running.
-Is it ok to continue?"), 1) or return '';
+Is it ok to continue?"), { yesno => 1 }) or return '';
my $wait = wait_msg(_("Please wait, downloading mirrors addresses from MandrakeSoft website."));
my @mirrors;
eval { @mirrors = mirrors('/var/cache/urpmi', 'updates') };