Disable the OctoPrint test button when LWP::UserAgent is not available

This commit is contained in:
Alessandro Ranellucci 2015-01-08 21:37:00 +01:00
parent 24daa50bfd
commit 9f4f711017

View File

@ -1034,10 +1034,6 @@ sub build {
$btn->SetBitmap(Wx::Bitmap->new("$Slic3r::var/wrench.png", wxBITMAP_TYPE_PNG)); $btn->SetBitmap(Wx::Bitmap->new("$Slic3r::var/wrench.png", wxBITMAP_TYPE_PNG));
} }
if (!eval "use LWP::UserAgent; 1") {
$btn->Disable;
}
EVT_BUTTON($self, $btn, sub { EVT_BUTTON($self, $btn, sub {
my $ua = LWP::UserAgent->new; my $ua = LWP::UserAgent->new;
$ua->timeout(10); $ua->timeout(10);
@ -1202,7 +1198,7 @@ sub _update {
my $config = $self->{config}; my $config = $self->{config};
if ($config->get('octoprint_host')) { if ($config->get('octoprint_host') && eval "use LWP::UserAgent; 1") {
$self->{octoprint_host_test_btn}->Enable; $self->{octoprint_host_test_btn}->Enable;
} else { } else {
$self->{octoprint_host_test_btn}->Disable; $self->{octoprint_host_test_btn}->Disable;