diff options
-rwxr-xr-x | rpmdrake | 5 | ||||
-rw-r--r-- | rpmdrake.pm | 21 |
2 files changed, 15 insertions, 11 deletions
@@ -159,6 +159,7 @@ sub interactive_msg_ { interactive_msg(@_, if_(exists $w->{rwindow}, transient sub interactive_list_ { interactive_list(@_, if_(exists $w->{rwindow}, transient => $w->{rwindow})) } sub wait_msg_ { wait_msg(@_, if_(exists $w->{rwindow}, transient => $w->{rwindow})) } sub wait_msg_with_banner { push @_, banner => 1 if $::isEmbedded; &wait_msg_ } +sub interactive_msg_with_banner { push @_, banner => 1 if $::isEmbedded; &interactive_msg_ } $> and (interactive_msg_(N("Running in user mode"), N("You are launching this program as a normal user. @@ -1232,13 +1233,13 @@ sub get_installable_pkgs { unless ($options{'no-media-update'}) { if (@update_medias > 0) { if (!$opts->{skip_updating_mu}) { - $options{'no-confirmation'} or interactive_msg_(N("Rpmdrake"), + $options{'no-confirmation'} or interactive_msg_with_banner(N("Rpmdrake"), N("I need to contact the mirror to get latest update packages. Please check that your network is currently running. Is it ok to continue?"), yesno => 1) or myexit(-1); $urpm->select_media(map { $_->{name} } @update_medias); - update_sources($urpm, noclean => 1); + update_sources($urpm, noclean => 1, banner => $::isEmbedded); } } else { if (any { $_->{update} } @{$urpm->{media}}) { diff --git a/rpmdrake.pm b/rpmdrake.pm index ecb54014..240e041b 100644 --- a/rpmdrake.pm +++ b/rpmdrake.pm @@ -180,15 +180,26 @@ sub writeconf { output $configfile, map { "$_ " . join(' ', @${$config{$_}{var}}) . "\n" } keys %config; } +sub getbanner () { + $::MODE or return undef; + Gtk2::Banner->new("title-$::MODE", { + remove => N("Software Packages Removal"), + update => N("Software Packages Update"), + install => N("Software Packages Installation"), + }->{$::MODE}); +} + sub interactive_msg { my ($title, $contents, %options) = @_; my $d = ugtk2->new($title, grab => 1, if_(exists $options{transient}, transient => $options{transient})); $d->{rwindow}->set_position($options{transient} ? 'center_on_parent' : 'center_always'); $contents = formatAlaTeX($contents) unless $options{scroll}; #- because we'll use a WrappedLabel + my $banner = $options{banner} ? getbanner : undef; gtkadd( $d->{window}, gtkpack_( Gtk2::VBox->new(0, 5), + if_($banner, 0, $banner), 1, ( $options{scroll} ? gtkadd( @@ -296,15 +307,6 @@ sub fatal_msg { myexit -1; } -sub getbanner () { - $::MODE or return undef; - Gtk2::Banner->new("title-$::MODE", { - remove => N("Software Packages Removal"), - update => N("Software Packages Update"), - install => N("Software Packages Installation"), - }->{$::MODE}); -} - sub wait_msg { my ($msg, %options) = @_; gtkflush(); @@ -633,6 +635,7 @@ sub update_sources { my $w; my $label; $w = wait_msg( $label = Gtk2::Label->new(N("Please wait, updating media...")), no_wait_cursor => 1, + banner => $options{banner}, widgets => [ (my $pb = gtkset_size_request(Gtk2::ProgressBar->new, 300, -1)), gtkpack( |