diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-10-25 15:14:06 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-10-25 15:14:06 +0000 |
commit | 5dde0900a2a0e001c224796b59df8f8c362fdcb1 (patch) | |
tree | 2e6e45cced6cc8cf7bf3f40ba9aff8510caaa371 /rpmdrake.pm | |
parent | 1a70995a780bd337f3f576a2c16b511d4a2ba64c (diff) | |
download | rpmdrake-5dde0900a2a0e001c224796b59df8f8c362fdcb1.tar rpmdrake-5dde0900a2a0e001c224796b59df8f8c362fdcb1.tar.gz rpmdrake-5dde0900a2a0e001c224796b59df8f8c362fdcb1.tar.bz2 rpmdrake-5dde0900a2a0e001c224796b59df8f8c362fdcb1.tar.xz rpmdrake-5dde0900a2a0e001c224796b59df8f8c362fdcb1.zip |
Put a nice error message when the user wants to update some media, but when no
media is actually enabled. (instead of presenting an empty list to choose from)
Diffstat (limited to 'rpmdrake.pm')
-rw-r--r-- | rpmdrake.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/rpmdrake.pm b/rpmdrake.pm index 20805169..54a74897 100644 --- a/rpmdrake.pm +++ b/rpmdrake.pm @@ -718,7 +718,11 @@ sub update_sources_interactive { my $w = ugtk2->new(N("Update media"), grab => 1, center => 1, %options); $w->{rwindow}->set_position($options{transient} ? 'center_on_parent' : 'center_always'); my @buttons; - my @media; + my @media = grep { ! $_->{ignore} } @{$urpm->{media}}; + unless (@media) { + interactive_msg('rpmdrake', N("No active medium found. You must enable some media to be able to update them.")); + return 0; + } gtkadd( $w->{window}, gtkpack__( @@ -727,7 +731,7 @@ sub update_sources_interactive { ( @buttons = map { Gtk2::CheckButton->new_with_label($_->{name}); - } grep { ! $_->{ignore} } @{$urpm->{media}} + } @media ), Gtk2::HSeparator->new, gtkpack( |