diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-06-13 05:32:13 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-06-13 05:32:13 +0000 |
commit | 2120972471cfc09fb0ab1786283b471bb00ba2b4 (patch) | |
tree | c9e4a4bf12d5d51a42142ffae9eea4b5bed887c5 | |
parent | 4b2b41e354719ebca9295c03b66be393d9c8ba84 (diff) | |
download | rpmdrake-2120972471cfc09fb0ab1786283b471bb00ba2b4.tar rpmdrake-2120972471cfc09fb0ab1786283b471bb00ba2b4.tar.gz rpmdrake-2120972471cfc09fb0ab1786283b471bb00ba2b4.tar.bz2 rpmdrake-2120972471cfc09fb0ab1786283b471bb00ba2b4.tar.xz rpmdrake-2120972471cfc09fb0ab1786283b471bb00ba2b4.zip |
Restore banners at startup of MandrivaUpdate
-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( |