From: Eric Bollengier Date: Wed, 20 Sep 2006 16:50:08 +0000 (+0000) Subject: ebl Add size and nb files to restore_list (when use estimate) X-Git-Tag: Release-2.0.0~429 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=87342dcf7af77c4c5f1e2cb724643ae298184931;p=bacula%2Fbacula ebl Add size and nb files to restore_list (when use estimate) ebl Add jobids to directory in restore_list git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3488 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/brestore/brestore.pl b/gui/brestore/brestore.pl index b34b8bdc06..13969962c5 100755 --- a/gui/brestore/brestore.pl +++ b/gui/brestore/brestore.pl @@ -872,15 +872,20 @@ sub new $widget = $glade->get_widget('restorelist'); my $restore_list = $self->{restore_list} = Gtk2::SimpleList->new_from_treeview( $widget, - 'h_name' => 'hidden', - 'h_jobid' => 'hidden', - 'h_type' => 'hidden', - 'h_curjobid' => 'hidden', + 'h_name' => 'hidden', + 'h_jobid' => 'hidden', + 'h_type' => 'hidden', + 'h_curjobid' => 'hidden', - '' => 'pixbuf', - 'File Name' => 'text', - 'JobId' => 'text', - 'FileIndex' => 'text'); + '' => 'pixbuf', + 'File Name' => 'text', + 'JobId' => 'text', + 'FileIndex' => 'text', + + 'Nb Files' => 'text', #8 + 'Size' => 'text', #9 + 'size_b' => 'hidden', #10 + ); my @restore_list_target_table = ({'target' => 'STRING', 'flags' => [], @@ -1015,14 +1020,20 @@ sub on_estimate_clicked my $txt=""; foreach my $entry (@{$self->{restore_list}->{data}}) { - my ($size, $nb) = $self->estimate_restore_size($entry); + unless ($entry->[9]) { + my ($size, $nb) = $self->estimate_restore_size($entry); + $entry->[10] = $size; + $entry->[9] = human($size); + $entry->[8] = $nb; + } + my $name = unpack('u', $entry->[0]); - $txt .= "\n$name : $nb file(s)/" . human($size) ; + $txt .= "\n$name : " . $entry->[8] . " file(s)/" . $entry->[9] ; $widget->set_markup($title . $txt); - - $size_total+=$size; - $nb_total+=$nb; + + $size_total+=$entry->[10]; + $nb_total+=$entry->[8]; refresh_screen(); } @@ -1670,7 +1681,7 @@ sub add_selected_file_to_list my $dirfileindex = get_fileindex_from_dir_jobid($dbh,$name,$jobid); listview_push($restore_list, $name, $jobid, 'dir', $curjobids, - $diricon, $name,$jobid,$dirfileindex); + $diricon, $name,$curjobids,$dirfileindex); } elsif ($type eq 'file') {