mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Ask for confirmation when deselecting a dirty preset.
This commit is contained in:
		
							parent
							
								
									848784ad95
								
							
						
					
					
						commit
						9e1308c03f
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -142,7 +142,12 @@ sub on_select_preset {
 | 
			
		|||
    my $self = shift;
 | 
			
		||||
    
 | 
			
		||||
    if (defined $self->{dirty}) {
 | 
			
		||||
        # TODO: prompt user?
 | 
			
		||||
        my $confirm = Wx::MessageDialog->new($self, 'You have unsaved changes. Discard changes and continue anyway?',
 | 
			
		||||
                                             'Unsaved Changes', wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION);
 | 
			
		||||
        if ($confirm->ShowModal == wxID_NO) {
 | 
			
		||||
            $self->{presets_choice}->SetSelection($self->{dirty});
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        $self->set_dirty(0);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue