Disabled the new Slic3r version check until we have a server set up

for the Slic3r Prusa Edition.

Hopefully a fix of https://github.com/prusa3d/Slic3r/issues/258
by moving the 2D thumbnail generation to the main thread and
forcing the simple 2D convex hull for even the small objects.
This commit is contained in:
bubnikv 2017-06-12 14:25:35 +02:00
parent 02ab92ea65
commit f408f08850
5 changed files with 118 additions and 136 deletions

View file

@ -89,7 +89,7 @@ our $medium_font = Wx::SystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
$medium_font->SetPointSize(12);
our $grey = Wx::Colour->new(200,200,200);
our $VERSION_CHECK_EVENT : shared = Wx::NewEventType;
#our $VERSION_CHECK_EVENT : shared = Wx::NewEventType;
our $DLP_projection_screen;
@ -181,10 +181,10 @@ sub OnInit {
}
$self->{mainframe}->config_wizard if $run_wizard;
$self->check_version
if $self->have_version_check
&& ($Settings->{_}{version_check} // 1)
&& (!$Settings->{_}{last_version_check} || (time - $Settings->{_}{last_version_check}) >= 86400);
# $self->check_version
# if $self->have_version_check
# && ($Settings->{_}{version_check} // 1)
# && (!$Settings->{_}{last_version_check} || (time - $Settings->{_}{last_version_check}) >= 86400);
EVT_IDLE($frame, sub {
while (my $cb = shift @cb) {
@ -192,24 +192,24 @@ sub OnInit {
}
});
EVT_COMMAND($self, -1, $VERSION_CHECK_EVENT, sub {
my ($self, $event) = @_;
my ($success, $response, $manual_check) = @{$event->GetData};
if ($success) {
if ($response =~ /^obsolete ?= ?([a-z0-9.-]+,)*\Q$Slic3r::VERSION\E(?:,|$)/) {
my $res = Wx::MessageDialog->new(undef, "A new version is available. Do you want to open the Slic3r website now?",
'Update', wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_INFORMATION | wxICON_ERROR)->ShowModal;
Wx::LaunchDefaultBrowser('http://slic3r.org/') if $res == wxID_YES;
} else {
Slic3r::GUI::show_info(undef, "You're using the latest version. No updates are available.") if $manual_check;
}
$Settings->{_}{last_version_check} = time();
$self->save_settings;
} else {
Slic3r::GUI::show_error(undef, "Failed to check for updates. Try later.") if $manual_check;
}
});
# EVT_COMMAND($self, -1, $VERSION_CHECK_EVENT, sub {
# my ($self, $event) = @_;
# my ($success, $response, $manual_check) = @{$event->GetData};
#
# if ($success) {
# if ($response =~ /^obsolete ?= ?([a-z0-9.-]+,)*\Q$Slic3r::VERSION\E(?:,|$)/) {
# my $res = Wx::MessageDialog->new(undef, "A new version is available. Do you want to open the Slic3r website now?",
# 'Update', wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_INFORMATION | wxICON_ERROR)->ShowModal;
# Wx::LaunchDefaultBrowser('http://slic3r.org/') if $res == wxID_YES;
# } else {
# Slic3r::GUI::show_info(undef, "You're using the latest version. No updates are available.") if $manual_check;
# }
# $Settings->{_}{last_version_check} = time();
# $self->save_settings;
# } else {
# Slic3r::GUI::show_error(undef, "Failed to check for updates. Try later.") if $manual_check;
# }
# });
return 1;
}
@ -331,28 +331,28 @@ sub presets {
return %presets;
}
sub have_version_check {
my ($self) = @_;
# return an explicit 0
return ($Slic3r::have_threads && $Slic3r::build && $have_LWP) || 0;
}
#sub have_version_check {
# my ($self) = @_;
#
# # return an explicit 0
# return ($Slic3r::have_threads && $Slic3r::build && $have_LWP) || 0;
#}
sub check_version {
my ($self, $manual_check) = @_;
Slic3r::debugf "Checking for updates...\n";
@_ = ();
threads->create(sub {
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
my $response = $ua->get('http://slic3r.org/updatecheck');
Wx::PostEvent($self, Wx::PlThreadEvent->new(-1, $VERSION_CHECK_EVENT,
threads::shared::shared_clone([ $response->is_success, $response->decoded_content, $manual_check ])));
Slic3r::thread_cleanup();
})->detach;
}
#sub check_version {
# my ($self, $manual_check) = @_;
#
# Slic3r::debugf "Checking for updates...\n";
#
# @_ = ();
# threads->create(sub {
# my $ua = LWP::UserAgent->new;
# $ua->timeout(10);
# my $response = $ua->get('http://slic3r.org/updatecheck');
# Wx::PostEvent($self, Wx::PlThreadEvent->new(-1, $VERSION_CHECK_EVENT,
# threads::shared::shared_clone([ $response->is_success, $response->decoded_content, $manual_check ])));
# Slic3r::thread_cleanup();
# })->detach;
#}
sub output_path {
my ($self, $dir) = @_;