mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Merge branch 'master' into wipe_tower_improvements
This commit is contained in:
		
						commit
						e30405d672
					
				
					 14 changed files with 2079 additions and 404 deletions
				
			
		|  | @ -1,53 +0,0 @@ | |||
| # A tiny dialog to select an OctoPrint device to print to. | ||||
| 
 | ||||
| package Slic3r::GUI::BonjourBrowser; | ||||
| use strict; | ||||
| use warnings; | ||||
| use utf8; | ||||
| 
 | ||||
| use Wx qw(:dialog :id :misc :sizer :choicebook wxTAB_TRAVERSAL); | ||||
| use Wx::Event qw(EVT_CLOSE); | ||||
| use base 'Wx::Dialog'; | ||||
| 
 | ||||
| sub new { | ||||
|     my $class = shift; | ||||
|     my ($parent, $devices) = @_; | ||||
|     my $self = $class->SUPER::new($parent, -1, "Device Browser", wxDefaultPosition, [350,700], wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); | ||||
|      | ||||
|     $self->{devices} = $devices; | ||||
|      | ||||
|     # label | ||||
|     my $text = Wx::StaticText->new($self, -1, "Choose an OctoPrint device in your network:", wxDefaultPosition, wxDefaultSize); | ||||
|      | ||||
|     # selector | ||||
|     $self->{choice} = my $choice = Wx::Choice->new($self, -1, wxDefaultPosition, wxDefaultSize, | ||||
|         [ map $_->name, @{$self->{devices}} ]); | ||||
|      | ||||
|     my $main_sizer = Wx::BoxSizer->new(wxVERTICAL); | ||||
|     $main_sizer->Add($text, 1, wxEXPAND | wxALL, 10); | ||||
|     $main_sizer->Add($choice, 1, wxEXPAND | wxALL, 10); | ||||
|     $main_sizer->Add($self->CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND); | ||||
|      | ||||
|     $self->SetSizer($main_sizer); | ||||
|     $self->SetMinSize($self->GetSize); | ||||
|     $main_sizer->SetSizeHints($self); | ||||
|      | ||||
|     # needed to actually free memory | ||||
|     EVT_CLOSE($self, sub { | ||||
|         $self->EndModal(wxID_OK); | ||||
|         $self->Destroy; | ||||
|     }); | ||||
|      | ||||
|     return $self; | ||||
| } | ||||
| 
 | ||||
| sub GetValue { | ||||
|     my ($self) = @_; | ||||
|     return $self->{devices}[ $self->{choice}->GetSelection ]->address; | ||||
| } | ||||
| sub GetPort { | ||||
|     my ($self) = @_; | ||||
|     return $self->{devices}[ $self->{choice}->GetSelection ]->port; | ||||
| } | ||||
| 
 | ||||
| 1; | ||||
|  | @ -1333,6 +1333,9 @@ sub export_gcode { | |||
|     } else { | ||||
|         my $default_output_file = eval { $self->{print}->output_filepath($main::opt{output} // '') }; | ||||
|         Slic3r::GUI::catch_error($self) and return; | ||||
|         # If possible, remove accents from accented latin characters. | ||||
|         # This function is useful for generating file names to be processed by legacy firmwares. | ||||
|         $default_output_file = Slic3r::GUI::fold_utf8_to_ascii($default_output_file); | ||||
|         my $dlg = Wx::FileDialog->new($self, L('Save G-code file as:'),  | ||||
|             wxTheApp->{app_config}->get_last_output_dir(dirname($default_output_file)), | ||||
|             basename($default_output_file), &Slic3r::GUI::FILE_WILDCARDS->{gcode}, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lukas Matena
						Lukas Matena