diff --git a/eeschema/dialogs/dialog_change_symbols.cpp b/eeschema/dialogs/dialog_change_symbols.cpp index 85ff3759ca..c66f8ea0ba 100644 --- a/eeschema/dialogs/dialog_change_symbols.cpp +++ b/eeschema/dialogs/dialog_change_symbols.cpp @@ -47,6 +47,7 @@ bool g_resetFieldVisibilities[2] = { true, false }; bool g_resetFieldEffects[2] = { true, false }; bool g_resetFieldPositions[2] = { true, false }; bool g_resetAttributes[2] = { true, false }; +bool g_resetCustomPower[2] = { false, false }; DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_SYMBOL* aSymbol, @@ -146,6 +147,7 @@ DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_SYMBO m_resetFieldEffects->SetValue( g_resetFieldEffects[ (int) m_mode ] ); m_resetFieldPositions->SetValue( g_resetFieldPositions[ (int) m_mode ] ); m_resetAttributes->SetValue( g_resetAttributes[ (int) m_mode ] ); + m_resetCustomPower->SetValue( g_resetCustomPower[ (int) m_mode ] ); // DIALOG_SHIM needs a unique hash_key because classname is not sufficient // because the update and change versions of this dialog have different controls. @@ -227,6 +229,7 @@ DIALOG_CHANGE_SYMBOLS::~DIALOG_CHANGE_SYMBOLS() g_resetFieldEffects[ (int) m_mode ] = m_resetFieldEffects->GetValue(); g_resetFieldPositions[ (int) m_mode ] = m_resetFieldPositions->GetValue(); g_resetAttributes[ (int) m_mode ] = m_resetAttributes->GetValue(); + g_resetCustomPower[ (int) m_mode ] = m_resetCustomPower->GetValue(); } @@ -671,7 +674,9 @@ int DIALOG_CHANGE_SYMBOLS::processSymbols( SCH_COMMIT* aCommit, } else if( i == VALUE_FIELD ) { - symbol->SetValueFieldText( UnescapeString( libField->GetText() ) ); + if( ( symbol->IsPower() && m_resetCustomPower->IsChecked() ) + || !symbol->IsPower() ) + symbol->SetValueFieldText( UnescapeString( libField->GetText() ) ); } else if( i == FOOTPRINT_FIELD ) { diff --git a/eeschema/dialogs/dialog_change_symbols_base.cpp b/eeschema/dialogs/dialog_change_symbols_base.cpp index 7266e44158..2c1e40b055 100644 --- a/eeschema/dialogs/dialog_change_symbols_base.cpp +++ b/eeschema/dialogs/dialog_change_symbols_base.cpp @@ -146,6 +146,11 @@ DIALOG_CHANGE_SYMBOLS_BASE::DIALOG_CHANGE_SYMBOLS_BASE( wxWindow* parent, wxWind m_resetAttributes = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Update/reset symbol attributes"), wxDefaultPosition, wxDefaultSize, 0 ); m_updateOptionsSizer->Add( m_resetAttributes, 0, wxBOTTOM|wxRIGHT, 5 ); + m_updateOptionsSizer->Add( 0, 10, 1, wxEXPAND, 5 ); + + m_resetCustomPower = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset custom power symbols"), wxDefaultPosition, wxDefaultSize, 0 ); + m_updateOptionsSizer->Add( m_resetCustomPower, 0, wxBOTTOM|wxRIGHT, 5 ); + bSizerUpdate->Add( m_updateOptionsSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 8 ); diff --git a/eeschema/dialogs/dialog_change_symbols_base.h b/eeschema/dialogs/dialog_change_symbols_base.h index fe5a6a98c8..321048546a 100644 --- a/eeschema/dialogs/dialog_change_symbols_base.h +++ b/eeschema/dialogs/dialog_change_symbols_base.h @@ -74,6 +74,7 @@ class DIALOG_CHANGE_SYMBOLS_BASE : public DIALOG_SHIM wxCheckBox* m_resetFieldEffects; wxCheckBox* m_resetFieldPositions; wxCheckBox* m_resetAttributes; + wxCheckBox* m_resetCustomPower; WX_HTML_REPORT_PANEL* m_messagePanel; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK;