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,7 +32,10 @@ use File::Spec; ...@@ -32,7 +32,10 @@ use File::Spec;
use Log::Log4perl qw(:easy); use Log::Log4perl qw(:easy);
use constant FIJI_DIR => realpath(File::Spec->rel2abs("..", $FindBin::Bin)); use constant FIJI_DIR => realpath(File::Spec->rel2abs("..", $FindBin::Bin));
use constant FIJI_DOCUMENTATION_PATH => realpath(
my $documentation_path;
BEGIN {
my $pdf =
File::Spec->rel2abs( File::Spec->rel2abs(
File::Spec->catfile( File::Spec->catfile(
"..", "..",
...@@ -41,8 +44,14 @@ use constant FIJI_DOCUMENTATION_PATH => realpath( ...@@ -41,8 +44,14 @@ use constant FIJI_DOCUMENTATION_PATH => realpath(
"fiji_user_guide.pdf" "fiji_user_guide.pdf"
), ),
$FindBin::Bin $FindBin::Bin
) );
);
eval { $pdf = realpath($pdf) };
if ($@) {
$pdf = undef;
}
};
use constant FIJI_DOCUMENTATION_PATH => $documentation_path;
use constant FIJI_MEDIA_PATH => realpath( use constant FIJI_MEDIA_PATH => realpath(
File::Spec->rel2abs( File::Spec->rel2abs(
......
...@@ -178,7 +178,14 @@ sub cross_platform_open { ...@@ -178,7 +178,14 @@ sub cross_platform_open {
sub show_documentation { sub show_documentation {
my $parent = shift; my $parent = shift;
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); return cross_platform_open($parent, FIJI_DOCUMENTATION_PATH);
}
} }
sub show_about { sub show_about {
......
Supports Markdown
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