From 7086153806f8b463f661081bd07fb5aa6e34ac7f Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 11 Sep 2006 18:57:37 +0000 Subject: [PATCH] ebl add gen bsr button git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3455 91ce42f0-d328-0410-95d8-f526ca767f89 --- gui/brestore/brestore.glade | 215 +++++++++++++++++++++++++++++------- gui/brestore/brestore.pl | 48 ++++++++ 2 files changed, 224 insertions(+), 39 deletions(-) diff --git a/gui/brestore/brestore.glade b/gui/brestore/brestore.glade index 76dd4515df..587fcc7897 100644 --- a/gui/brestore/brestore.glade +++ b/gui/brestore/brestore.glade @@ -189,7 +189,36 @@ - + + True + True + True + False + + + + True + Location : + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + False + False + @@ -337,22 +366,77 @@ This year False - + True - Location : - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + True + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-jump-to + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Location + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + @@ -402,29 +486,6 @@ This year True GTK_BUTTONBOX_DEFAULT_STYLE 0 - - - - True - True - True - GTK_RELIEF_NORMAL - True - - - - - True - gtk-jump-to - 4 - 0.5 - 0.5 - 0 - 0 - - - - @@ -833,6 +894,82 @@ This year + + + + True + Generate a bootstrap file + True + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-justify-left + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Gen BSR + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + 0 diff --git a/gui/brestore/brestore.pl b/gui/brestore/brestore.pl index 035817c3c6..b34b8bdc06 100755 --- a/gui/brestore/brestore.pl +++ b/gui/brestore/brestore.pl @@ -1033,6 +1033,54 @@ sub on_estimate_clicked return 0; } +sub on_gen_bsr_clicked +{ + my ($self) = @_; + + my @options = ("Choose a bsr file", $self->{mainwin}, 'save', + 'gtk-save','ok', 'gtk-cancel', 'cancel'); + + + my $w = new Gtk2::FileChooserDialog ( @options ); + my $ok = 0; + my $save; + while (!$ok) { + my $a = $w->run(); + if ($a eq 'cancel') { + $ok = 1; + } + + if ($a eq 'ok') { + my $f = $w->get_filename(); + if (-f $f) { + my $dlg = Gtk2::MessageDialog->new($self->{mainwin}, + 'destroy-with-parent', + 'warning', 'ok-cancel', 'This file already exists, do you want to overwrite it ?'); + if ($dlg->run() eq 'ok') { + $save = $f; + } + $dlg->destroy(); + } else { + $save = $f; + } + $ok = 1; + } + } + + $w->destroy(); + + if ($save) { + if (open(FP, ">$save")) { + my $bsr = $self->create_filelist(); + print FP $bsr; + close(FP); + $self->set_status("Dumping BSR to $save ok"); + } else { + $self->set_status("Can't dump BSR to $save: $!"); + } + } +} + use File::Temp qw/tempfile/; sub on_go_button_clicked -- 2.39.5