mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Bugfix: the delete button was deleting the wrong preset
This commit is contained in:
		
							parent
							
								
									f173096a6c
								
							
						
					
					
						commit
						b209eab712
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -108,10 +108,10 @@ sub new {
 | 
			
		|||
        return if $i == 0;  # this shouldn't happen but let's trap it anyway
 | 
			
		||||
        my $res = Wx::MessageDialog->new($self, "Are you sure you want to delete the selected preset?", 'Delete Preset', wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION)->ShowModal;
 | 
			
		||||
        return unless $res == wxID_YES;
 | 
			
		||||
        if (-e $self->{presets}[$i-1]{file}) {
 | 
			
		||||
            unlink $self->{presets}[$i-1]{file};
 | 
			
		||||
        if (-e $self->{presets}[$i]{file}) {
 | 
			
		||||
            unlink $self->{presets}[$i]{file};
 | 
			
		||||
        }
 | 
			
		||||
        splice @{$self->{presets}}, $i-1, 1;
 | 
			
		||||
        splice @{$self->{presets}}, $i, 1;
 | 
			
		||||
        $self->{presets_choice}->Delete($i);
 | 
			
		||||
        $self->{presets_choice}->SetSelection(0);
 | 
			
		||||
        $self->on_select_preset;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue