diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-10-16 18:09:27 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-10-16 18:09:27 +0000 |
commit | b14b750986f42ded70b4a65385a4c01d5e250936 (patch) | |
tree | a6978f99c4a221d0540e38290e6a5988322f8817 /mdkapplet | |
parent | 95e875ee64e7064dc12808f10a2aaf69e83b04cf (diff) | |
download | mgaonline-b14b750986f42ded70b4a65385a4c01d5e250936.tar mgaonline-b14b750986f42ded70b4a65385a4c01d5e250936.tar.gz mgaonline-b14b750986f42ded70b4a65385a4c01d5e250936.tar.bz2 mgaonline-b14b750986f42ded70b4a65385a4c01d5e250936.tar.xz mgaonline-b14b750986f42ded70b4a65385a4c01d5e250936.zip |
(confirm_upgrade) display a "download all packages at once" option and
offer to select where to download packages
Diffstat (limited to 'mdkapplet')
-rwxr-xr-x | mdkapplet | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -246,10 +246,11 @@ foreach my $opt (@ARGV) { } } -my $root; +my ($root, $download_dir, $download_all); { my $temp_urpm = Rpmdrake::open_db::fast_open_urpmi_db(); $root = $temp_urpm->{root}; + $download_dir = $temp_urpm->{cachedir}; } my ($new_distro, $no_more_supported); @@ -412,6 +413,16 @@ sub confirm_upgrade() { local $mygtk2::left_padding = 0; my $warn_me = text2bool($local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE}); my $w = new_portable_dialog(N("New version of Mandriva Linux distribution")); + my ($temp_dir, $box); + + my $browse; + $browse = gtksignal_connect( + Gtk2::FileChooserButton->new(N("Browse"), 'select-folder'), + 'current-folder-changed' => sub { + $temp_dir = $_[0]->get_current_folder; + }); + $browse->set_current_folder($download_dir); + my $res = fill_n_run_portable_dialog($w, [ get_banner(), @@ -422,12 +433,27 @@ sub confirm_upgrade() { gtknew('Label_Left', text => N("Do you want to upgrade to the '\%s' distribution?", $new_distro->{name} || $new_distro->{version}), @common), gtknew('CheckButton', text => N("Do not ask me next time"), active_ref => \$warn_me), + gtknew('CheckButton', text => N("Download all packages at once") . "\n" . + N("(Warning: You will need quite a lot of free space)"), + active_ref => \$download_all, sensitive_ref => \$browse, + toggled => sub { $box->set_sensitive($download_all) }, + ), + $box = gtknew('HBox', sensitive => $download_all, + children => [ + 0, gtknew('Label_Left', text => N("Where to download packages:")), + 1 , $browse, + ]), create_okcancel($w, N("Next"), N("Cancel")), ]); setVar('DO_NOT_ASK_FOR_DISTRO_UPGRADE', bool2text($warn_me)); $local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE} = bool2text($warn_me); - $res ? really_confirm_upgrade() : 0; + if ($res) { + $download_dir = $temp_dir; + really_confirm_upgrade(); + } else { + return 0; + } } sub really_confirm_upgrade() { @@ -470,6 +496,7 @@ sub upgrade() { return if $mdv_update_pid; return if !confirm_upgrade(); $mdv_update_pid = fork_exec('mdkapplet-upgrade-helper', "--new_distro_version=$new_distro->{version}", + if_($download_all, "--download-all=$download_dir"), if_($root, "--urpmi-root=$root")); } |