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; ...@@ -32,17 +32,26 @@ 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(
File::Spec->rel2abs( my $documentation_path;
File::Spec->catfile( BEGIN {
"..", my $pdf =
"docs", File::Spec->rel2abs(
"user_guide", File::Spec->catfile(
"fiji_user_guide.pdf" "..",
), "docs",
$FindBin::Bin "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( 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;
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 { 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