Symbol Fields Table: don't leave Qty editable on error

This commit is contained in:
Mike Williams 2023-02-01 10:18:07 -05:00
parent 4c18dfebb9
commit ab954456ee
1 changed files with 5 additions and 5 deletions

View File

@ -1056,11 +1056,6 @@ void DIALOG_SYMBOL_FIELDS_TABLE::LoadFieldNames()
void DIALOG_SYMBOL_FIELDS_TABLE::OnAddField( wxCommandEvent& event )
{
// quantities column will become new field column, so it needs to be reset
wxGridCellAttr* attr = new wxGridCellAttr;
m_grid->SetColAttr( m_dataModel->GetColsCount() - 1, attr );
m_grid->SetColFormatCustom( m_dataModel->GetColsCount() - 1, wxGRID_VALUE_STRING );
wxTextEntryDialog dlg( this, _( "New field name:" ), _( "Add Field" ) );
if( dlg.ShowModal() != wxID_OK )
@ -1084,6 +1079,11 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnAddField( wxCommandEvent& event )
}
}
// quantities column will become new field column, so it needs to be reset
wxGridCellAttr* attr = new wxGridCellAttr;
m_grid->SetColAttr( m_dataModel->GetColsCount() - 1, attr );
m_grid->SetColFormatCustom( m_dataModel->GetColsCount() - 1, wxGRID_VALUE_STRING );
std::string key( fieldName.ToUTF8() );
EESCHEMA_SETTINGS* cfg = static_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );