Enable Controller by default and prompt user for reactivation in case they try to open it from the menubar. #4542

This commit is contained in:
Alessandro Ranellucci 2018-11-05 20:52:12 +01:00
parent 3776b7ed80
commit 35bd38ef2a
3 changed files with 14 additions and 4 deletions

View File

@ -92,7 +92,7 @@ our $Settings = {
threads => $Slic3r::Config::Options->{threads}{default},
color_toolpaths_by => 'role',
tabbed_preset_editors => 1,
show_host => 0,
show_host => 1,
nudge_val => 1,
extended_gui => 0,
reload_hide_dialog => 0,

View File

@ -100,7 +100,7 @@ sub _init_tabpanel {
$panel->OnActivate if $panel->can('OnActivate');
if ($self->{tabpanel}->GetSelection > 1) {
$self->{tabpanel}->SetWindowStyle($self->{tabpanel}->GetWindowStyleFlag | wxAUI_NB_CLOSE_ON_ACTIVE_TAB);
} elsif(($Slic3r::GUI::Settings->{_}{show_host} == 0) && ($self->{tabpanel}->GetSelection == 1)){
} elsif(!$Slic3r::GUI::Settings->{_}{show_host} && ($self->{tabpanel}->GetSelection == 1)){
$self->{tabpanel}->SetWindowStyle($self->{tabpanel}->GetWindowStyleFlag | wxAUI_NB_CLOSE_ON_ACTIVE_TAB);
} else {
$self->{tabpanel}->SetWindowStyle($self->{tabpanel}->GetWindowStyleFlag & ~wxAUI_NB_CLOSE_ON_ACTIVE_TAB);
@ -290,7 +290,17 @@ sub _init_menubar {
$self->select_tab(0);
}, undef, 'application_view_tile.png');
wxTheApp->append_menu_item($windowMenu, "&Controller\tCtrl+Y", 'Show the printer controller', sub {
$self->select_tab(1);
if ($Slic3r::GUI::Settings->{_}{show_host}) {
$self->select_tab(1);
} else {
my $confirm = Wx::MessageDialog->new($self, "The printer controller is currently disabled in the preferences. Do you want to enable it?",
'Controller', wxICON_QUESTION | wxYES_NO | wxYES_DEFAULT);
if ($confirm->ShowModal == wxID_YES) {
$Slic3r::GUI::Settings->{_}{show_host} = 1;
wxTheApp->save_settings;
Slic3r::GUI::show_info($self, "The controller is now enabled. You must restart Slic3r now to make the change effective.", "Controller");
}
}
}, undef, 'printer_empty.png');
wxTheApp->append_menu_item($windowMenu, "DLP Projector…\tCtrl+P", 'Open projector window for DLP printing', sub {
$self->{plater}->pause_background_process;

View File

@ -26,7 +26,7 @@ enum class ReloadBehavior {
/// TODO: Incorporate the system from libslic3r
class Settings {
public:
bool show_host {false};
bool show_host {true};
bool version_check {true};
bool autocenter {true};
bool autoalignz {true};