Commit 2fa3de9e authored by Christian Fibich's avatar Christian Fibich Committed by Stefan Tauner
Browse files

(Windows) Don't die if documentation not present

parent 04f51588
......@@ -32,17 +32,26 @@ use File::Spec;
use Log::Log4perl qw(:easy);
use constant FIJI_DIR => realpath(File::Spec->rel2abs("..", $FindBin::Bin));
use constant FIJI_DOCUMENTATION_PATH => realpath(
File::Spec->rel2abs(
File::Spec->catfile(
"..",
"docs",
"user_guide",
"fiji_user_guide.pdf"
),
$FindBin::Bin
)
);
my $documentation_path;
BEGIN {
my $pdf =
File::Spec->rel2abs(
File::Spec->catfile(
"..",
"docs",
"user_guide",
"fiji_user_guide.pdf"
),
$FindBin::Bin
);
eval { $pdf = realpath($pdf) };
if ($@) {
$pdf = undef;
}
};
use constant FIJI_DOCUMENTATION_PATH => $documentation_path;
use constant FIJI_MEDIA_PATH => realpath(
File::Spec->rel2abs(
......
......@@ -178,7 +178,14 @@ sub cross_platform_open {
sub show_documentation {
my $parent = shift;
return cross_platform_open($parent, FIJI_DOCUMENTATION_PATH);
if (!defined FIJI_DOCUMENTATION_PATH) {
my $d = $parent->FIJIModalDialog(-image => error_image($parent),
-text => "FIJI Documentation missing",
-title => "Could not open documentation",);
$d->Show();
} else {
return cross_platform_open($parent, FIJI_DOCUMENTATION_PATH);
}
}
sub show_about {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment