Prompt for unsaved changes in the lib fields table editor
(cherry picked from commit 344fab5741)
This commit is contained in:
@@ -853,6 +853,18 @@ void DIALOG_LIB_FIELDS::OnTableColSize(wxGridSizeEvent& aEvent)
|
||||
|
||||
void DIALOG_LIB_FIELDS::OnCancel(wxCommandEvent& event)
|
||||
{
|
||||
m_grid->CommitPendingChanges( true );
|
||||
|
||||
if( m_dataModel->IsEdited() )
|
||||
{
|
||||
if( !HandleUnsavedChanges( this, _( "Save changes?" ),
|
||||
[&]() -> bool
|
||||
{
|
||||
return TransferDataFromWindow();
|
||||
} ) )
|
||||
return;
|
||||
}
|
||||
|
||||
EndModal( wxID_CANCEL );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user