summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakbackup
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone/drakbackup')
-rwxr-xr-xperl-install/standalone/drakbackup1166
1 files changed, 592 insertions, 574 deletions
diff --git a/perl-install/standalone/drakbackup b/perl-install/standalone/drakbackup
index 67140d644..defb1dcfa 100755
--- a/perl-install/standalone/drakbackup
+++ b/perl-install/standalone/drakbackup
@@ -85,7 +85,7 @@ my $remove_user_before_restore = 0;
my @file_list_to_send_by_ftp;
my $results;
my @net_methods = ("ftp", "rsync", "ssh", "webdav");
-my @media_types = (translate(N_("hd")), "cd", translate(N_("tape")));
+my @media_types = ("hd", "cd", "tape");
my %cd_devices;
my $std_device;
my @tape_devices;
@@ -109,7 +109,7 @@ my $nonroot_user = 0;
my $media_problem = 0;
my $vol_name = 'Drakbackup';
my $good_restore_path = 1;
-my @no_devices = translate(N_("No devices found"));
+my @no_devices = translate(N_("No device found"));
my %help;
my %conf;
my $time_string = "* * * * *";
@@ -118,6 +118,7 @@ my $ignore_files_list;
my @list_of_rpm_to_install;
my @other_files;
my @sys_files = "/etc";
+my @files_for_direct_tape;
my $host_passwd;
my $untar_prefix = "tar -C $restore_path -x";
@@ -149,13 +150,13 @@ foreach (@ARGV) {
sub setup_tooltips() {
%help = (
- 'use_expect' => N("Expect is an extension to the Tcl scripting language that allows interactive sessions without user intervention."),
+ 'use_expect' => N("Expect is an extension to the TCL scripting language that allows interactive sessions without user intervention."),
'remember_pass' => N("Store the password for this system in drakbackup configuration."),
'erase_cdrw' => N("For a multisession CD, only the first session will erase the cdrw. Otherwise the cdrw is erased before each backup."),
'use_incr_decr' => N("This option will save files that have changed. Exact behavior depends on whether incremental or differential mode is used."),
'use_incremental' => N("Incremental backups only save files that have changed or are new since the last backup."),
'use_differential' => N("Differential backups only save files that have changed or are new since the original 'base' backup."),
- 'send_mail_to' => N("This should be a local user or email addresse that you want the backup results sent to. You will need to define a functioning mail server."),
+ 'send_mail_to' => N("This should be a local user or email address that you want the backup results sent to. You will need to define a functioning mail server."),
'backupignore' => N("Files or wildcards listed in a .backupignore file at the top of a directory tree will not be backed up."),
'delete_files' => N("For backups to other media, files are still created on the hard drive, then moved to the other media. Enabling this option will remove the hard drive tar files after the backup."),
'dir_or_module' => N("Some protocols, like rsync, may be configured at the server end. Rather than using a directory path, you would use the 'module' name for the service path."),
@@ -193,7 +194,7 @@ if (check_for_xserver()) {
sub set_help_tip {
my ($entry, $key) = @_;
- gtkset_tip(new Gtk2::Tooltips, $entry, formatAlaTeX($help{$key}));
+ gtkset_tip(Gtk2::Tooltips->new, $entry, formatAlaTeX($help{$key}));
}
sub all_user_list() {
@@ -243,8 +244,8 @@ sub get_free_space {
sub check_storage_quota {
my ($dir) = @_;
- my $used = `du $dir`;
- my $used_space = $used / 1024;
+ my $used = `du -b $dir`;
+ my $used_space = $used / 1024 / 1024;
if ($used_space > $conf{MAX_SPACE}) {
return $used_space;
} else {
@@ -307,7 +308,7 @@ sub get_cd_info() {
print "{$key}->{dvdr} = $cd_devices{$key}{dvdr}\n";
print "{$key}->{dvdram} = $cd_devices{$key}{dvdram}\n";
} else {
- delete $cd_devices{$key} if $cd_devices{$key}{rec_dev} eq ''
+ delete $cd_devices{$key} if $cd_devices{$key}{rec_dev} eq '';
}
}
}
@@ -389,7 +390,7 @@ sub save_cron_files() {
system("chmod +x /etc/cron.$conf{DAEMON_TIME_SPACE}/drakbackup");
}
if ($conf{DAEMON_TIME_SPACE} eq "custom" || !$backup_daemon) {
- my $newdetail = join(" ", $time_string, $exec_string, "\n") if $backup_daemon;
+ my $newdetail = $backup_daemon && join(" ", $time_string, $exec_string, "\n");
system("crontab -l | tail +4 > $tmpcron");
my @cronlines = cat_($tmpcron);
my $index = 0;
@@ -397,7 +398,7 @@ sub save_cron_files() {
if (/$exec_string/) {
splice(@cronlines, $index, 1);
}
- $index++
+ $index++;
}
push(@cronlines, $newdetail) if $backup_daemon;
output($tmpcron, @cronlines);
@@ -618,7 +619,7 @@ sub do_expect {
$in->ask_warn(N("Information"), N("This may take a moment to generate the keys."));
gtkset_mousecursor_wait();
#- not using a passphrase for the moment
- system("ssh-keygen -P '' -t dsa -f $backup_key");
+ system("ssh-keygen", "-P", "", "-t", "dsa", "-f", $backup_key);
gtkset_mousecursor_normal();
}
@@ -672,12 +673,12 @@ sub ssh_client() {
$interactive and progress($pbar, $plabel, 0.5, "File Transfer...");
$interactive and $stext->set_text($_);
$log_buff .= $command . "\n\n";
- local *TMP;
- open TMP, "$command 2>&1 |";
- while ($value = <TMP>) {
+ my $TMP;
+ open $TMP, "$command 2>&1 |";
+ while ($value = <$TMP>) {
$log_buff .= $value;
}
- close TMP;
+ close $TMP;
$log_buff .= "\n";
$interactive and progress($pbar, $plabel, 0.5, "Done...");
$interactive and progress($pbar3, $plabel3, 1/@file_list_to_send_by_ftp, N("Total progress"));
@@ -726,9 +727,11 @@ sub check_for_cd() {
show_warning("f", N("Does not appear to be recordable media!"));
return 1;
}
- if ($log_buff =~ /Is not erasable/ && $conf{MEDIA_ERASE}) {
- show_warning("f", N("Not erasable media!"));
- return 1;
+ #- non-fatal, just disable erase
+ if (($log_buff =~ /Is not erasable/ || $log_buff =~ /Found DVD media/) && $conf{MEDIA_ERASE}) {
+ show_warning("w", N("Not erasable media!"));
+ $conf{MEDIA_ERASE} = 0;
+ save_conf_file();
}
if ($conf{MULTI_SESSION}) {
@@ -753,8 +756,8 @@ sub check_for_cd() {
sub write_on_cd() {
my $command = "cdrecord -v dev=$conf{CD_DEVICE} -data ";
- # DVD+RW use -dao
- $command .= "-dao " if $conf{DVDRW};
+ # DVD+RW use -sao
+ $command .= "-sao " if $conf{DVDRW};
#- only blank if it's the first session
$command .= "blank=fast " if $conf{MEDIA_ERASE} && $session_offset eq '';
#- multi-session mode
@@ -788,16 +791,16 @@ sub spawn_progress {
$log_buff .= $command . "\n\n";
standalone::explanations("Running $command");
- local *TMP;
- open TMP, "$command 2>&1 |";
- while ($value = <TMP>) {
+ my $TMP;
+ open $TMP, "$command 2>&1 |";
+ while ($value = <$TMP>) {
$log_buff .= $value;
if ($interactive) {
$stext->set_text($value);
gtkflush();
}
}
- close TMP;
+ close $TMP;
$interactive and Glib::Source->remove($timer);
}
@@ -896,7 +899,13 @@ sub build_tape() {
}
#- do the backup
- $command = "tar -cvf $conf{TAPE_DEVICE} @file_list_to_send_by_ftp";
+ $command = "tar -cvf $conf{TAPE_DEVICE} ";
+ if ($conf{DIRECT_TAPE}) {
+ ($command, undef) = handle_ignores($command, undef, @files_for_direct_tape);
+ $command .= " @files_for_direct_tape";
+ } else {
+ $command .= " @file_list_to_send_by_ftp";
+ }
spawn_progress($command, "Running tar to tape");
#- eject the tape?
@@ -932,12 +941,13 @@ sub build_backup_files() {
my $incr;
my $base;
my $find_args = "! -type d -print";
-
+
local $_;
$results = "";
$log_buff = "";
- #- flush this so if the user does 2 runs in a row we don't try to send the same files
+ #- flush these so if the user does 2 runs in a row we don't try to send the same files
@file_list_to_send_by_ftp = ();
+ @files_for_direct_tape = ();
$interactive and gtkset_mousecursor_wait();
read_conf_file();
@@ -1046,7 +1056,7 @@ sub build_backup_files() {
files_to_results("$incr$user");
}
}
- $interactive and progress($pbar2, $plabel1, 1, N("Backup User files..."));
+ $interactive and progress($pbar1, $plabel1, 1, N("Backup User files..."));
$interactive and progress($pbar3, $plabel3, 0.4, N("Hard Disk Backup files..."));
if ($conf{OTHER_FILES}) {
@@ -1081,16 +1091,16 @@ sub build_backup_files() {
push_list("list_$incr") if $incr =~ /_other/;
files_to_results($incr);
}
- $interactive and progress($pbar1, $plabel2, 1, N("Backup Other files..."));
+ $interactive and progress($pbar2, $plabel2, 1, N("Backup Other files..."));
$interactive and progress($pbar3, $plabel3, 0.3, N("Hard Disk Backup Progress..."));
}
my $filecount = @file_list_to_send_by_ftp;
- if (!$filecount) {
+ if (!$filecount && !$conf{DIRECT_TAPE}) {
my $msg = N("No changes to backup!");
show_warning("w", $msg);
$interactive and gtkset_mousecursor_normal();
- $interactive and interactive_mode();
+ $interactive and interactive_mode_box();
results_to_logfile();
return 1;
}
@@ -1156,13 +1166,15 @@ sub build_backup_files() {
#- write our catalog file
if (!$media_problem) {
my $catalog = substr($the_time, 1);
+ my $direct_tape = "";
+ $direct_tape = "Direct" if $conf{DIRECT_TAPE};
if (!$conf{USE_NET} && !$conf{USE_TAPE} && !$conf{USE_CD}) {
$catalog .= ":HD:localhost:$conf{PATH_TO_SAVE}";
$conf{NET_PROTO} = '';
}
$catalog .= ":$conf{NET_PROTO}:$conf{LOGIN}\@$conf{HOST_NAME}:$conf{HOST_PATH}" if $conf{NET_PROTO};
$catalog .= ":CD:$vol_name:$conf{CD_DEVICE}" if $conf{USE_CD};
- $catalog .= ":Tape:$vol_name:$conf{TAPE_DEVICE}" if $conf{USE_TAPE};
+ $catalog .= ":" . $direct_tape . "Tape:$vol_name:$conf{TAPE_DEVICE}" if $conf{USE_TAPE};
$catalog .= ":System" unless $conf{NO_SYS_FILES};
$catalog .= ":I" if $conf{SYS_INCREMENTAL_BACKUPS} && !$conf{NO_SYS_FILES} && !$conf{SYS_DIFFERENTIAL_BACKUPS};
$catalog .= ":D" if $conf{SYS_INCREMENTAL_BACKUPS} && !$conf{NO_SYS_FILES} && $conf{SYS_DIFFERENTIAL_BACKUPS};
@@ -1170,7 +1182,7 @@ sub build_backup_files() {
$catalog .= ":Users=(@user_list)" unless $conf{NO_USER_FILES};
$catalog .= ":I" if $conf{USER_INCREMENTAL_BACKUPS} && !$conf{NO_USER_FILES} && !$conf{USER_DIFFERENTIAL_BACKUPS};
$catalog .= ":D" if $conf{USER_INCREMENTAL_BACKUPS} && !$conf{NO_USER_FILES} && $conf{USER_DIFFERENTIAL_BACKUPS};
- $catalog .= ":F" if !$conf{USER_INCREMENTAL_BACKUPS} && !$conf{NO_USER_FILES};;
+ $catalog .= ":F" if !$conf{USER_INCREMENTAL_BACKUPS} && !$conf{NO_USER_FILES};
$catalog .= ":Other=(@other_files)" if $conf{OTHER_FILES};
$catalog .= ":I" if $conf{OTHER_INCREMENTAL_BACKUPS} && $conf{OTHER_FILES} && !$conf{OTHER_DIFFERENTIAL_BACKUPS};
$catalog .= ":D" if $conf{OTHER_INCREMENTAL_BACKUPS} && $conf{OTHER_FILES} && $conf{OTHER_DIFFERENTIAL_BACKUPS};
@@ -1237,13 +1249,22 @@ sub do_find {
#- $newer may be undef - if it's defined then "-cnewer $newer"
$newer = $conf{PATH_TO_SAVE} . "/" . $newer if defined($newer);
defined($newer) ? system("find @where -cnewer $newer $more_args > $into") : system("find @where $more_args > $into");
+ #- someone on club complained about perms being too open
+ chmod(0600, $into) if -e $into;
}
sub do_tar {
my ($tar_cmd, $dest_file, $list_file, @files) = @_;
my $full_dest_file = $conf{PATH_TO_SAVE} . "/" . $dest_file . $the_time . "." . $conf{OPTION_COMP};
- #- if $list_file is undefined, then use the @files list
- defined($list_file) ? system("$tar_cmd -f $full_dest_file -T $list_file") : system("$tar_cmd -f $full_dest_file @files");
+ if ($conf{DIRECT_TAPE}) {
+ log::explanations("Direct tape backup - tar deferred...");
+ defined($list_file) ? push @files_for_direct_tape, $list_file : push @files_for_direct_tape, @files;
+ } else {
+ #- if $list_file is undefined, then use the @files list
+ defined($list_file) ? system("$tar_cmd -f $full_dest_file -T $list_file") : system("$tar_cmd -f $full_dest_file @files");
+ }
+ #- someone on club complained about perms being too open
+ chmod(0600, $full_dest_file) if -e $full_dest_file;
push_list($dest_file);
}
@@ -1257,9 +1278,14 @@ sub push_list {
sub files_to_results {
my ($basename) = @_;
- $results .= "\nfile: " . $conf{PATH_TO_SAVE} . "/backup_" . $basename . $the_time . "." . $conf{OPTION_COMP} . "\n\n";
- $results .= cat_("$conf{PATH_TO_SAVE}/list_" . $basename . $the_time . ".txt");
+ if ($conf{DIRECT_TAPE}) {
+ $results .= "\nDirect to tape:\n\n";
+ } else {
+ $results .= "\nfile: " . $conf{PATH_TO_SAVE} . "/backup_" . $basename . $the_time . "." . $conf{OPTION_COMP} . "\n\n";
+ $results .= cat_("$conf{PATH_TO_SAVE}/list_" . $basename . $the_time . ".txt");
+ }
$results .= "\nignored:\n" . $ignore_files_list . "\n" if $ignore_files_list;
+
}
sub handle_ignores {
@@ -1316,7 +1342,7 @@ sub check_pkg_needs() {
}
sub show_status() {
- my $text = new Gtk2::TextView;
+ my $text = Gtk2::TextView->new;
destroy_widget();
my $scrolled_window = Gtk2::ScrolledWindow->new;
$scrolled_window->set_border_width(10);
@@ -1324,7 +1350,7 @@ sub show_status() {
gtktext_insert(gtkset_editable($text, 0), [ [ $results ] ]);
gtkpack($advanced_box,
- $table = gtkpack_(new Gtk2::VBox(0,10), 1, $scrolled_window)
+ $table = gtkpack_(Gtk2::VBox->new(0,10), 1, $scrolled_window)
);
$central_widget = \$table;
$table->show_all;
@@ -1350,15 +1376,17 @@ sub filedialog_generic {
my ($prompt, $widget) = @_;
my $file_dialog;
- $file_dialog = gtksignal_connect(new Gtk2::FileSelection($prompt), destroy => sub { $file_dialog->destroy });
+ $file_dialog = gtksignal_connect(Gtk2::FileSelection->new($prompt), destroy => sub { $file_dialog->destroy });
$file_dialog->ok_button->signal_connect(clicked => sub {
if (defined($widget)) {
$$widget->set_text($file_dialog->get_filename);
} else {
my $file_name = $file_dialog->get_filename;
+ #- catch files and dirs with spaces
+ $file_name = '"' . $file_name . '"' if $file_name =~ / /;
if (!member($file_name, @other_files)) {
push(@other_files, $file_name);
- $list_model->append_set(undef, $file_name);
+ $list_model->append_set(0, $file_name);
}
}
$file_dialog->destroy;
@@ -1389,17 +1417,17 @@ sub advanced_what_sys() {
my $box_what_sys;
gtkpack($advanced_box,
- $box_what_sys = gtkpack_(new Gtk2::VBox(0, 15),
+ $box_what_sys = gtkpack_(Gtk2::VBox->new(0, 15),
1, N("\nPlease check all options that you need.\n"),
1, N("These options can backup and restore all files in your /etc directory.\n"),
- 0, my $check_what_sys = new Gtk2::CheckButton(N("Backup your System files. (/etc directory)")),
- 0, my $check_what_versions = new Gtk2::CheckButton(N("Use Incremental/Differential Backups (do not replace old backups)")),
- 0, gtkpack__(new Gtk2::HBox(0,0),
+ 0, my $check_what_sys = Gtk2::CheckButton->new(N("Backup your System files. (/etc directory)")),
+ 0, my $check_what_versions = Gtk2::CheckButton->new(N("Use Incremental/Differential Backups (do not replace old backups)")),
+ 0, gtkpack__(Gtk2::HBox->new(0,0),
my @mode_buttons = gtkradio((N("Use Incremental Backups")) x 2, N("Use Differential Backups")),
),
- 0, my $check_what_critical = new Gtk2::CheckButton(N("Do not include critical files (passwd, group, fstab)")),
+ 0, my $check_what_critical = Gtk2::CheckButton->new(N("Do not include critical files (passwd, group, fstab)")),
0, N("With this option you will be able to restore any version\n of your /etc directory."),
- 1, new Gtk2::VBox(0, 15),
+ 1, Gtk2::VBox->new(0, 15),
),
);
check_list([$check_what_sys, \$conf{NO_SYS_FILES}, 1], [$check_what_critical, \$conf{NO_CRITICAL_SYS}]);
@@ -1428,14 +1456,14 @@ sub advanced_what_user {
all_user_list();
gtkpack($advanced_box,
- $box_what_user = gtkpack_(new Gtk2::VBox(0, 15),
+ $box_what_user = gtkpack_(Gtk2::VBox->new(0, 15),
0, N("Please check all users that you want to include in your backup."),
- 0, new Gtk2::HSeparator,
+ 0, Gtk2::HSeparator->new,
1, create_scrolled_window(
- gtkpack__(new Gtk2::VBox(0,0),
+ gtkpack__(Gtk2::VBox->new(0,0),
map { my $name = $_;
my @user_list_tmp;
- my $b = new Gtk2::CheckButton($name);
+ my $b = Gtk2::CheckButton->new($name);
if (any { /^$name$/ } @user_list) {
$check_what_user{$_}[1] = 1;
gtkset_active($b, 1);
@@ -1456,9 +1484,9 @@ sub advanced_what_user {
$b } (@user_list_all)
),
),
- 0, my $check_what_browser = new Gtk2::CheckButton(N("Do not include the browser cache")),
- 0, my $check_what_user_versions = new Gtk2::CheckButton(N("Use Incremental/Differential Backups (do not replace old backups)")),
- 0, gtkpack__(new Gtk2::HBox(0,0),
+ 0, my $check_what_browser = Gtk2::CheckButton->new(N("Do not include the browser cache")),
+ 0, my $check_what_user_versions = Gtk2::CheckButton->new(N("Use Incremental/Differential Backups (do not replace old backups)")),
+ 0, gtkpack__(Gtk2::HBox->new(0,0),
my @mode_buttons = gtkradio((N("Use Incremental Backups")) x 2, N("Use Differential Backups")),
),
),
@@ -1494,7 +1522,7 @@ sub advanced_what_other() {
$list_others->set_headers_visible(0);
foreach (@other_files) {
- $list_model->append_set(undef, $_);
+ $list_model->append_set(0, $_);
}
$list_others->get_selection->signal_connect(changed => sub {
@@ -1505,11 +1533,11 @@ sub advanced_what_other() {
});
gtkpack($advanced_box,
- $box_what_other = gtkpack_(new Gtk2::VBox(0, 15),
- 1, gtkpack_(new Gtk2::HBox(0,4),
+ $box_what_other = gtkpack_(Gtk2::VBox->new(0, 15),
+ 1, gtkpack_(Gtk2::HBox->new(0,4),
1, create_scrolled_window($list_others),
),
- 0, gtkadd(gtkset_layout(new Gtk2::HButtonBox, 'spread'),
+ 0, gtkadd(gtkset_layout(Gtk2::HButtonBox->new, 'spread'),
gtksignal_connect(Gtk2::Button->new(N("Add")), clicked => sub { filedialog_generic(N("Select the files or directories and click on 'OK'"), undef) }),
gtksignal_connect(Gtk2::Button->new(N("Remove Selected")), clicked => sub {
$list_model->remove($file_iter) if $file_iter;
@@ -1523,8 +1551,8 @@ sub advanced_what_other() {
}
}),
),
- 0, my $check_what_other_versions = new Gtk2::CheckButton(N("Use Incremental/Differential Backups (do not replace old backups)")),
- 0, gtkpack__(new Gtk2::HBox(0,0),
+ 0, my $check_what_other_versions = Gtk2::CheckButton->new(N("Use Incremental/Differential Backups (do not replace old backups)")),
+ 0, gtkpack__(Gtk2::HBox->new(0,0),
my @mode_buttons = gtkradio((N("Use Incremental Backups")) x 2, N("Use Differential Backups")),
),
),
@@ -1552,35 +1580,35 @@ sub advanced_what() {
my $box_what;
gtkpack($advanced_box,
- $box_what = gtkpack_(new Gtk2::HBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
- 1, gtkpack_(new Gtk2::VBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
+ $box_what = gtkpack_(Gtk2::HBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
+ 1, gtkpack_(Gtk2::VBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
1, gtksignal_connect(my $button_what_sys = Gtk2::Button->new,
clicked => sub { $box_what->destroy; advanced_what_sys() }),
1, gtksignal_connect(my $button_what_user = Gtk2::Button->new,
- clicked => sub { destroy_widget(); advanced_what_user() }),
+ clicked => sub { destroy_widget(); advanced_what_user(undef) }),
1, gtksignal_connect(my $button_what_other = Gtk2::Button->new,
clicked => sub { destroy_widget(); advanced_what_other() }),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
);
- $button_what_sys->add(gtkpack(new Gtk2::HBox(0,10),
+ $button_what_sys->add(gtkpack(Gtk2::HBox->new(0,10),
gtkcreate_img("ic82-system-40"),
- new Gtk2::Label(N("System")),
- new Gtk2::HBox(0, 5)
+ Gtk2::Label->new(N("System")),
+ Gtk2::HBox->new(0, 5)
));
- $button_what_user->add(gtkpack(new Gtk2::HBox(0,10),
+ $button_what_user->add(gtkpack(Gtk2::HBox->new(0,10),
gtkcreate_img("ic82-users-40"),
- new Gtk2::Label(N("Users")),
- new Gtk2::HBox(0, 5)
+ Gtk2::Label->new(N("Users")),
+ Gtk2::HBox->new(0, 5)
));
- $button_what_other->add(gtkpack(new Gtk2::HBox(0,10),
+ $button_what_other->add(gtkpack(Gtk2::HBox->new(0,10),
gtkcreate_img("ic82-others-40"),
- new Gtk2::Label(N("Other")),
- new Gtk2::HBox(0, 5)
+ Gtk2::Label->new(N("Other")),
+ Gtk2::HBox->new(0, 5)
));
gtkset_sensitive($button_what_sys, !$conf{NO_SYS_FILES});
fonction_env(\$box_what, \&advanced_what, \&advanced_box);
@@ -1592,42 +1620,42 @@ sub advanced_where_net_types {
my $box_where_net;
gtkpack($advanced_box,
- $box_where_net = gtkpack_(new Gtk2::VBox(0, 10),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, my $check_where_use_net = new Gtk2::CheckButton(N("Use network connection to backup")),
- 1, new Gtk2::HBox(0,10),
- 0, new Gtk2::Label(N("Net Method:")),
+ $box_where_net = gtkpack_(Gtk2::VBox->new(0, 10),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, my $check_where_use_net = Gtk2::CheckButton->new(N("Use network connection to backup")),
+ 1, Gtk2::HBox->new(0,10),
+ 0, Gtk2::Label->new(N("Net Method:")),
0, gtkset_sensitive(my $entry_net_type = Gtk2::ComboBox->new_text, $conf{USE_NET}),
),
- 0, gtkpack_(new Gtk2::HBox(0,5),
- 0, gtkset_sensitive(my $check_use_expect = new Gtk2::CheckButton(N("Use Expect for SSH")), ($conf{USE_NET} && $conf{NET_PROTO} eq 'ssh')),
- 0, gtkset_sensitive(my $check_xfer_keys = new Gtk2::CheckButton(N("Create/Transfer backup keys for SSH")), ($conf{USE_NET} && $conf{NET_PROTO} eq 'ssh')),
- 1, new Gtk2::HBox(0,10),
+ 0, gtkpack_(Gtk2::HBox->new(0,5),
+ 0, gtkset_sensitive(my $check_use_expect = Gtk2::CheckButton->new(N("Use Expect for SSH")), ($conf{USE_NET} && $conf{NET_PROTO} eq 'ssh')),
+ 0, gtkset_sensitive(my $check_xfer_keys = Gtk2::CheckButton->new(N("Create/Transfer backup keys for SSH")), ($conf{USE_NET} && $conf{NET_PROTO} eq 'ssh')),
+ 1, Gtk2::HBox->new(0,10),
0, gtkset_sensitive(my $button_xfer_keys = Gtk2::Button->new(N("Transfer Now")), $conf{DRAK_KEYS}),
),
- 0, gtkset_sensitive(my $check_user_keys = new Gtk2::CheckButton(N("Other (not drakbackup) keys in place already")), ($conf{USE_NET} && $conf{NET_PROTO} eq 'ssh')),
- 0, new Gtk2::HSeparator,
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Host name or IP.")), $conf{USE_NET}),
- 1, new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(my $host_name_entry = new Gtk2::Entry(), $conf{USE_NET}),
+ 0, gtkset_sensitive(my $check_user_keys = Gtk2::CheckButton->new(N("Other (not drakbackup) keys in place already")), ($conf{USE_NET} && $conf{NET_PROTO} eq 'ssh')),
+ 0, Gtk2::HSeparator->new,
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Host name or IP.")), $conf{USE_NET}),
+ 1, Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(my $host_name_entry = Gtk2::Entry->new, $conf{USE_NET}),
),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Directory (or module) to put the backup on this host.")), $conf{USE_NET}),
- 1, new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(my $host_path_entry = new Gtk2::Entry(), $conf{USE_NET}),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Directory (or module) to put the backup on this host.")), $conf{USE_NET}),
+ 1, Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(my $host_path_entry = Gtk2::Entry->new, $conf{USE_NET}),
),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Login name")), $conf{USE_NET}),
- 1, new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(my $login_user_entry = new Gtk2::Entry(), $conf{USE_NET}),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Login name")), $conf{USE_NET}),
+ 1, Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(my $login_user_entry = Gtk2::Entry->new, $conf{USE_NET}),
),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Password")), $conf{USE_NET}),
- 1, new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(my $check_remember_pass = new Gtk2::CheckButton(N("Remember this password")), $conf{USE_NET}),
- 1, new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(my $passwd_user_entry = new Gtk2::Entry(), $conf{USE_NET}),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Password")), $conf{USE_NET}),
+ 1, Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(my $check_remember_pass = Gtk2::CheckButton->new(N("Remember this password")), $conf{USE_NET}),
+ 1, Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(my $passwd_user_entry = Gtk2::Entry->new, $conf{USE_NET}),
),
),
);
@@ -1727,61 +1755,54 @@ sub advanced_where_cd {
$dev_codes{$cd_devices{$key}{rec_dev}} = $key;
}
- my $combo_where_cd_device = Gtk2::ComboBox->new_text;
- if (keys %cd_devices) {
- $combo_where_cd_device->set_popdown_strings('', sort keys %dev_codes);
- } else {
- $combo_where_cd_device->set_popdown_strings(@no_devices);
- }
-
- my $combo_where_cd_time = Gtk2::ComboBox->new_text;
- $combo_where_cd_time->set_popdown_strings("650 MB", "700 MB", "750 MB", "800 MB", "4.7 GB");
+ my $combo_where_cd_device = Gtk2::ComboBox->new_with_strings(%cd_devices ? [ sort keys %dev_codes ] : \@no_devices);
+ my $combo_where_cd_time = Gtk2::ComboBox->new_with_strings([ "650 MB", "700 MB", "750 MB", "800 MB", "4.7 GB" ]);
gtkpack($advanced_box,
- $box_where_cd = gtkpack_(new Gtk2::VBox(0, 6),
- 0, my $check_where_cd = new Gtk2::CheckButton(N("Use CD-R/DVD-R to backup")),
- 0, new Gtk2::HSeparator,
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Choose your CD/DVD device")), $conf{USE_CD}),
- 1, new Gtk2::VBox(0, 5),
+ $box_where_cd = gtkpack_(Gtk2::VBox->new(0, 6),
+ 0, my $check_where_cd = Gtk2::CheckButton->new(N("Use CD-R/DVD-R to backup")),
+ 0, Gtk2::HSeparator->new,
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Choose your CD/DVD device")), $conf{USE_CD}),
+ 1, Gtk2::VBox->new(0, 5),
0, gtkset_sensitive($combo_where_cd_device, $conf{USE_CD}),
),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Choose your CD/DVD media size")), $conf{USE_CD}),
- 1, new Gtk2::VBox(0, 5),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Choose your CD/DVD media size")), $conf{USE_CD}),
+ 1, Gtk2::VBox->new(0, 5),
0, gtkset_sensitive($combo_where_cd_time, $conf{USE_CD}),
),
- 0, new Gtk2::VBox(0, 5),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 1, new Gtk2::VBox(0, 5),
- 0, gtkset_sensitive(new Gtk2::Label(N("Multisession CD")), $conf{USE_CD}),
- 0, gtkset_sensitive(my $check_multisession = new Gtk2::CheckButton(), $conf{USE_CD}),
- 0, gtkset_sensitive(new Gtk2::Label(N("CDRW media")), $conf{USE_CD}),
- 0, gtkset_sensitive(my $check_cdrw = new Gtk2::CheckButton(), $conf{USE_CD}),
+ 0, Gtk2::VBox->new(0, 5),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 1, Gtk2::VBox->new(0, 5),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Multisession CD")), $conf{USE_CD}),
+ 0, gtkset_sensitive(my $check_multisession = Gtk2::CheckButton->new, $conf{USE_CD}),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("CDRW media")), $conf{USE_CD}),
+ 0, gtkset_sensitive(my $check_cdrw = Gtk2::CheckButton->new, $conf{USE_CD}),
),
- 0, new Gtk2::VBox(0, 5),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 1, new Gtk2::VBox(0, 5),
- 0, gtkset_sensitive(new Gtk2::Label(N("Erase your RW media (1st Session)")), $conf{CDRW} && $conf{USE_CD}),
+ 0, Gtk2::VBox->new(0, 5),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 1, Gtk2::VBox->new(0, 5),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Erase your RW media (1st Session)")), $conf{CDRW} && $conf{USE_CD}),
0, gtkset_sensitive(my $button_erase_now = Gtk2::Button->new(N(" Erase Now ")), $conf{CDRW}),
- 0, gtkset_sensitive(my $check_cdrw_erase = new Gtk2::CheckButton(), $conf{CDRW} && $conf{USE_CD}),
+ 0, gtkset_sensitive(my $check_cdrw_erase = Gtk2::CheckButton->new, $conf{CDRW} && $conf{USE_CD}),
),
- 0, new Gtk2::VBox(0, 5),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 1, new Gtk2::VBox(0, 5),
- 0, gtkset_sensitive(new Gtk2::Label(N("DVD+RW media")), $conf{USE_CD}),
- 0, gtkset_sensitive(my $check_dvdrw = new Gtk2::CheckButton(), $conf{USE_CD}),
- 0, gtkset_sensitive(new Gtk2::Label(N("DVD-R media")), $conf{USE_CD}),
- 0, gtkset_sensitive(my $check_dvdr = new Gtk2::CheckButton(), $conf{USE_CD}),
- 0, gtkset_sensitive(new Gtk2::Label(N("DVDRAM device")), $conf{USE_CD}),
- 0, gtkset_sensitive(my $check_dvdram = new Gtk2::CheckButton(), $conf{USE_CD}),
+ 0, Gtk2::VBox->new(0, 5),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 1, Gtk2::VBox->new(0, 5),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("DVD+RW media")), $conf{USE_CD}),
+ 0, gtkset_sensitive(my $check_dvdrw = Gtk2::CheckButton->new, $conf{USE_CD}),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("DVD-R media")), $conf{USE_CD}),
+ 0, gtkset_sensitive(my $check_dvdr = Gtk2::CheckButton->new, $conf{USE_CD}),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("DVDRAM device")), $conf{USE_CD}),
+ 0, gtkset_sensitive(my $check_dvdram = Gtk2::CheckButton->new, $conf{USE_CD}),
),
),
);
foreach ([$check_cdrw_erase, \$conf{MEDIA_ERASE}], [$check_dvdrw, \$conf{DVDRW}], [$check_dvdr, \$conf{DVDR}], [$check_dvdram, \$conf{DVDRAM}], [$check_multisession, \$conf{MULTI_SESSION}]) {
my $ref = $_->[1];
- gtksignal_connect(gtkset_active($_->[0], $$ref), toggled => sub { $$ref = $$ref ? 0 : 1 })
+ gtksignal_connect(gtkset_active($_->[0], $$ref), toggled => sub { $$ref = $$ref ? 0 : 1 });
}
gtksignal_connect(gtkset_active($check_where_cd, $conf{USE_CD}), toggled => sub {
$conf{USE_CD} = $conf{USE_CD} ? 0 : 1;
@@ -1808,10 +1829,10 @@ sub advanced_where_cd {
}
});
- $combo_where_cd_time->entry->set_text($conf{CD_TIME});
+ $combo_where_cd_time->entry->set_text($conf{CD_TIME}) if $conf{CD_TIME};
$combo_where_cd_time->entry->signal_connect('changed', sub { $conf{CD_TIME} = $combo_where_cd_time->entry->get_text });
- $combo_where_cd_device->entry->set_text($conf{CD_DEVICE});
+ $combo_where_cd_device->entry->set_text($conf{CD_DEVICE}) if $conf{CD_DEVICE};
$combo_where_cd_device->entry->signal_connect('changed', sub {
$conf{CD_DEVICE} = $combo_where_cd_device->entry->get_text;
$std_device = $dev_codes{$conf{CD_DEVICE}};
@@ -1838,46 +1859,47 @@ sub advanced_where_tape {
#- look for tape devices;
get_tape_info();
- my $combo_where_tape_device = Gtk2::ComboBox->new_text;
- if (@tape_devices) {
- $combo_where_tape_device->set_popdown_strings('', @tape_devices)
- } else {
- $combo_where_tape_device->set_popdown_strings(@no_devices);
- }
+ my $combo_where_tape_device = Gtk2::ComboBox->new_with_strings(@tape_devices ? \@tape_devices : \@no_devices);
my $box_where_tape;
local $_;
gtkpack($advanced_box,
- $box_where_tape = gtkpack_(new Gtk2::VBox(0, 6),
- 0, new Gtk2::HSeparator,
- 0, my $check_where_tape = new Gtk2::CheckButton(N("Use tape to backup")),
- 0, new Gtk2::HSeparator,
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Device name to use for backup")), $conf{USE_TAPE}),
- 1, new Gtk2::VBox(0, 6),
+ $box_where_tape = gtkpack_(Gtk2::VBox->new(0, 6),
+ 0, Gtk2::HSeparator->new,
+ 0, my $check_where_tape = Gtk2::CheckButton->new(N("Use tape to backup")),
+ 0, Gtk2::HSeparator->new,
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Device name to use for backup")), $conf{USE_TAPE}),
+ 1, Gtk2::VBox->new(0, 6),
0, gtkset_sensitive($combo_where_tape_device, $conf{USE_TAPE}),
),
- 0, new Gtk2::VBox(0, 5),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Don't rewind tape after backup")), $conf{USE_TAPE}),
- 1, new Gtk2::VBox(0, 5),
- 0, gtkset_sensitive(my $check_tape_rewind = new Gtk2::CheckButton(), $conf{USE_TAPE}),
+ 0, Gtk2::VBox->new(0, 5),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Backup directly to tape")), $conf{USE_TAPE}),
+ 1, Gtk2::VBox->new(0, 5),
+ 0, gtkset_sensitive(my $direct_to_tape = Gtk2::CheckButton->new, $conf{USE_TAPE}),
),
- 0, new Gtk2::VBox(0, 5),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Erase tape before backup")), $conf{USE_TAPE}),
- 1, new Gtk2::VBox(0, 5),
- 0, gtkset_sensitive(my $check_tape_erase = new Gtk2::CheckButton(), $conf{USE_TAPE}),
+ 0, Gtk2::VBox->new(0, 5),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Don't rewind tape after backup")), $conf{USE_TAPE}),
+ 1, Gtk2::VBox->new(0, 5),
+ 0, gtkset_sensitive(my $check_tape_rewind = Gtk2::CheckButton->new, $conf{USE_TAPE}),
),
- 0, new Gtk2::VBox(0, 5),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Eject tape after the backup")), $conf{USE_TAPE}),
- 1, new Gtk2::VBox(0, 5),
- 0, gtkset_sensitive(my $check_tape_eject = new Gtk2::CheckButton(), $conf{USE_TAPE}),
+ 0, Gtk2::VBox->new(0, 5),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Erase tape before backup")), $conf{USE_TAPE}),
+ 1, Gtk2::VBox->new(0, 5),
+ 0, gtkset_sensitive(my $check_tape_erase = Gtk2::CheckButton->new, $conf{USE_TAPE}),
),
- 0, new Gtk2::VBox(0, 6),
- 0, gtkpack_(new Gtk2::HBox(0,10),),
+ 0, Gtk2::VBox->new(0, 5),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Eject tape after the backup")), $conf{USE_TAPE}),
+ 1, Gtk2::VBox->new(0, 5),
+ 0, gtkset_sensitive(my $check_tape_eject = Gtk2::CheckButton->new, $conf{USE_TAPE}),
+ ),
+ 0, Gtk2::VBox->new(0, 6),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),),
),
);
gtksignal_connect(gtkset_active($check_where_tape, $conf{USE_TAPE}), toggled => sub {
@@ -1902,6 +1924,11 @@ sub advanced_where_tape {
destroy_widget();
$current_widget->($previous_function);
});
+ gtksignal_connect(gtkset_active($direct_to_tape, $conf{DIRECT_TAPE}), toggled => sub {
+ $conf{DIRECT_TAPE} = $conf{DIRECT_TAPE} ? 0 : 1;
+ destroy_widget();
+ $current_widget->($previous_function);
+ });
gtksignal_connect(gtkset_active($check_tape_erase, $conf{MEDIA_ERASE}), toggled => sub {
$conf{MEDIA_ERASE} = $conf{MEDIA_ERASE} ? 0 : 1;
destroy_widget();
@@ -1912,7 +1939,7 @@ sub advanced_where_tape {
destroy_widget();
$current_widget->($previous_function);
});
- $combo_where_tape_device->entry->set_text($conf{TAPE_DEVICE});
+ $combo_where_tape_device->entry->set_text($conf{TAPE_DEVICE}) if $conf{TAPE_DEVICE};
$combo_where_tape_device->entry->signal_connect('changed', sub {
$conf{TAPE_DEVICE} = $combo_where_tape_device->entry->get_text;
});
@@ -1932,29 +1959,29 @@ sub advanced_where_hd {
if ($conf{MAX_SPACE} == 1000.0) {
$conf{MAX_SPACE} = int(0.8 * get_free_space($conf{PATH_TO_SAVE})) if -d $conf{PATH_TO_SAVE};
}
- my $adj = new Gtk2::Adjustment($conf{MAX_SPACE}, 0.0, $conf{MAX_SPACE}, 10.0, 5.0, 0.0);
+ my $adj = Gtk2::Adjustment->new($conf{MAX_SPACE}, 0.0, $conf{MAX_SPACE}, 10.0, 5.0, 0.0);
my $spinner;
gtkpack($advanced_box,
- $box_where_hd = gtkpack_(new Gtk2::VBox(0, 6),
- 0, new Gtk2::HSeparator,
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Enter the directory to save to:")), $conf{USE_HD}),
- 1, new Gtk2::VBox(0, 6),
- 0, gtkset_size_request(gtkset_sensitive($save_path_entry = new Gtk2::Entry(), $conf{USE_HD}), 152, 20),
+ $box_where_hd = gtkpack_(Gtk2::VBox->new(0, 6),
+ 0, Gtk2::HSeparator->new,
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Enter the directory to save to:")), $conf{USE_HD}),
+ 1, Gtk2::VBox->new(0, 6),
+ 0, gtkset_size_request(gtkset_sensitive($save_path_entry = Gtk2::Entry->new, $conf{USE_HD}), 152, 20),
0, gtkset_sensitive($button = gtksignal_connect(Gtk2::Button->new, clicked => sub {
- filedialog_generic(N("Directory to save to"), \$save_path_entry)
+ filedialog_generic(N("Directory to save to"), \$save_path_entry);
}), $conf{USE_HD}),
),
- 0, new Gtk2::VBox(0, 6),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Maximum size\n allowed for Drakbackup (MB)")), $conf{USE_HD}),
- 1, new Gtk2::VBox(0, 6),
- 0, gtkset_size_request(gtkset_sensitive($spinner = new Gtk2::SpinButton($adj, 0, 0), $conf{USE_HD}), 200, 20),
+ 0, Gtk2::VBox->new(0, 6),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Maximum size\n allowed for Drakbackup (MB)")), $conf{USE_HD}),
+ 1, Gtk2::VBox->new(0, 6),
+ 0, gtkset_size_request(gtkset_sensitive($spinner = Gtk2::SpinButton->new($adj, 0, 0), $conf{USE_HD}), 200, 20),
),
),
);
- $button->add(gtkpack(new Gtk2::HBox(0,10), gtkcreate_img("ic82-dossier-32")));
+ $button->add(gtkpack(Gtk2::HBox->new(0,10), gtkcreate_img("ic82-dossier-32")));
$save_path_entry->set_text($conf{PATH_TO_SAVE});
$spinner->signal_connect('changed', sub { $conf{MAX_SPACE} = $spinner->get_text });
$save_path_entry->signal_connect('changed', sub {
@@ -1980,50 +2007,50 @@ sub advanced_where() {
my $box_where;
gtkpack($advanced_box,
- $box_where = gtkpack_(new Gtk2::HBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
- 1, gtkpack_(new Gtk2::VBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
+ $box_where = gtkpack_(Gtk2::HBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
+ 1, gtkpack_(Gtk2::VBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
1, gtksignal_connect(my $button_where_net = Gtk2::Button->new, clicked => sub {
destroy_widget();
- advanced_where_net_types();
+ advanced_where_net_types(undef);
}),
1, gtksignal_connect(my $button_where_cd = Gtk2::Button->new, clicked => sub {
destroy_widget();
- advanced_where_cd();
+ advanced_where_cd(undef);
}),
1, gtksignal_connect(my $button_where_hd = Gtk2::Button->new, clicked => sub {
destroy_widget();
- advanced_where_hd();
+ advanced_where_hd(undef);
}),
1, gtksignal_connect(my $button_where_tape = Gtk2::Button->new, clicked => sub {
destroy_widget();
- advanced_where_tape()
+ advanced_where_tape(undef);
}),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
);
- $button_where_net->add(gtkpack(new Gtk2::HBox(0,10),
+ $button_where_net->add(gtkpack(Gtk2::HBox->new(0,10),
gtkcreate_img("ic82-network-40"),
- new Gtk2::Label(N("Network")),
- new Gtk2::HBox(0, 5)
+ Gtk2::Label->new(N("Network")),
+ Gtk2::HBox->new(0, 5)
));
- $button_where_cd->add(gtkpack(new Gtk2::HBox(0,10),
+ $button_where_cd->add(gtkpack(Gtk2::HBox->new(0,10),
gtkcreate_img("ic82-CD-40"),
- new Gtk2::Label(N("CD-R / DVD-R")),
- new Gtk2::HBox(0, 5)
+ Gtk2::Label->new(N("CD-R / DVD-R")),
+ Gtk2::HBox->new(0, 5)
));
- $button_where_hd->add(gtkpack(new Gtk2::HBox(0,10),
+ $button_where_hd->add(gtkpack(Gtk2::HBox->new(0,10),
gtkcreate_img("ic82-discdurwhat-40"),
- new Gtk2::Label(N("HardDrive / NFS")),
- new Gtk2::HBox(0, 5)
+ Gtk2::Label->new(N("HardDrive / NFS")),
+ Gtk2::HBox->new(0, 5)
));
- $button_where_tape->add(gtkpack(new Gtk2::HBox(0,10),
+ $button_where_tape->add(gtkpack(Gtk2::HBox->new(0,10),
gtkcreate_img("ic82-tape-40"),
- new Gtk2::Label(N("Tape")),
- new Gtk2::HBox(0, 5)
+ Gtk2::Label->new(N("Tape")),
+ Gtk2::HBox->new(0, 5)
));
fonction_env(\$box_where, \&advanced_where, \&advanced_box);
$up_box->show_all;
@@ -2032,7 +2059,7 @@ sub advanced_where() {
sub advanced_when() {
my $box_when;
my $allow_custom = $backup_daemon && $custom_cron;
- my $combo_when_space = Gtk2::ComboBox->new_text;
+ my $combo_when_space = Gtk2::ComboBox->new_with_strings([ "", N("hourly"), N("daily"), N("weekly"), N("monthly"), N("custom") ]);
my %trans = (N("hourly") => 'hourly',
N("daily") => 'daily',
N("weekly") => 'weekly',
@@ -2043,27 +2070,22 @@ sub advanced_when() {
'weekly' => N("weekly"),
'monthly' => N("monthly"),
'custom' => N("custom"));
- $combo_when_space->set_popdown_strings("", N("hourly"), N("daily"), N("weekly"), N("monthly"), N("custom"));
set_help_tip($combo_when_space, 'when_space');
#- custom setup - let user specify month, day of month, day of week, hour, minute
- my $combo_month_when = Gtk2::ComboBox->new_text;
my @months = ("*", N("January"), N("February"), N("March"),
N("April"), N("May"), N("June"), N("July"), N("August"), N("September"),
N("October"), N("November"), N("December"));
- $combo_month_when->set_popdown_strings(@months);
- my $combo_day_when = Gtk2::ComboBox->new_text;
- $combo_day_when->set_popdown_strings("*", (1..31));
- my $combo_weekday_when = Gtk2::ComboBox->new_text;
+ my $combo_month_when = Gtk2::ComboBox->new_with_strings(\@months);
+ my $combo_day_when = Gtk2::ComboBox->new_with_strings([ "*", (1..31) ]);
my @weekdays = ("*", N("Sunday"), N("Monday"), N("Tuesday"),
N("Wednesday"), N("Thursday"), N("Friday"), N("Saturday"));
- $combo_weekday_when->set_popdown_strings(@weekdays);
+ my $combo_weekday_when = Gtk2::ComboBox->new_with_strings(\@weekdays);
my $combo_hour_when = Gtk2::ComboBox->new_text;
$combo_hour_when->set_popdown_strings("*", (0..23));
- my $combo_minute_when = Gtk2::ComboBox->new_text;
- $combo_minute_when->set_popdown_strings("*", (0..59));
+ my $combo_minute_when = Gtk2::ComboBox->new_with_strings([ "*", (0..59) ]);
- my $entry_crontab = new Gtk2::Entry();
+ my $entry_crontab = Gtk2::Entry->new;
gtkset_editable($entry_crontab, 0);
my @time_list = split(" ", $time_string);
@@ -2082,62 +2104,60 @@ sub advanced_when() {
}
#- drop down list of possible media - default to config value
- my $entry_media_type = Gtk2::ComboBox->new_text;
- $entry_media_type->set_popdown_strings(sort(@net_methods, @media_types));
- $entry_media_type->entry->set_text($conf{DAEMON_MEDIA});
+ my $entry_media_type = Gtk2::ComboBox->new_with_strings([ sort(@net_methods, @media_types) ], $conf{DAEMON_MEDIA});
gtkpack($advanced_box,
- $box_when = gtkpack_(new Gtk2::VBox(0, 10),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 1, new Gtk2::HBox(0,10),
+ $box_when = gtkpack_(Gtk2::VBox->new(0, 10),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 1, Gtk2::HBox->new(0,10),
1, gtkcreate_img("ic82-when-40"),
- 0, my $check_when_daemon = new Gtk2::CheckButton(N("Use daemon")),
- 1, new Gtk2::HBox(0,10),
+ 0, my $check_when_daemon = Gtk2::CheckButton->new(N("Use daemon")),
+ 1, Gtk2::HBox->new(0,10),
),
- 0, new Gtk2::HSeparator,
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Please choose the time interval between each backup")), $backup_daemon),
- 1, new Gtk2::HBox(0,10),
+ 0, Gtk2::HSeparator->new,
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Please choose the time interval between each backup")), $backup_daemon),
+ 1, Gtk2::HBox->new(0,10),
0, gtkset_sensitive($combo_when_space, $backup_daemon),
),
- 0, new Gtk2::HSeparator,
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Custom setup/crontab entry:")), $allow_custom),
+ 0, Gtk2::HSeparator->new,
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Custom setup/crontab entry:")), $allow_custom),
1, gtkset_sensitive($entry_crontab, $allow_custom),
),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 1, gtkpack_(new Gtk2::VBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Minute")), $allow_custom),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 1, gtkpack_(Gtk2::VBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Minute")), $allow_custom),
0, gtkset_sensitive($combo_minute_when, $allow_custom),
),
- 1, gtkpack_(new Gtk2::VBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Hour")), $allow_custom),
+ 1, gtkpack_(Gtk2::VBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Hour")), $allow_custom),
0, gtkset_sensitive($combo_hour_when, $allow_custom),
),
- 1, gtkpack_(new Gtk2::VBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Day")), $allow_custom),
+ 1, gtkpack_(Gtk2::VBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Day")), $allow_custom),
0, gtkset_sensitive($combo_day_when, $allow_custom),
),
- 1, gtkpack_(new Gtk2::VBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Month")), $allow_custom),
+ 1, gtkpack_(Gtk2::VBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Month")), $allow_custom),
0, gtkset_sensitive($combo_month_when, $allow_custom),
),
- 1, gtkpack_(new Gtk2::VBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Weekday")), $allow_custom),
+ 1, gtkpack_(Gtk2::VBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Weekday")), $allow_custom),
0, gtkset_sensitive($combo_weekday_when, $allow_custom),
),
),
- 0, new Gtk2::HSeparator,
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Please choose the media for backup.")), $backup_daemon),
- 1, new Gtk2::HBox(0,10),
- 0, gtkpack_(new Gtk2::VBox(0,10),
+ 0, Gtk2::HSeparator->new,
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Please choose the media for backup.")), $backup_daemon),
+ 1, Gtk2::HBox->new(0,10),
+ 0, gtkpack_(Gtk2::VBox->new(0,10),
0, gtkset_sensitive($entry_media_type, $backup_daemon),
),
),
- 0, new Gtk2::HSeparator,
- 0, gtkset_sensitive(new Gtk2::Label(N("Please be sure that the cron daemon is included in your services.")), $backup_daemon),
- 0, gtkset_sensitive(new Gtk2::Label(N("Note that currently all 'net' media also use the hard drive.")), $backup_daemon),
+ 0, Gtk2::HSeparator->new,
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Please be sure that the cron daemon is included in your services.")), $backup_daemon),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Note that currently all 'net' media also use the hard drive.")), $backup_daemon),
),
);
@@ -2154,15 +2174,14 @@ sub advanced_when() {
advanced_when();
});
if ($custom_cron) {
- $entry_crontab->set_text("$time_string $exec_string")
+ $entry_crontab->set_text("$time_string $exec_string");
}
- $combo_minute_when->entry->signal_connect('changed', sub { combo_to_cron_string($combo_minute_when->get_history - 1, 0) });
- $combo_hour_when->entry->signal_connect('changed', sub { combo_to_cron_string($combo_hour_when->get_history - 1, 1) });
- $combo_day_when->entry->signal_connect('changed', sub { combo_to_cron_string($combo_day_when->get_history, 2) });
- $combo_month_when->entry->signal_connect('changed', sub { combo_to_cron_string($combo_month_when->get_history, 3) });
- $combo_weekday_when->entry->signal_connect('changed', sub { combo_to_cron_string($combo_weekday_when->get_history - 1, 4) });
-
+ $combo_minute_when->entry->signal_connect('changed', sub { combo_to_cron_string($combo_minute_when->get_text, 0) });
+ $combo_hour_when->entry->signal_connect('changed', sub { combo_to_cron_string($combo_hour_when->get_text, 1) });
+ $combo_day_when->entry->signal_connect('changed', sub { combo_to_cron_string($combo_day_when->get_text, 2) });
+ $combo_month_when->entry->signal_connect('changed', sub { combo_to_cron_string($combo_month_when->get_active, 3) });
+ $combo_weekday_when->entry->signal_connect('changed', sub { combo_to_cron_string($combo_weekday_when->get_active - 1, 4) });
$entry_media_type->entry->signal_connect('changed', sub { $conf{DAEMON_MEDIA} = $entry_media_type->entry->get_text });
fonction_env(\$box_when, \&advanced_when, \&advanced_box);
$up_box->show_all;
@@ -2170,8 +2189,8 @@ sub advanced_when() {
sub combo_to_cron_string {
my ($field, $location) = @_;
- $field = "*" if $field == 0 && $location > 1 && $location < 4;
- $field = "*" if $field == -1 && ($location < 2 || $location == 4);
+ $field = "*" if $field == 0 && $location == 3;
+ $field = "*" if $field == -1 && $location == 4;
my @time_list = split(" ", $time_string);
splice(@time_list, $location, 1, $field);
$time_string = join(" ", @time_list);
@@ -2181,30 +2200,28 @@ sub combo_to_cron_string {
sub advanced_options() {
my $box_options;
- my $entry_comp_mode = Gtk2::ComboBox->new_text;
- $entry_comp_mode->set_popdown_strings("tar", "tar.gz", "tar.bz2");
- $entry_comp_mode->entry->set_text($conf{OPTION_COMP});
+ my $entry_comp_mode = Gtk2::ComboBox->new_with_strings([ "tar", "tar.gz", "tar.bz2" ], $conf{OPTION_COMP});
gtkpack($advanced_box,
- $box_options = gtkpack_(new Gtk2::VBox(0, 15),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, new Gtk2::Label(N("Please choose the compression type")),
- 1, new Gtk2::HBox(0,10),
+ $box_options = gtkpack_(Gtk2::VBox->new(0, 15),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, Gtk2::Label->new(N("Please choose the compression type")),
+ 1, Gtk2::HBox->new(0,10),
0, $entry_comp_mode,
),
- 0, my $check_backupignore = new Gtk2::CheckButton(N("Use .backupignore files")),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, my $check_mail = new Gtk2::CheckButton(N("Send mail report after each backup to:")),
- 1, new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(my $mail_entry = new Gtk2::Entry(), $conf{SEND_MAIL}),
+ 0, my $check_backupignore = Gtk2::CheckButton->new(N("Use .backupignore files")),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, my $check_mail = Gtk2::CheckButton->new(N("Send mail report after each backup to:")),
+ 1, Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(my $mail_entry = Gtk2::Entry->new, $conf{SEND_MAIL}),
),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 1, new Gtk2::HBox(0,10),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 1, Gtk2::HBox->new(0,10),
0, N("SMTP server for mail:"),
- 1, new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(my $smtp_entry = new Gtk2::Entry(), $conf{SEND_MAIL}),
+ 1, Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(my $smtp_entry = Gtk2::Entry->new, $conf{SEND_MAIL}),
),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, my $check_del_hd_files = new Gtk2::CheckButton(N("Delete Hard Drive tar files after backup to other media.")),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, my $check_del_hd_files = Gtk2::CheckButton->new(N("Delete Hard Drive tar files after backup to other media.")),
),
),
);
@@ -2225,10 +2242,10 @@ sub advanced_box() {
my $box_adv;
gtkpack($advanced_box,
- $box_adv = gtkpack_(new Gtk2::HBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
- 1, gtkpack_(new Gtk2::VBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
+ $box_adv = gtkpack_(Gtk2::HBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
+ 1, gtkpack_(Gtk2::VBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
1, gtksignal_connect(my $button_what = Gtk2::Button->new, clicked => sub {
destroy_widget(); advanced_what() }),
1, gtksignal_connect(my $button_where = Gtk2::Button->new, clicked => sub {
@@ -2237,30 +2254,30 @@ sub advanced_box() {
destroy_widget(); advanced_when() }),
1, gtksignal_connect(my $button_options = Gtk2::Button->new, clicked => sub {
destroy_widget(); advanced_options() }),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
);
- $button_what->add(gtkpack(new Gtk2::HBox(0,10),
+ $button_what->add(gtkpack(Gtk2::HBox->new(0,10),
gtkcreate_img("ic82-discdurwhat-40"),
- new Gtk2::Label(N("What")),
- new Gtk2::HBox(0, 5)
+ Gtk2::Label->new(N("What")),
+ Gtk2::HBox->new(0, 5)
));
- $button_where->add(gtkpack(new Gtk2::HBox(0,10),
+ $button_where->add(gtkpack(Gtk2::HBox->new(0,10),
gtkcreate_img("ic82-where-40"),
- new Gtk2::Label(N("Where")),
- new Gtk2::HBox(0, 5)
+ Gtk2::Label->new(N("Where")),
+ Gtk2::HBox->new(0, 5)
));
- $button_when->add(gtkpack(new Gtk2::HBox(0,10),
+ $button_when->add(gtkpack(Gtk2::HBox->new(0,10),
gtkcreate_img("ic82-when-40"),
- new Gtk2::Label(N("When")),
- new Gtk2::HBox(0, 5)
+ Gtk2::Label->new(N("When")),
+ Gtk2::HBox->new(0, 5)
));
- $button_options->add(gtkpack(new Gtk2::HBox(0,10),
+ $button_options->add(gtkpack(Gtk2::HBox->new(0,10),
gtkcreate_img("ic82-moreoption-40"),
- new Gtk2::Label(N("More Options")),
- new Gtk2::HBox(0, 5)
+ Gtk2::Label->new(N("More Options")),
+ Gtk2::HBox->new(0, 5)
));
fonction_env(\$box_adv, \&advanced_box, \&interactive_mode_box);
$up_box->show_all;
@@ -2270,17 +2287,19 @@ sub advanced_box() {
sub wizard_step3() {
destroy_widget();
- my $no_device = 1 if $conf{USE_CD} && $conf{CD_DEVICE} eq '' || $conf{USE_TAPE} && $conf{TAPE_DEVICE} eq '' || $conf{USE_NET} && $conf{NET_PROTO} eq '';
+ my $no_device = $conf{USE_CD} && $conf{CD_DEVICE} eq '' || $conf{USE_TAPE} && $conf{TAPE_DEVICE} eq '' || $conf{USE_NET} && $conf{NET_PROTO} eq '' && 1;
if ($no_device) {
show_warning("f", N("Backup destination not configured..."));
- wizard_step2();
+ advanced_where_net_types(\&wizard_step2) if $conf{USE_NET};
+ advanced_where_cd(\&wizard_step2) if $conf{USE_CD};
+ advanced_where_tape(\&wizard_step2) if $conf{USE_TAPE};
return;
}
if (check_pkg_needs()) {
install_rpm(\&wizard_step3, undef);
return;
}
- my $text = new Gtk2::TextView;
+ my $text = Gtk2::TextView->new;
save_conf_file();
read_conf_file();
system_state();
@@ -2288,8 +2307,8 @@ sub wizard_step3() {
button_box_restore_main();
gtkpack($advanced_box,
- $box2 = gtkpack_(new Gtk2::HBox(0, 15),
- 1, gtkpack_(new Gtk2::VBox(0,10),
+ $box2 = gtkpack_(Gtk2::HBox->new(0, 15),
+ 1, gtkpack_(Gtk2::VBox->new(0,10),
0, N("Drakbackup Configuration"),
1, create_scrolled_window($text),
),
@@ -2302,74 +2321,58 @@ sub wizard_step3() {
sub wizard_step2() {
gtkpack($advanced_box,
- $box2 = gtkpack_(new Gtk2::HBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
- 1, gtkpack_(new Gtk2::VBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
+ $box2 = gtkpack_(Gtk2::HBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
+ 1, gtkpack_(Gtk2::VBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
0, N("Please choose where you want to backup"),
- 0, gtkpack_(new Gtk2::HBox(0, 15),
- 0, N("Hard Drive used to prepare backups for all media"),
- 1, new Gtk2::VBox(0, 5),
+ 0, gtkpack_(Gtk2::HBox->new(0, 15),
+ 0, gtkpack__(Gtk2::VBox->new(0, 10),
+ my @where_radio = gtkradio('', N("Hard Drive used to prepare backups for all media"), N("Across Network"), N("On CD-R"), N("On Tape Device")),
+ ),
+ 1, gtkpack_(Gtk2::HBox->new(0,5),),
+ 0, gtkpack_(Gtk2::VBox->new(0,5),
0, gtkset_sensitive(gtksignal_connect(Gtk2::Button->new(N("Configure")), clicked => sub {
destroy_widget();
advanced_where_hd(\&wizard_step2);
}), $use_hd),
- ),
- 0, gtkpack_(new Gtk2::HBox(0, 15),
- 0, my $check_wizard_net = new Gtk2::CheckButton(N("Across Network")),
- 1, new Gtk2::VBox(0, 5),
0, gtkset_sensitive(gtksignal_connect(Gtk2::Button->new(N("Configure")), clicked => sub {
destroy_widget();
advanced_where_net_types(\&wizard_step2);
}), $conf{USE_NET}),
- ),
- 0, gtkpack_(new Gtk2::HBox(0, 15),
- 0, my $check_wizard_cd = new Gtk2::CheckButton(N("On CD-R")),
- 1, new Gtk2::VBox(0, 5),
- 0, gtkset_sensitive(gtksignal_connect(Gtk2::Button->new(N("Configure")), clicked => sub {
+ 0, gtkset_sensitive(gtksignal_connect(Gtk2::Button->new(N("Configure")), clicked => sub {
destroy_widget();
advanced_where_cd(\&wizard_step2);
- }), $conf{USE_CD}),
- ),
- 0, gtkpack_(new Gtk2::HBox(0, 15),
- 0, my $check_wizard_tape = new Gtk2::CheckButton(N("On Tape Device")),
- 1, new Gtk2::VBox(0, 5),
- 0, gtkset_sensitive(gtksignal_connect(Gtk2::Button->new(N("Configure")), clicked => sub {
+ }), $conf{USE_CD}),
+ 0, gtkset_sensitive(gtksignal_connect(Gtk2::Button->new(N("Configure")), clicked => sub {
destroy_widget();
advanced_where_tape(\&wizard_step2);
}), $conf{USE_TAPE}),
- ),
- 1, new Gtk2::VBox(0, 5),
+ ),
+ ),
+ 1, Gtk2::VBox->new(0, 5),
),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
);
- gtksignal_connect(gtkset_active($check_wizard_cd, $conf{USE_CD}), toggled => sub {
- invbool \$conf{USE_CD};
- if ($conf{USE_CD}) { $conf{USE_TAPE} = 0; $conf{USE_NET} = 0 };
- refresh_wizard_step2();
- });
- gtksignal_connect(gtkset_active($check_wizard_net, $conf{USE_NET}), toggled => sub {
- invbool \$conf{USE_NET};
- if ($conf{USE_NET}) { $conf{USE_TAPE} = 0; $conf{USE_CD} = 0 };
- refresh_wizard_step2();
- });
- gtksignal_connect(gtkset_active($check_wizard_tape, $conf{USE_TAPE}), toggled => sub {
- invbool \$conf{USE_TAPE};
- if ($conf{USE_TAPE}) { $conf{USE_CD} = 0; $conf{USE_NET} = 0 };
- refresh_wizard_step2();
- });
+ my @wheres = ($use_hd, $conf{USE_NET}, $conf{USE_CD}, $conf{USE_TAPE});
+ foreach my $i (0..3) {
+ $where_radio[$i]->set_active($wheres[$i]);
+ $where_radio[$i]->signal_connect(toggled => sub {
+ if ($where_radio[$i]->get_active) {
+ @wheres = (0, 0, 0, 0);
+ $wheres[$i] = 1;
+ ($use_hd, $conf{USE_NET}, $conf{USE_CD}, $conf{USE_TAPE}) = @wheres;
+ destroy_widget();
+ wizard_step2();
+ }
+ });
+ }
fonction_env(\$box2, \&wizard_step2, \&wizard, undef);
button_box_wizard();
$up_box->show_all;
}
-sub refresh_wizard_step2() {
- $use_hd = !($conf{USE_TAPE} || $conf{USE_CD} || $conf{USE_NET});
- destroy_widget();
- wizard_step2();
-}
-
sub wizard() {
my $user_string = N("Backup Users");
$user_string .= N(" (Default is all users)") if !$nonroot_user;
@@ -2380,21 +2383,21 @@ sub wizard() {
}
gtkpack($advanced_box,
- $box2 = gtkpack_(new Gtk2::HBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
- 1, gtkpack_(new Gtk2::VBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
+ $box2 = gtkpack_(Gtk2::HBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
+ 1, gtkpack_(Gtk2::VBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
0, N("Please choose what you want to backup"),
- 0, my $check_wizard_sys = new Gtk2::CheckButton(N("Backup System")),
- 0, my $check_wizard_user = new Gtk2::CheckButton($user_string),
+ 0, my $check_wizard_sys = Gtk2::CheckButton->new(N("Backup System")),
+ 0, my $check_wizard_user = Gtk2::CheckButton->new($user_string),
0, gtksignal_connect(Gtk2::Button->new(N("Select user manually")), clicked => sub {
$manual_user = 1;
destroy_widget();
advanced_what_user(\&wizard);
}),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
);
foreach ([$check_wizard_sys, \$conf{NO_SYS_FILES}], [$check_wizard_user, \$conf{NO_USER_FILES}]) {
@@ -2411,7 +2414,7 @@ sub wizard() {
} else {
@user_list = ();
}
- })
+ });
}
if (!$conf{NO_SYS_FILES} || !$conf{NO_USER_FILES} && @user_list) {
fonction_env(\$box2, \&wizard, \&interactive_mode_box, \&wizard_step2);
@@ -2503,16 +2506,16 @@ sub system_state() {
}
#- tape and CDRW share some features
- my $erase_media = N("NO");
- $erase_media = N("YES") if $conf{MEDIA_ERASE} && ($conf{USE_CD} || $conf{USE_TAPE});
+ my $erase_media = $conf{MEDIA_ERASE} && ($conf{USE_CD} || $conf{USE_TAPE}) ? N("Yes") : N("No");
$conf{USE_CD} and $system_state .= N("\n- Burn to CD");
$conf{USE_CD} and $conf{CDRW} and $system_state .= N("RW");
$conf{USE_CD} and $system_state .= N(" on device: %s", $conf{CD_DEVICE});
- $conf{USE_CD} and $conf{MULTI_SESSION} and $system_state .= N(" (multi-session)");
+ $conf{USE_CD} && $conf{MULTI_SESSION} and $system_state .= N(" (multi-session)");
$conf{USE_TAPE} and $system_state .= N("\n- Save to Tape on device: %s", $conf{TAPE_DEVICE});
(($conf{USE_CD} || $conf{USE_TAPE}) && $conf{MEDIA_ERASE}) and $system_state .= N("\t\tErase=%s", $erase_media);
$conf{USE_CD} || $conf{USE_TAPE} and $system_state .= "\n";
-
+ $conf{USE_TAPE} && $conf{DIRECT_TAPE} and $system_state .= N("\tBackup directly to Tape\n");
+
$conf{USE_NET} and $system_state .= N("\n- Save via %s on host: %s\n", $conf{NET_PROTO}, $conf{HOST_NAME});
$conf{USE_NET} and $system_state .= N("\t\t user name: %s\n\t\t on path: %s \n", $conf{LOGIN}, $conf{HOST_PATH});
$system_state .= N("\n- Options:\n");
@@ -2563,10 +2566,8 @@ sub restore_state() {
sub select_most_recent_selected_of {
my ($user_name) = @_;
- my @list_tmp2;
- local $_;
my @tmp = sort @user_list_to_restore2;
- foreach (grep { /$user_name/ } sort @tmp) { push @list_tmp2 , $_ }
+ my @list_tmp2 = grep { /$user_name/ } sort @tmp;
return pop @list_tmp2;
}
@@ -2578,7 +2579,7 @@ sub select_user_data_to_restore() {
@user_list_to_restore = ();
local $_;
- -d $path_to_find_restore and my @list_backup_tmp2 = grep { /^backup/ } all($path_to_find_restore);
+ my @list_backup_tmp2 = -d $path_to_find_restore && grep { /^backup/ } all($path_to_find_restore);
@list_tmp2 = @list_backup_tmp2;
foreach (@list_backup_tmp2) {
s/_base//gi;
@@ -2688,23 +2689,23 @@ sub show_backup_details {
log::explanations("Running $command1");
$archive_file_detail = `$command1 2>&1` . "\n\n";
log::explanations("Running $command2");
- local *TMP;
- open TMP, "$command2 2>&1 |";
- while ($value = <TMP>) {
+ my $TMP;
+ open $TMP, "$command2 2>&1 |";
+ while ($value = <$TMP>) {
#- drop the permissions display for the sake of readability
$archive_file_detail .= substr($value, 11);
}
- close TMP;
+ close $TMP;
- my $text = new Gtk2::TextView;
+ my $text = Gtk2::TextView->new;
my $advanced_box_archive;
gtktext_insert(gtkset_editable($text, 0), $archive_file_detail);
gtkpack($advanced_box,
- $advanced_box_archive = gtkpack_(new Gtk2::VBox(0,10),
- 1, gtkpack_(new Gtk2::HBox(0,0),
+ $advanced_box_archive = gtkpack_(Gtk2::VBox->new(0,10),
+ 1, gtkpack_(Gtk2::HBox->new(0,0),
1, create_scrolled_window($text),
),
- 0, gtkadd(gtkset_layout(new Gtk2::HButtonBox, 'spread'),
+ 0, gtkadd(gtkset_layout(Gtk2::HButtonBox->new, 'spread'),
gtksignal_connect(Gtk2::Button->new(N("Done")), clicked => sub {
destroy_widget();
$function->() }),
@@ -2732,7 +2733,7 @@ sub valid_backup_test {
sub restore_aff_backup_problems() {
my $do_restore;
- my $text = new Gtk2::TextView;
+ my $text = Gtk2::TextView->new;
my $restore_pbs_state = N("List of data corrupted:\n\n");
$restore_pbs_state .= "\t\t$_\n" foreach @files_corrupted;
$restore_pbs_state .= N("Please uncheck or remove it on next time.");
@@ -2740,15 +2741,15 @@ sub restore_aff_backup_problems() {
button_box_restore_main();
gtkpack($advanced_box,
- $do_restore = gtkpack_(new Gtk2::VBox(0,10),
- 0, new Gtk2::VBox(0,10),
- 1, gtkpack_(new Gtk2::HBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
+ $do_restore = gtkpack_(Gtk2::VBox->new(0,10),
+ 0, Gtk2::VBox->new(0,10),
+ 1, gtkpack_(Gtk2::HBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
0, gtkcreate_img('warning'),
0, N("Backup files are corrupted"),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
- 0, new Gtk2::VBox(0,10),
+ 0, Gtk2::VBox->new(0,10),
1, create_scrolled_window($text),
),
);
@@ -2759,16 +2760,16 @@ sub restore_aff_backup_problems() {
sub restore_aff_result() {
my $do_restore;
- my $text = new Gtk2::TextView;
+ my $text = Gtk2::TextView->new;
gtktext_insert($text, [ [ $restore_state ] ]);
button_box_restore_main();
gtkpack($advanced_box,
- $do_restore = gtkpack_(new Gtk2::VBox(0,10),
- 1, new Gtk2::VBox(0,10),
+ $do_restore = gtkpack_(Gtk2::VBox->new(0,10),
+ 1, Gtk2::VBox->new(0,10),
0, N(" All of your selected data have been "),
- 0, N(" Successfuly Restored on %s ", $restore_path),
- 1, new Gtk2::VBox(0,10),
+ 0, N(" Successfully Restored on %s ", $restore_path),
+ 1, Gtk2::VBox->new(0,10),
),
);
button_box_ok_only();
@@ -2880,13 +2881,13 @@ sub restore_do() {
sub restore_do2() {
destroy_widget();
my $do_restore;
- my $text = new Gtk2::TextView;
+ my $text = Gtk2::TextView->new;
restore_state();
gtktext_insert($text, [ [ $restore_state ] ]);
button_box_restore_main();
gtkpack($advanced_box,
- $do_restore = gtkpack_(new Gtk2::VBox(0,10),
+ $do_restore = gtkpack_(Gtk2::VBox->new(0,10),
0, N(" Restore Configuration "),
1, create_scrolled_window($text),
),
@@ -2898,7 +2899,7 @@ sub restore_do2() {
sub restore_step_other() {
my $retore_step_other;
- my $text = new Gtk2::TextView;
+ my $text = Gtk2::TextView->new;
my $untar_cmd = "tar tzf";
my $other_rest = "";
select_other_data_to_restore();
@@ -2912,11 +2913,11 @@ sub restore_step_other() {
}
gtktext_insert($text, [ [ $other_rest ] ]);
gtkpack($advanced_box,
- $retore_step_other = gtkpack_(new Gtk2::VBox(0,10),
- 1, new Gtk2::VBox(0,10),
+ $retore_step_other = gtkpack_(Gtk2::VBox->new(0,10),
+ 1, Gtk2::VBox->new(0,10),
1, create_scrolled_window($text),
- 0, my $check_restore_other_sure = new Gtk2::CheckButton(N("OK to restore the other files.")),
- 1, new Gtk2::VBox(0,10),
+ 0, my $check_restore_other_sure = Gtk2::CheckButton->new(N("OK to restore the other files.")),
+ 1, Gtk2::VBox->new(0,10),
),
);
check_list([$check_restore_other_sure, \$restore_other]);
@@ -2929,21 +2930,21 @@ sub restore_step_user() {
my @tmp_list = sort @user_backuped;
@user_backuped = @tmp_list;
gtkpack($advanced_box,
- $retore_step_user = gtkpack_(new Gtk2::VBox(0,10),
- 0, new Gtk2::VBox(0,10),
+ $retore_step_user = gtkpack_(Gtk2::VBox->new(0,10),
+ 0, Gtk2::VBox->new(0,10),
0, N("User list to restore (only the most recent date per user is important)"),
- 1, create_scrolled_window(gtkpack__(new Gtk2::VBox(0,0),
+ 1, create_scrolled_window(gtkpack__(Gtk2::VBox->new(0,0),
map { my $name;
my $var2;
my $name_complet = $_;
$name = (split(' ', $name_complet))[0];
my @user_list_tmp;
- my $restore_row = new Gtk2::HBox(0,5);
- my $b = new Gtk2::CheckButton($name_complet);
+ my $restore_row = Gtk2::HBox->new(0,5);
+ my $b = Gtk2::CheckButton->new($name_complet);
my $details = Gtk2::Button->new(N("Details"));
$restore_row->pack_start($b, 1, 1, 0);
- $restore_row->pack_end(new Gtk2::VBox(1,5), 0, 0, 0);
+ $restore_row->pack_end(Gtk2::VBox->new(1,5), 0, 0, 0);
$restore_row->pack_end($details, 0, 0, 0);
foreach (@user_list_to_restore2) {
@@ -2959,7 +2960,7 @@ sub restore_step_user() {
if (!$check_user_to_restore{$name_complet}[1]) {
$check_user_to_restore{$name_complet}[1] = 1;
if (!any { /$name/ } @user_list_to_restore2) {
- push @user_list_to_restore2, $name_complet
+ push @user_list_to_restore2, $name_complet;
}
} else {
$check_user_to_restore{$name_complet}[1] = 0;
@@ -2993,17 +2994,15 @@ sub restore_step_user() {
sub restore_step_sys() {
my $restore_step_sys;
- my $combo_restore_step_sys = Gtk2::ComboBox->new_text;
- $combo_restore_step_sys->set_popdown_strings(@sys_backuped);
- $combo_restore_step_sys->entry->set_text($restore_step_sys_date);
+ my $combo_restore_step_sys = Gtk2::ComboBox->new_with_strings(\@sys_backuped, $restore_step_sys_date);
gtkpack($advanced_box,
- $restore_step_sys = gtkpack_(new Gtk2::VBox(0,10),
+ $restore_step_sys = gtkpack_(Gtk2::VBox->new(0,10),
0, N("Please choose the date to restore:"),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 1, new Gtk2::HBox(0,10),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 1, Gtk2::HBox->new(0,10),
0, $combo_restore_step_sys,
0, my $details = Gtk2::Button->new(N("Details")),
- 1, new Gtk2::HBox(0,10),
+ 1, Gtk2::HBox->new(0,10),
),
),
);
@@ -3033,19 +3032,19 @@ sub restore_other_media() {
my $button;
gtkpack($advanced_box,
- $box_find_restore = gtkpack_(new Gtk2::VBox(0, 6),
- 0, new Gtk2::HSeparator,
- 0, my $check_other_media_hd = new Gtk2::CheckButton(N("Restore from Hard Disk.")),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, gtkset_sensitive(new Gtk2::Label(N("Enter the directory where backups are stored")), $other_media_hd),
- 1, new Gtk2::VBox(0, 6),
- 0, gtkset_size_request(gtkset_sensitive($restore_find_path_entry = new Gtk2::Entry(), $other_media_hd), 152, 20),
+ $box_find_restore = gtkpack_(Gtk2::VBox->new(0, 6),
+ 0, Gtk2::HSeparator->new,
+ 0, my $check_other_media_hd = Gtk2::CheckButton->new(N("Restore from Hard Disk.")),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, gtkset_sensitive(Gtk2::Label->new(N("Enter the directory where backups are stored")), $other_media_hd),
+ 1, Gtk2::VBox->new(0, 6),
+ 0, gtkset_size_request(gtkset_sensitive($restore_find_path_entry = Gtk2::Entry->new, $other_media_hd), 152, 20),
0, gtkset_sensitive($button = gtksignal_connect(Gtk2::Button->new, clicked => sub {
filedialog_generic(N("Directory with backups"), \$restore_find_path_entry);
}), $other_media_hd),
),
- 1, new Gtk2::VBox(0, 6),
- 0, new Gtk2::VBox(0, 6),
+ 1, Gtk2::VBox->new(0, 6),
+ 0, Gtk2::VBox->new(0, 6),
),
);
gtksignal_connect(gtkset_active($check_other_media_hd, $other_media_hd), toggled => sub {
@@ -3053,7 +3052,7 @@ sub restore_other_media() {
destroy_widget();
$current_widget->();
});
- $button->add(gtkpack(new Gtk2::HBox(0,10), gtkcreate_img("ic82-dossier-32")));
+ $button->add(gtkpack(Gtk2::HBox->new(0,10), gtkcreate_img("ic82-dossier-32")));
$restore_find_path_entry->set_text($path_to_find_restore);
$restore_find_path_entry->signal_connect('changed', sub { $path_to_find_restore = $restore_find_path_entry->get_text });
fonction_env(\$box_find_restore, \&restore_other_media, \&restore_step2, \&restore_do);
@@ -3084,39 +3083,39 @@ sub restore_step2() {
$sys_exist = 0; $restore_sys = 0;
}
if (any { /_user_/ } grep { /^$info_prefix/ } all("$restore_info_path/")) {
- $user_exist = 1
+ $user_exist = 1;
} else {
$user_exist = 0; $restore_user = 0;
}
- my $restore_path_entry = new Gtk2::Entry();
+ my $restore_path_entry = Gtk2::Entry->new;
gtkpack($advanced_box,
- $retore_step2 = gtkpack_(new Gtk2::VBox(0,10),
- 1, new Gtk2::VBox(0,10),
- 1, new Gtk2::VBox(0,10),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, my $check_restore_other_src = new Gtk2::CheckButton(N("Select another media to restore from")),
- 1, new Gtk2::HBox(0,10),
+ $retore_step2 = gtkpack_(Gtk2::VBox->new(0,10),
+ 1, Gtk2::VBox->new(0,10),
+ 1, Gtk2::VBox->new(0,10),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, my $check_restore_other_src = Gtk2::CheckButton->new(N("Select another media to restore from")),
+ 1, Gtk2::HBox->new(0,10),
0, gtkset_sensitive(gtksignal_connect(Gtk2::Button->new(N("Other Media")), clicked => sub {
destroy_widget();
restore_other_media();
}), $restore_other_src),
),
- 0, gtkset_sensitive(my $check_restore_sys = new Gtk2::CheckButton(N("Restore system")), $sys_exist),
- 0, gtkset_sensitive(my $check_restore_user = new Gtk2::CheckButton(N("Restore Users")), $user_exist),
- 0, gtkset_sensitive(my $check_restore_other = new Gtk2::CheckButton(N("Restore Other")), $other_exist),
- 0, gtkpack_(new Gtk2::HBox(0,10),
- 0, my $check_restore_other_path = new Gtk2::CheckButton(N("Select path to restore (instead of /)")),
- 1, new Gtk2::HBox(0,10),
+ 0, gtkset_sensitive(my $check_restore_sys = Gtk2::CheckButton->new(N("Restore system")), $sys_exist),
+ 0, gtkset_sensitive(my $check_restore_user = Gtk2::CheckButton->new(N("Restore Users")), $user_exist),
+ 0, gtkset_sensitive(my $check_restore_other = Gtk2::CheckButton->new(N("Restore Other")), $other_exist),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
+ 0, my $check_restore_other_path = Gtk2::CheckButton->new(N("Select path to restore (instead of /)")),
+ 1, Gtk2::HBox->new(0,10),
0, gtkset_sensitive($restore_path_entry, $restore_other_path),
- 0, gtksignal_connect(my $button = new Gtk2::Button->new, clicked => sub {
+ 0, gtksignal_connect(my $button = Gtk2::Button->new->new, clicked => sub {
filedialog_generic(N("Path To Restore To"), \$restore_path_entry);
}),
),
- 0, gtkset_sensitive(my $check_backup_bef_restore = new Gtk2::CheckButton(N("Do new backup before restore (only for incremental backups.)")),
+ 0, gtkset_sensitive(my $check_backup_bef_restore = Gtk2::CheckButton->new(N("Do new backup before restore (only for incremental backups.)")),
$conf{SYS_INCREMENTAL_BACKUPS} || $conf{USER_INCREMENTAL_BACKUPS}),
- 0, gtkset_sensitive(my $check_remove_user_dir = new Gtk2::CheckButton(N("Remove user directories before restore.")), $user_exist),
- 1, new Gtk2::VBox(0,10),
+ 0, gtkset_sensitive(my $check_remove_user_dir = Gtk2::CheckButton->new(N("Remove user directories before restore.")), $user_exist),
+ 1, Gtk2::VBox->new(0,10),
),
);
@@ -3139,7 +3138,7 @@ sub restore_step2() {
} else {
$next_widget = \&restore_do;
}
- })
+ });
}
gtksignal_connect(gtkset_active($check_restore_other_path, $restore_other_path), toggled => sub {
$restore_other_path = $restore_other_path ? 0 : 1;
@@ -3164,7 +3163,7 @@ sub restore_step2() {
} else {
$next_widget = \&restore_do;
}
- $button->add(gtkpack(new Gtk2::HBox(0,10), gtkcreate_img("ic82-dossier-32")));
+ $button->add(gtkpack(Gtk2::HBox->new(0,10), gtkcreate_img("ic82-dossier-32")));
$restore_path_entry->set_text($restore_path);
$restore_path_entry->signal_connect('changed', sub {
$restore_path = $restore_path_entry->get_text;
@@ -3196,37 +3195,36 @@ sub find_files_to_restore() {
$valcolumn->set_visible(0);
my $unselected = gtkcreate_pixbuf('unselected');
my $selected = gtkcreate_pixbuf('selected');
- my $file_wildcard_entry = new Gtk2::Entry();
+ my $file_wildcard_entry = Gtk2::Entry->new;
gtkpack($advanced_box,
- $file_restore = gtkpack_(new Gtk2::VBox(0,10),
- 0, new Gtk2::Label(N("Filename text substring to search for (empty string matches all):")),
- 0, gtkpack_(new Gtk2::HBox(0,10),
+ $file_restore = gtkpack_(Gtk2::VBox->new(0,10),
+ 0, Gtk2::Label->new(N("Filename text substring to search for (empty string matches all):")),
+ 0, gtkpack_(Gtk2::HBox->new(0,10),
1, $file_wildcard_entry,
- 0, gtksignal_connect(new Gtk2::Button(N("Search Backups")), clicked => sub {
+ 0, gtksignal_connect(Gtk2::Button->new(N("Search Backups")), clicked => sub {
local $_ = $file_wildcard_entry->get_text;
- s|^\*|\\\*|g;
+ s|^\*|\\*|g;
my $wildcard = $_;
@possible_sources = glob "$conf{PATH_TO_SAVE}/list*";
$model->clear;
my $match = 0;
foreach my $list (@possible_sources) {
- my @listing = cat_($list);
- my @matches = grep { /$wildcard/ } @listing;
+ my @matches = grep { /$wildcard/ } cat_($list);
if (@matches) {
my $list_entry = $model->append_set(undef, [ 0 => $list, 2 => '' ]);
foreach (@matches) {
chop;
$model->append_set($list_entry, [ 0 => $_, 1 => $unselected, 2 => 0 ]);
}
- $match = 1
+ $match = 1;
}
}
show_warning("i", N("No matches found...")) if $match == 0;
}),
),
1, create_scrolled_window($file_list),
- 0, gtkset_sensitive(gtksignal_connect($start_restore = new Gtk2::Button(N("Restore Selected")), clicked => sub {
+ 0, gtkset_sensitive(gtksignal_connect($start_restore = Gtk2::Button->new(N("Restore Selected")), clicked => sub {
@files_to_restore = ();
my $last_entry = '';
my $catalog_entry;
@@ -3340,7 +3338,7 @@ sub catalog_restore {
foreach (@contents) {
chop;
my $s = $_;
- $lmodel->append_set(undef, $s);
+ $lmodel->append_set(0, $s);
}
}
gtkset_mousecursor_normal();
@@ -3359,14 +3357,14 @@ sub catalog_restore {
});
gtkpack($advanced_box,
- $catalog_box = gtkpack_(new Gtk2::HBox(0,10),
- 1, gtkpack_(new Gtk2::VBox(0,5),
+ $catalog_box = gtkpack_(Gtk2::HBox->new(0,10),
+ 1, gtkpack_(Gtk2::VBox->new(0,5),
0, N("Click date/time to see backup files.\nCtrl-Click files to select multiple files."),
- 1, gtkpack_(new Gtk2::VBox(0, 10),
+ 1, gtkpack_(Gtk2::VBox->new(0, 10),
1, create_scrolled_window($tree_catalog),
1, create_scrolled_window($tree_files),
),
- 0, gtkpack_(new Gtk2::HBox(1, 10),
+ 0, gtkpack_(Gtk2::HBox->new(1, 10),
1, gtksignal_connect(Gtk2::Button->new(N("Restore Selected\nCatalog Entry")), clicked => sub {
if ($cat_entry) {
my $media_check = restore_catalog_entry($cat_entry, ());
@@ -3388,17 +3386,17 @@ sub catalog_restore {
}
}
}),
- 1, gtkpack_(new Gtk2::VBox(0, 5),
- 0, new Gtk2::Label("Restore To Path"),
- 0, $restore_path_entry = new Gtk2::Entry(),
+ 1, gtkpack_(Gtk2::VBox->new(0, 5),
+ 0, Gtk2::Label->new("Restore To Path"),
+ 0, $restore_path_entry = Gtk2::Entry->new,
),
- 0, gtksignal_connect(my $button = new Gtk2::Button(), clicked => sub {
+ 0, gtksignal_connect(my $button = Gtk2::Button->new, clicked => sub {
filedialog_generic(N("Path To Restore To"), \$restore_path_entry);
}),
),
- 0, new Gtk2::VBox(0,10),
+ 0, Gtk2::VBox->new(0,10),
),
- 0, new Gtk2::VBox(0,10),
+ 0, Gtk2::VBox->new(0,10),
),
);
@@ -3407,9 +3405,9 @@ sub catalog_restore {
$restore_path = $restore_path_entry->get_text;
$untar_prefix = "tar -C $restore_path -x";
});
- $button->add(gtkpack(new Gtk2::HBox(0,10), gtkcreate_img("ic82-dossier-32")));
+ $button->add(gtkpack(Gtk2::HBox->new(0,10), gtkcreate_img("ic82-dossier-32")));
button_box_restore();
- fonction_env(\$catalog_box, \&catalog_restore, \&restore_find_media_box, \&catalog_restore) if $call_method eq "need media";;
+ fonction_env(\$catalog_box, \&catalog_restore, \&restore_find_media_box, \&catalog_restore) if $call_method eq "need media";
fonction_env(\$catalog_box, \&catalog_restore, \&restore_box, \&catalog_restore) if $call_method eq "button";
$central_widget = \$catalog_box;
$up_box->show_all;
@@ -3475,7 +3473,7 @@ sub restore_catalog_entry {
}
}
- if ($media eq 'Tape') {
+ if ($media =~ /^DirectTape|^Tape/) {
#- a little more complicated, we need to check if other backups
#- were done on this tape, and try to find the offset to this one
$in->ask_okcancel(N("Restore From Tape"), N("Insert the tape with volume label %s\n in the tape drive device %s", $vol_host, $dev_path) ,1) ? ($vol_name = get_tape_label($dev_path)) : return 0;
@@ -3483,7 +3481,7 @@ sub restore_catalog_entry {
show_warning("f", N("Not the correct tape label. Tape is labelled %s.", $vol_name));
return 0;
} else {
- $restore_result = restore_tape($cat_entry, $dev_path, @restore_files);
+ $restore_result = restore_tape($media, $cat_entry, $dev_path, @restore_files);
}
}
@@ -3574,15 +3572,28 @@ sub restore_hd_or_cd {
}
sub restore_tape {
- my ($cat_entry, $dev_path, @restore_files) = @_;
+ my ($media, $cat_entry, $dev_path, @restore_files) = @_;
my $indv_files = @restore_files;
my $wild_card = catalog_to_wildcard($cat_entry);
$dev_path =~ s|/st|/nst|;
+ my $command = "tar -C $restore_path -xf $dev_path";
+
+ if ($media eq "DirectTape") {
+ position_tape($cat_entry, $dev_path);
+ if ($indv_files != 0) {
+ foreach (@restore_files) {
+ $command .= " " . substr($_, 1);
+ }
+ }
+ spawn_progress($command, "Restoring files from $dev_path to $restore_path.");
+ return 0;
+ }
if ($indv_files == 0) {
#- full catalog specified
foreach (wildcard_to_tarfile($wild_card)) {
- get_file_from_tape($cat_entry, $dev_path);
+ position_tape($cat_entry, $dev_path);
+ get_tarfile_from_tape($dev_path);
return 1 if no_tarfile("$conf{PATH_TO_SAVE}/$_");
untar("$cfg_dir/restores/$conf{PATH_TO_SAVE}/$_", "all", $_, undef);
}
@@ -3590,7 +3601,10 @@ sub restore_tape {
#- individual files - pull from appropriate catalog
foreach (@restore_files) {
my ($restorefile, $tarfile) = file_to_tarfile($_, $wild_card);
- get_file_from_tape($cat_entry, $dev_path) if !-e "$cfg_dir/restores/$tarfile";
+ if (!-e "$cfg_dir/restores/$tarfile") {
+ position_tape($cat_entry, $dev_path);
+ get_tarfile_from_tape($dev_path);
+ }
return 1 if no_tarfile($tarfile);
untar("$cfg_dir/restores/$tarfile $restorefile", "files", $tarfile, $restorefile);
}
@@ -3724,11 +3738,15 @@ sub find_tape_offset {
}
}
-sub get_file_from_tape {
+sub position_tape {
my ($cat_entry, $dev_path) = @_;
my $offset = find_tape_offset($cat_entry);
spawn_progress("mt -f $dev_path rewind", "Rewinding tape on $dev_path.");
spawn_progress("mt -f $dev_path fsf $offset", "Moving forward $offset file records.");
+}
+
+sub get_tarfile_from_tape {
+ my ($dev_path) = @_;
spawn_progress("tar -C $cfg_dir/restores -xf $dev_path", "Untarring from $dev_path to work directory.");
}
@@ -3745,14 +3763,14 @@ sub restore_box() {
if (@other_backuped || @sys_backuped || @user_backuped) {
gtkpack($advanced_box,
- $box2 = gtkpack_(new Gtk2::HBox(0,1),
- 1, new Gtk2::VBox(0,10),
- 1, gtkpack_(new Gtk2::VBox(0,10),
- 1, new Gtk2::VBox(0,10),
- 1, new Gtk2::VBox(0,10),
+ $box2 = gtkpack_(Gtk2::HBox->new(0,1),
+ 1, Gtk2::VBox->new(0,10),
+ 1, gtkpack_(Gtk2::VBox->new(0,10),
+ 1, Gtk2::VBox->new(0,10),
+ 1, Gtk2::VBox->new(0,10),
1, gtksignal_connect(Gtk2::Button->new(N("Search for files to restore")), clicked => sub {
button_box_file_restore();
- find_files_to_restore()
+ find_files_to_restore();
}),
1, gtksignal_connect(Gtk2::Button->new(N("Restore all backups")), clicked => sub {
button_box_restore();
@@ -3760,7 +3778,7 @@ sub restore_box() {
$restore_sys = 1;
$restore_other = 1;
$restore_user = 1;
- restore_do()
+ restore_do();
}),
1, gtksignal_connect(Gtk2::Button->new(N("Custom Restore")), clicked => sub {
button_box_restore();
@@ -3769,15 +3787,15 @@ sub restore_box() {
1, gtksignal_connect(Gtk2::Button->new(N("Restore From Catalog")), clicked => sub {
catalog_restore("button");
}),
- 1, new Gtk2::VBox(0,10),
- 1, new Gtk2::VBox(0,10),
+ 1, Gtk2::VBox->new(0,10),
+ 1, Gtk2::VBox->new(0,10),
),
- 1, new Gtk2::HBox(0,10),
+ 1, Gtk2::HBox->new(0,10),
),
);
} else {
destroy_widget();
- restore_find_media_box(),
+ restore_find_media_box();
}
fonction_env(\$box2, \&restore_box, \&interactive_mode_box);
$central_widget = \$box2;
@@ -3797,21 +3815,21 @@ sub restore_find_media_box() {
$message .= ".";
gtkpack($advanced_box,
- $box2 = gtkpack_(new Gtk2::VBox(0, 5),
- 1, gtkpack(new Gtk2::HBox(0, 15),
- new Gtk2::VBox(0, 5),
+ $box2 = gtkpack_(Gtk2::VBox->new(0, 5),
+ 1, gtkpack(Gtk2::HBox->new(0, 15),
+ Gtk2::VBox->new(0, 5),
gtkcreate_img('warning'),
translate($message),
- new Gtk2::VBox(0, 5),
+ Gtk2::VBox->new(0, 5),
),
- 1, gtkpack(new Gtk2::HBox(0, 15),
- new Gtk2::VBox(0, 5),
- gtkpack(new Gtk2::VBox(0, 10),
+ 1, gtkpack(Gtk2::HBox->new(0, 15),
+ Gtk2::VBox->new(0, 5),
+ gtkpack(Gtk2::VBox->new(0, 10),
gtkset_sensitive(gtksignal_connect(Gtk2::Button->new(N("CD in place - continue.")), clicked => sub {
$good_restore_path = 1;
interactive_mode_box("restore");
}), $mount_media),
- $new_path_entry = gtkset_sensitive(new Gtk2::Entry(), $mount_media),
+ $new_path_entry = gtkset_sensitive(Gtk2::Entry->new, $mount_media),
gtkset_sensitive(gtksignal_connect(Gtk2::Button->new(N("Browse to new restore repository.")), clicked => sub {
filedialog_generic(N("Directory To Restore From"), \$new_path_entry);
}), $mount_media),
@@ -3822,12 +3840,12 @@ sub restore_find_media_box() {
gtksignal_connect(Gtk2::Button->new(N("Search for files to restore")), clicked => sub {
$box2->destroy;
button_box_file_restore();
- find_files_to_restore()
+ find_files_to_restore();
}),
),
- new Gtk2::VBox(0, 5),
+ Gtk2::VBox->new(0, 5),
),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
);
$new_path_entry->set_text($path_to_find_restore);
@@ -3839,11 +3857,11 @@ sub restore_find_media_box() {
sub restore_status() {
destroy_widget();
- $pbar3 = new Gtk2::ProgressBar;
- $stext = new Gtk2::Label("");
+ $pbar3 = Gtk2::ProgressBar->new;
+ $stext = Gtk2::Label->new("");
gtkpack($advanced_box,
- $table = gtkpack(new Gtk2::VBox(0, 5),
- new Gtk2::HBox(0,5),
+ $table = gtkpack(Gtk2::VBox->new(0, 5),
+ Gtk2::HBox->new(0,5),
create_packtable({ col_spacings => 10, row_spacings => 5 },
[""],
[""],
@@ -3855,7 +3873,7 @@ sub restore_status() {
[$pbar3],
[""],
[""],
- [$plabel3 = new Gtk2::Label(' ')],
+ [$plabel3 = Gtk2::Label->new(' ')],
[""],
),
$stext,
@@ -3893,13 +3911,13 @@ sub pbutton() {
}
sub hspace() {
- 1, new Gtk2::HBox(0, 1);
+ 1, Gtk2::HBox->new(0, 1);
}
sub button_box_adv() {
$button_box_tmp->destroy;
gtkpack($button_box,
- $button_box_tmp = gtkpack_(new Gtk2::HButtonBox,
+ $button_box_tmp = gtkpack_(Gtk2::HButtonBox->new,
cbutton(),
hbutton(),
hspace(),
@@ -3921,7 +3939,7 @@ sub button_box_adv() {
sub button_box_restore_main() {
$button_box_tmp->destroy;
gtkpack($button_box,
- $button_box_tmp = gtkpack_(new Gtk2::HButtonBox,
+ $button_box_tmp = gtkpack_(Gtk2::HButtonBox->new,
cbutton(),
hbutton(),
hspace(),
@@ -3934,7 +3952,7 @@ sub button_box_restore_main() {
sub button_box_file_restore() {
$button_box_tmp->destroy;
gtkpack($button_box,
- $button_box_tmp = gtkpack_(new Gtk2::HButtonBox,
+ $button_box_tmp = gtkpack_(Gtk2::HButtonBox->new,
0, gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => \&restore_box),
hbutton(),
hspace(),
@@ -3945,7 +3963,7 @@ sub button_box_file_restore() {
sub button_box_ok_only() {
$button_box_tmp->destroy;
gtkpack($button_box,
- $button_box_tmp = gtkpack_(new Gtk2::HButtonBox,
+ $button_box_tmp = gtkpack_(Gtk2::HButtonBox->new,
hspace(),
ibutton(N("Ok")),
),
@@ -3955,7 +3973,7 @@ sub button_box_ok_only() {
sub button_box_backup_end() {
$button_box_tmp->destroy;
gtkpack($button_box,
- $button_box_tmp = gtkpack_(new Gtk2::HButtonBox,
+ $button_box_tmp = gtkpack_(Gtk2::HButtonBox->new,
cbutton(),
hbutton(),
hspace(),
@@ -3972,7 +3990,7 @@ sub button_box_backup_end() {
sub button_box_wizard_end() {
$button_box_tmp->destroy;
gtkpack($button_box,
- $button_box_tmp = gtkpack_(new Gtk2::HButtonBox,
+ $button_box_tmp = gtkpack_(Gtk2::HButtonBox->new,
cbutton(),
hbutton(),
hspace(),
@@ -3988,7 +4006,7 @@ sub button_box_wizard_end() {
sub button_box_restore_end() {
$button_box_tmp->destroy;
gtkpack($button_box,
- $button_box_tmp = gtkpack_(new Gtk2::HButtonBox,
+ $button_box_tmp = gtkpack_(Gtk2::HButtonBox->new,
cbuttonr(),
hbutton(),
hspace(),
@@ -4004,7 +4022,7 @@ sub button_box_restore_end() {
sub button_box_restore_pbs_end() {
$button_box_tmp->destroy;
gtkpack($button_box,
- $button_box_tmp = gtkpack_(new Gtk2::HButtonBox,
+ $button_box_tmp = gtkpack_(Gtk2::HButtonBox->new,
hspace(),
hbutton(),
ibutton(N("Ok")),
@@ -4015,7 +4033,7 @@ sub button_box_restore_pbs_end() {
sub button_box_restore() {
$button_box_tmp->destroy;
gtkpack($button_box,
- $button_box_tmp = gtkpack_(new Gtk2::HButtonBox,
+ $button_box_tmp = gtkpack_(Gtk2::HButtonBox->new,
cbuttonr(),
hbutton(),
hspace(),
@@ -4032,7 +4050,7 @@ sub button_box_find_media {
my ($mount_media) = @_;
$button_box_tmp->destroy;
gtkpack($button_box,
- $button_box_tmp = gtkpack_(new Gtk2::HButtonBox,
+ $button_box_tmp = gtkpack_(Gtk2::HButtonBox->new,
cbutton(),
hbutton(),
hspace(),
@@ -4047,7 +4065,7 @@ sub button_box_find_media {
sub button_box_wizard() {
$button_box_tmp->destroy;
gtkpack($button_box,
- $button_box_tmp = gtkpack_(new Gtk2::HButtonBox,
+ $button_box_tmp = gtkpack_(Gtk2::HButtonBox->new,
cbutton(),
hbutton(),
hspace(),
@@ -4080,9 +4098,9 @@ sub install_rpm {
my ($calling_widget, $previous) = @_;
destroy_widget();
gtkpack($advanced_box,
- my $rpm_box = gtkpack_(new Gtk2::VBox(0, 15),
+ my $rpm_box = gtkpack_(Gtk2::VBox->new(0, 15),
0, N("The following packages need to be installed:\n") . join(' ', @list_of_rpm_to_install),
- 0, new Gtk2::HSeparator,
+ 0, Gtk2::HSeparator->new,
0, gtksignal_connect(Gtk2::Button->new(N("Install")), clicked => sub {
my $installed = system("/usr/sbin/urpmi --X @list_of_rpm_to_install");
if ($installed == 0) {
@@ -4103,15 +4121,15 @@ sub message_norestore_box() {
$box2->destroy;
gtkadd($advanced_box,
- $box2 = gtkpack_(new Gtk2::HBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
- 1, gtkpack(new Gtk2::HBox(0, 15),
- new Gtk2::VBox(0, 5),
+ $box2 = gtkpack_(Gtk2::HBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
+ 1, gtkpack(Gtk2::HBox->new(0, 15),
+ Gtk2::VBox->new(0, 5),
gtkcreate_img('warning'),
N("Please select data to restore..."),
- new Gtk2::VBox(0, 5),
+ Gtk2::VBox->new(0, 5),
),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
);
button_box_restore_main();
@@ -4132,37 +4150,37 @@ sub progress {
}
sub build_backup_status() {
- $pbar = new Gtk2::ProgressBar;
- $pbar1 = new Gtk2::ProgressBar;
- $pbar2 = new Gtk2::ProgressBar;
- $pbar3 = new Gtk2::ProgressBar;
- $plabel = new Gtk2::Label(" ");
- $plabel1 = new Gtk2::Label(" ");
- $plabel2 = new Gtk2::Label(" ");
- $plabel3 = new Gtk2::Label(" ");
+ $pbar = Gtk2::ProgressBar->new;
+ $pbar1 = Gtk2::ProgressBar->new;
+ $pbar2 = Gtk2::ProgressBar->new;
+ $pbar3 = Gtk2::ProgressBar->new;
+ $plabel = Gtk2::Label->new(" ");
+ $plabel1 = Gtk2::Label->new(" ");
+ $plabel2 = Gtk2::Label->new(" ");
+ $plabel3 = Gtk2::Label->new(" ");
- $stext = new Gtk2::Label("");
+ $stext = Gtk2::Label->new("");
button_box_ok_only();
my $table = Gtk2::Table->new(10, 2, 1);
$table->set_row_spacings(5);
$table->set_col_spacings(10);
- $table->attach_defaults(new Gtk2::Label(N("Backup system files")), 0, 1, 0, 1);
+ $table->attach_defaults(Gtk2::Label->new(N("Backup system files")), 0, 1, 0, 1);
$table->attach_defaults($pbar, 0, 1, 1, 2);
$table->attach_defaults($plabel, 1, 2, 1, 2);
- $table->attach_defaults(new Gtk2::Label(N("Backup user files")), 0, 1, 2, 3);
+ $table->attach_defaults(Gtk2::Label->new(N("Backup user files")), 0, 1, 2, 3);
$table->attach_defaults($pbar1, 0, 1, 3, 4);
$table->attach_defaults($plabel1, 1, 2, 3, 4);
- $table->attach_defaults(new Gtk2::Label(N("Backup other files")), 0, 1, 4, 5);
+ $table->attach_defaults(Gtk2::Label->new(N("Backup other files")), 0, 1, 4, 5);
$table->attach_defaults($pbar2, 0, 1, 5, 6);
$table->attach_defaults($plabel2, 1, 2, 5, 6);
- $table->attach_defaults(new Gtk2::Label(N("Total Progress")), 0, 1, 6, 7);
+ $table->attach_defaults(Gtk2::Label->new(N("Total Progress")), 0, 1, 6, 7);
$table->attach_defaults($pbar3, 0, 1, 7, 8);
$table->attach_defaults($plabel3, 1, 2, 7, 8);
gtkpack($advanced_box,
- my $tbox = gtkpack(new Gtk2::VBox(0, 5),
+ my $tbox = gtkpack(Gtk2::VBox->new(0, 5),
$table,
$stext,
),
@@ -4174,28 +4192,28 @@ sub build_backup_status() {
}
sub build_backup_ftp_status() {
- $pbar = new Gtk2::ProgressBar;
- $pbar3 = new Gtk2::ProgressBar;
+ $pbar = Gtk2::ProgressBar->new;
+ $pbar3 = Gtk2::ProgressBar->new;
destroy_widget();
button_box_ok_only();
$pbar->set_fraction(0);
$pbar3->set_fraction(0);
gtkpack($advanced_box,
- $table = gtkpack_(new Gtk2::VBox(0, 15),
+ $table = gtkpack_(Gtk2::VBox->new(0, 15),
1, N("Sending files by FTP"),
- 1, new Gtk2::VBox(0, 15),
- 1, create_packtable ({ col_spacings => 10, row_spacings => 5 },
+ 1, Gtk2::VBox->new(0, 15),
+ 1, create_packtable({ col_spacings => 10, row_spacings => 5 },
[N("Sending files...")],
[""],
- [ $plabel = new Gtk2::Label(' ') ],
+ [ $plabel = Gtk2::Label->new(' ') ],
[ $pbar ],
[""],
[N("Total Progress")],
- [ $plabel3 = new Gtk2::Label(' ') ],
+ [ $plabel3 = Gtk2::Label->new(' ') ],
[$pbar3],
),
- 1, new Gtk2::VBox(0, 15),
+ 1, Gtk2::VBox->new(0, 15),
),
);
$central_widget = \$table;
@@ -4205,15 +4223,15 @@ sub build_backup_ftp_status() {
sub build_backup_box_see_conf {
my ($caller) = @_;
- my $text = new Gtk2::TextView;
+ my $text = Gtk2::TextView->new;
read_conf_file();
system_state();
gtktext_insert($text, [ [ $system_state ] ]);
button_box_restore_main();
gtkpack($advanced_box,
- $box2 = gtkpack_(new Gtk2::HBox(0, 15),
- 1, gtkpack_(new Gtk2::VBox(0,10),
+ $box2 = gtkpack_(Gtk2::HBox->new(0, 15),
+ 1, gtkpack_(Gtk2::VBox->new(0,10),
0, N("Drakbackup Configuration"),
1, create_scrolled_window($text),
),
@@ -4234,35 +4252,35 @@ sub build_backup_box() {
destroy_widget();
gtkadd($advanced_box,
- $box2 = gtkpack_(new Gtk2::HBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
- 1, gtkpack_(new Gtk2::VBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
+ $box2 = gtkpack_(Gtk2::HBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
+ 1, gtkpack_(Gtk2::VBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
1, gtksignal_connect(my $button_from_conf_file = Gtk2::Button->new, clicked => sub {
destroy_widget();
build_backup_status();
build_backup_files();
}),
- 0, new Gtk2::VBox(0, 5),
+ 0, Gtk2::VBox->new(0, 5),
1, gtksignal_connect(my $button_see_conf = Gtk2::Button->new, clicked => sub {
destroy_widget();
- build_backup_box_see_conf();
+ build_backup_box_see_conf(undef);
}),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
);
- $button_from_conf_file->add(gtkpack(new Gtk2::HBox(0,10),
+ $button_from_conf_file->add(gtkpack(Gtk2::HBox->new(0,10),
gtkcreate_img("ic82-discdurwhat-40"),
- new Gtk2::Label(N("Backup Now from configuration file")),
- new Gtk2::HBox(0, 5)
+ Gtk2::Label->new(N("Backup Now from configuration file")),
+ Gtk2::HBox->new(0, 5)
));
- $button_see_conf->add(gtkpack(new Gtk2::HBox(0,10),
+ $button_see_conf->add(gtkpack(Gtk2::HBox->new(0,10),
gtkcreate_img("ic82-moreoption-40"),
- new Gtk2::Label(N("View Backup Configuration.")),
- new Gtk2::HBox(0, 5)
+ Gtk2::Label->new(N("View Backup Configuration.")),
+ Gtk2::HBox->new(0, 5)
));
button_box_restore_main();
@@ -4274,8 +4292,8 @@ sub build_backup_box() {
sub interactive_mode_box {
- my ($mode) = @_;
- if ($mode eq "restore") {
+ my ($o_mode) = @_;
+ if ($o_mode eq "restore") {
$central_widget = \$box2;
restore_box();
return 0;
@@ -4283,10 +4301,10 @@ sub interactive_mode_box {
destroy_widget();
gtkadd($advanced_box,
- $box2 = gtkpack_(new Gtk2::HBox(0, 15),
- 1, new Gtk2::VBox(0, 5),
- 1, gtkpack_(new Gtk2::VBox(0, 5),
- 1, new Gtk2::VBox(0, 5),
+ $box2 = gtkpack_(Gtk2::HBox->new(0, 15),
+ 1, Gtk2::VBox->new(0, 5),
+ 1, gtkpack_(Gtk2::VBox->new(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
0, gtksignal_connect(Gtk2::Button->new(N("Wizard Configuration")), clicked => sub {
destroy_widget();
read_conf_file();
@@ -4316,9 +4334,9 @@ sub interactive_mode_box {
0, gtksignal_connect(Gtk2::Button->new(N("Restore")), clicked => sub {
restore_box();
}),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
- 1, new Gtk2::VBox(0, 5),
+ 1, Gtk2::VBox->new(0, 5),
),
);
$central_widget = \$box2;
@@ -4340,15 +4358,15 @@ sub interactive_mode() {
read_conf_file();
gtkadd($window1,
- gtkpack(new Gtk2::VBox(0,0),
- gtkpack($up_box = new Gtk2::VBox(0, 5),
- gtkpack_(new Gtk2::VBox(0, 3),
- 1, gtkpack_(new Gtk2::HBox(0, 3),
- 1, $advanced_box = new Gtk2::HBox(0, 15),
+ gtkpack(Gtk2::VBox->new(0,0),
+ gtkpack($up_box = Gtk2::VBox->new(0, 5),
+ gtkpack_(Gtk2::VBox->new(0, 3),
+ 1, gtkpack_(Gtk2::HBox->new(0, 3),
+ 1, $advanced_box = Gtk2::HBox->new(0, 15),
),
- 0, new Gtk2::HSeparator,
- 0, $button_box = gtkpack(new Gtk2::VBox(0, 15),
- $button_box_tmp = gtkpack(new Gtk2::VBox(0, 0),),
+ 0, Gtk2::HSeparator->new,
+ 0, $button_box = gtkpack(Gtk2::VBox->new(0, 15),
+ $button_box_tmp = gtkpack(Gtk2::VBox->new(0, 0),),
),
),
),