From 5a9c163a2e65d46b952366a0f97fc4b4fd86c83f Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 16 Sep 2013 10:18:42 +0200 Subject: [PATCH] Meaningful error when user wants to use 3D preview but didn't install the required modules. --- Build.PL | 13 +++++++++---- lib/Slic3r/GUI/Plater.pm | 5 +++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Build.PL b/Build.PL index f75f71559..7fac4c2fe 100644 --- a/Build.PL +++ b/Build.PL @@ -124,10 +124,15 @@ EOF system $cpanm, '--reinstall', './xs'; } -if (eval "use App::Prove; 1" && !$missing_prereqs) { - App::Prove->new->run; +if ($missing_prereqs) { + exit 1; +} else { + if (eval "use App::Prove; 1") { + App::Prove->new->run; + } + if (!defined $ARGV[0] && $ARGV[0] ne '--gui') { + print "If you also want to use the GUI you can now run `perl Build.PL --gui` to install the required modules.\n"; + } } -exit 1 if $missing_prereqs; - __END__ diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index 207750eaa..bc002af37 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -1079,6 +1079,11 @@ sub object_preview_dialog { ($obj_idx, undef) = $self->selected_object; } + if (!$Slic3r::GUI::have_OpenGL) { + Slic3r::GUI::show_error($self, "Please install the OpenGL modules to use this feature (see build instructions)."); + return; + } + my $dlg = Slic3r::GUI::Plater::ObjectPreviewDialog->new($self, object => $self->{objects}[$obj_idx], );