App-PLab
view release on metacpan or search on metacpan
$ok = 0;
last;
}
my @res = $w-> valid_comm_series( $cendata{$curr}, $cendata{$curr - $incr});
if ( @res) {
my $fj = $w-> win_formfilename( $curr - $incr);
$jump = $fj if Prima::MsgBox::message("Distance ambiguity detected between $cenname and " .
$w-> win_extname( $w-> win_formfilename( $curr - $incr)) .
". Process aborted, no files were changed. Jump to $fj?",
mb::YesNoCancel|mb::Error) == mb::Yes;
@ambiguity = (
$cendata{$curr}-> [$res[1] * 2],
$cendata{$curr}-> [$res[1] * 2 + 1],
$cendata{$curr - $incr}-> [$res[0] * 2],
$cendata{$curr - $incr}-> [$res[0] * 2 + 1],
$cendata{$curr - $incr}-> [$res[1] * 2],
$cendata{$curr - $incr}-> [$res[1] * 2 + 1],
);
$ok = 0;
last;
}
}
# deleting the point
my @rxdata = @{$cendata{$curr}};
splice( @rxdata, $ptIdx, 2);
# saving backing data
if ( @rxdata) {
if ( open F, "> $cenname.bak") {
$w-> rpt_write( *F, \@rxdata);
close F;
} else {
Prima::MsgBox::message("Error saving $cenname.bak. Aborting");
$ok = 0;
last;
}
} elsif ( -f "$cenname.bak") {
# null files to be deleted
unless ( unlink "$cenname.bak") {
Prima::MsgBox::message("Error accessing $cenname.bak. Aborting");
$ok = 0;
last;
}
}
$curr += $incr;
$g-> value( $g-> value + 1);
# status dialog tribute
$::application-> yield;
$ok = 0, last if $userAborted;
}
$curr = $w-> {fileNum};
if ( $ok) {
# big rename from .bak to .cen
$statwin-> text("Restoring .cen files...");
while ( $curr != $to + $incr) {
my $cenname = $w-> win_extname( $w-> win_formfilename( $curr));
if ( -f "$cenname.bak") {
Prima::MsgBox::message("Cannot rename backup file. Please note that it $cenname.bak file contains actual information.")
if !unlink($cenname) || !rename( "$cenname.bak", $cenname);
} else {
Prima::MsgBox::message("Cannot delete $cenname. Note that it contains non actual information.")
if !unlink($cenname);
}
$curr += $incr;
$g-> value( $g-> value + 1);
$g-> update_view;
}
} else {
# removing .baks
while ( $curr != $to + $incr) {
my $cenname = $w-> win_extname( $w-> win_formfilename( $curr));
unlink "$cenname.bak";
$curr += $incr;
}
}
$statwin-> destroy;
if ( $ok) {
# points might be rearranged again
$w->{points} = $cendata{$w->{fileNum}};
splice( @{$w-> {points}}, $ptIdx, 2);
if (defined $w->{extraPoints}) {
$w->{extraPoints} = $cendata{$w->{fileNum} + $incr};
splice( @{$w-> {extraPoints}}, $ptIdx, 2);
}
$w-> IV-> repaint;
Prima::MsgBox::message("Queue processed", mb::OK|mb::Information);
} elsif ( defined $jump) {
$w-> {ambiguity} = \@ambiguity if $w-> win_loadfile( $jump) && scalar(@ambiguity);
}
}
sub win_closeframe
{
my $w = $_[0];
$w-> SUPER::win_closeframe;
$w-> rpt_clear();
}
sub win_framechanged
{
my $w = $_[0];
$w-> SUPER::win_framechanged;
$w-> sb_points();
$w-> win_untemp(0);
}
sub win_newextras
{
my $w = $_[0];
$w-> SUPER::win_newextras;
my $cenname = $w->{ini}-> {forwardLookup} ? $w-> {nextFile} : $w-> {prevFile};
if ( defined $cenname) {
$cenname = $w-> win_extname( $cenname);
if ( open F, "< $cenname") {
$w-> {extraPoints} = $w-> rpt_read( *F);
( run in 0.856 second using v1.01-cache-2.11-cpan-df04353d9ac )