From 971eb529f4df0285cf1a74c3c938288781909fa6 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 16 Oct 2020 19:57:07 -0700 Subject: [PATCH] Separate strings into full strings --- eeschema/dialogs/dialog_change_symbols.cpp | 61 ++++++++----------- .../dialogs/dialog_change_symbols_base.cpp | 24 ++++---- .../dialogs/dialog_change_symbols_base.fbp | 24 ++++---- eeschema/dialogs/dialog_change_symbols_base.h | 4 +- 4 files changed, 52 insertions(+), 61 deletions(-) diff --git a/eeschema/dialogs/dialog_change_symbols.cpp b/eeschema/dialogs/dialog_change_symbols.cpp index ad1e4a4cd3..3f5d0d0db5 100644 --- a/eeschema/dialogs/dialog_change_symbols.cpp +++ b/eeschema/dialogs/dialog_change_symbols.cpp @@ -50,22 +50,15 @@ DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_COMPO m_mode( aMode ) { wxASSERT( aParent ); - wxString label; - wxString verb = ( m_mode == MODE::UPDATE ) ? _( "Update" ) : _( "Change" ); - wxString reset = ( m_mode == MODE::UPDATE ) ? _( "Reset" ) : _( "Update" ); - wxString library = ( m_mode == MODE::UPDATE ) ? _( "library" ) : _( "new" ); - - label.Printf( m_matchAll->GetLabel(), verb ); if( m_mode == MODE::UPDATE ) { - m_matchAll->SetLabel( label ); - SetTitle( _( "Update Symbol(s) from Library" ) ); m_newIdSizer->Show( false ); } else { - SetTitle( _( "Change Symbol(s)" ) ); + m_matchAll->SetLabel( _( "Change all symbols in schematic" ) ); + SetTitle( _( "Change Symbols" ) ); m_matchSizer->FindItem( m_matchAll )->Show( false ); } @@ -73,8 +66,9 @@ DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_COMPO { SCH_SHEET_PATH* currentSheet = &aParent->Schematic().CurrentSheet(); - label.Printf( m_matchBySelection->GetLabel(), verb ); - m_matchBySelection->SetLabel( label ); + if( m_mode == MODE::CHANGE ) + m_matchBySelection->SetLabel( _( "Change selected Symbol" ) ); + m_newId->AppendText( FROM_UTF8( m_symbol->GetLibId().Format().c_str() ) ); m_specifiedReference->ChangeValue( m_symbol->GetRef( currentSheet ) ); m_specifiedValue->ChangeValue( m_symbol->GetValue( currentSheet ) ); @@ -88,12 +82,12 @@ DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_COMPO m_matchIdBrowserButton->SetBitmap( KiBitmap( small_library_xpm ) ); m_newIdBrowserButton->SetBitmap( KiBitmap( small_library_xpm ) ); - label.Printf( m_matchByReference->GetLabel(), verb ); - m_matchByReference->SetLabel( label ); - label.Printf( m_matchByValue->GetLabel(), verb ); - m_matchByValue->SetLabel( label ); - label.Printf( m_matchById->GetLabel(), verb ); - m_matchById->SetLabel( label ); + if( m_mode == MODE::CHANGE ) + { + m_matchByReference->SetLabel( _( "Change symbols matching reference designator:" ) ); + m_matchByValue->SetLabel( _( "Change symbols matching value:" ) ); + m_matchById->SetLabel( _( "Change symbols matching library identifier:" ) ); + } m_matchSizer->SetEmptyCellSize( wxSize( 0, 0 ) ); m_matchSizer->Layout(); @@ -122,23 +116,15 @@ DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_COMPO m_matchByReference->SetValue( true ); } - label.Printf( m_updateFieldsSizer->GetStaticBox()->GetLabel(), reset ); - m_updateFieldsSizer->GetStaticBox()->SetLabel( label ); - - label.Printf( m_removeExtraBox->GetLabel(), library ); - m_removeExtraBox->SetLabel( label ); - - label.Printf( m_resetEmptyFields->GetLabel(), library ); - m_resetEmptyFields->SetLabel( label ); - - label.Printf( m_resetFieldVisibilities->GetLabel(), reset ); - m_resetFieldVisibilities->SetLabel( label ); - - label.Printf( m_resetFieldEffects->GetLabel(), reset ); - m_resetFieldEffects->SetLabel( label ); - - label.Printf( m_resetFieldPositions->GetLabel(), reset ); - m_resetFieldPositions->SetLabel( label ); + if( m_mode == MODE::CHANGE ) + { + m_updateFieldsSizer->GetStaticBox()->SetLabel( _( "Update Fields") ); + m_removeExtraBox->SetLabel( _( "Remove fields if not in new symbol" ) ); + m_resetEmptyFields->SetLabel( _( "Reset fields if empty in new symbol" ) ); + m_resetFieldVisibilities->SetLabel( _( "Update field visibilities" ) ); + m_resetFieldEffects->SetLabel( _( "Update field sizes and styles" ) ); + m_resetFieldPositions->SetLabel( _( "Update field positions" ) ); + } m_removeExtraBox->SetValue( g_removeExtraFields ); m_resetEmptyFields->SetValue( g_resetEmptyFields ); @@ -153,7 +139,12 @@ DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_COMPO // Ensure m_closeButton (with id = wxID_CANCEL) has the right label // (to fix automatic renaming of button label ) m_sdbSizerCancel->SetLabel( _( "Close" ) ); - m_sdbSizerOK->SetLabel( verb ); + + if( m_mode == MODE::CHANGE ) + m_sdbSizerOK->SetLabel( _( "Change" ) ); + else + m_sdbSizerOK->SetLabel( _( "Update" ) ); + m_sdbSizerOK->SetDefault(); // Now all widgets have the size fixed, call FinishDialogSettings diff --git a/eeschema/dialogs/dialog_change_symbols_base.cpp b/eeschema/dialogs/dialog_change_symbols_base.cpp index cb8a990039..8db8cd469d 100644 --- a/eeschema/dialogs/dialog_change_symbols_base.cpp +++ b/eeschema/dialogs/dialog_change_symbols_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version 3.9.0 Jul 27 2020) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -24,25 +24,25 @@ DIALOG_CHANGE_SYMBOLS_BASE::DIALOG_CHANGE_SYMBOLS_BASE( wxWindow* parent, wxWind m_matchSizer->SetFlexibleDirection( wxBOTH ); m_matchSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_matchAll = new wxRadioButton( this, wxID_ANY, _("%s all symbols in schematic"), wxDefaultPosition, wxDefaultSize, 0 ); + m_matchAll = new wxRadioButton( this, wxID_ANY, _("Update all symbols in schematic"), wxDefaultPosition, wxDefaultSize, 0 ); m_matchSizer->Add( m_matchAll, wxGBPosition( 0, 0 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); - m_matchBySelection = new wxRadioButton( this, wxID_ANY, _("%s selected symbol"), wxDefaultPosition, wxDefaultSize, 0 ); + m_matchBySelection = new wxRadioButton( this, wxID_ANY, _("Update selected symbol"), wxDefaultPosition, wxDefaultSize, 0 ); m_matchSizer->Add( m_matchBySelection, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); - m_matchByReference = new wxRadioButton( this, wxID_ANY, _("%s symbols matching reference designator:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_matchByReference = new wxRadioButton( this, wxID_ANY, _("Update symbols matching reference designator:"), wxDefaultPosition, wxDefaultSize, 0 ); m_matchSizer->Add( m_matchByReference, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM, 2 ); m_specifiedReference = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 200,-1 ), wxTE_PROCESS_ENTER ); m_matchSizer->Add( m_specifiedReference, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM, 2 ); - m_matchByValue = new wxRadioButton( this, wxID_ANY, _("%s symbols matching value:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_matchByValue = new wxRadioButton( this, wxID_ANY, _("Update symbols matching value:"), wxDefaultPosition, wxDefaultSize, 0 ); m_matchSizer->Add( m_matchByValue, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_specifiedValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); m_matchSizer->Add( m_specifiedValue, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - m_matchById = new wxRadioButton( this, wxID_ANY, _("%s symbols matching library indentifier:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_matchById = new wxRadioButton( this, wxID_ANY, _("Update symbols matching library identifier:"), wxDefaultPosition, wxDefaultSize, 0 ); m_matchSizer->Add( m_matchById, wxGBPosition( 4, 0 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxTOP, 6 ); m_specifiedId = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); @@ -91,7 +91,7 @@ DIALOG_CHANGE_SYMBOLS_BASE::DIALOG_CHANGE_SYMBOLS_BASE( wxWindow* parent, wxWind wxBoxSizer* bSizerUpdate; bSizerUpdate = new wxBoxSizer( wxHORIZONTAL ); - m_updateFieldsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("%s Fields") ), wxVERTICAL ); + m_updateFieldsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Reset Fields") ), wxVERTICAL ); wxArrayString m_fieldsBoxChoices; m_fieldsBox = new wxCheckListBox( m_updateFieldsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_fieldsBoxChoices, wxLB_NEEDED_SB ); @@ -116,24 +116,24 @@ DIALOG_CHANGE_SYMBOLS_BASE::DIALOG_CHANGE_SYMBOLS_BASE( wxWindow* parent, wxWind m_updateOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); - m_removeExtraBox = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Remove fields if not in %s symbol"), wxDefaultPosition, wxDefaultSize, 0 ); + m_removeExtraBox = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Remove fields if not in library symbol"), wxDefaultPosition, wxDefaultSize, 0 ); m_removeExtraBox->SetToolTip( _("Removes fields that do not occur in the original library symbols") ); m_updateOptionsSizer->Add( m_removeExtraBox, 0, wxBOTTOM|wxRIGHT, 4 ); - m_resetEmptyFields = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset fields if empty in %s symbol"), wxDefaultPosition, wxDefaultSize, 0 ); + m_resetEmptyFields = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset fields if empty in library symbol"), wxDefaultPosition, wxDefaultSize, 0 ); m_updateOptionsSizer->Add( m_resetEmptyFields, 0, wxBOTTOM|wxRIGHT, 4 ); m_updateOptionsSizer->Add( 0, 15, 0, wxEXPAND, 5 ); - m_resetFieldVisibilities = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("%s field visibilities"), wxDefaultPosition, wxDefaultSize, 0 ); + m_resetFieldVisibilities = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset field visibilities"), wxDefaultPosition, wxDefaultSize, 0 ); m_updateOptionsSizer->Add( m_resetFieldVisibilities, 0, wxBOTTOM|wxRIGHT, 4 ); - m_resetFieldEffects = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("%s field sizes and styles"), wxDefaultPosition, wxDefaultSize, 0 ); + m_resetFieldEffects = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset field sizes and styles"), wxDefaultPosition, wxDefaultSize, 0 ); m_updateOptionsSizer->Add( m_resetFieldEffects, 0, wxBOTTOM|wxRIGHT, 4 ); - m_resetFieldPositions = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("%s field positions"), wxDefaultPosition, wxDefaultSize, 0 ); + m_resetFieldPositions = new wxCheckBox( m_updateOptionsSizer->GetStaticBox(), wxID_ANY, _("Reset field positions"), wxDefaultPosition, wxDefaultSize, 0 ); m_updateOptionsSizer->Add( m_resetFieldPositions, 0, wxBOTTOM|wxRIGHT, 4 ); diff --git a/eeschema/dialogs/dialog_change_symbols_base.fbp b/eeschema/dialogs/dialog_change_symbols_base.fbp index 1c09048aaa..4e1fb169ad 100644 --- a/eeschema/dialogs/dialog_change_symbols_base.fbp +++ b/eeschema/dialogs/dialog_change_symbols_base.fbp @@ -48,7 +48,7 @@ -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h; forward_declare - %s + Update Symbols from Library @@ -117,7 +117,7 @@ 0 0 wxID_ANY - %s all symbols in schematic + Update all symbols in schematic 0 @@ -185,7 +185,7 @@ 0 0 wxID_ANY - %s selected symbol + Update selected symbol 0 @@ -253,7 +253,7 @@ 0 0 wxID_ANY - %s symbols matching reference designator: + Update symbols matching reference designator: 0 @@ -389,7 +389,7 @@ 0 0 wxID_ANY - %s symbols matching value: + Update symbols matching value: 0 @@ -526,7 +526,7 @@ 0 0 wxID_ANY - %s symbols matching library indentifier: + Update symbols matching library identifier: 0 @@ -1009,7 +1009,7 @@ 1 wxID_ANY - %s Fields + Reset Fields m_updateFieldsSizer wxVERTICAL @@ -1282,7 +1282,7 @@ 0 0 wxID_ANY - Remove fields if not in %s symbol + Remove fields if not in library symbol 0 @@ -1346,7 +1346,7 @@ 0 0 wxID_ANY - Reset fields if empty in %s symbol + Reset fields if empty in library symbol 0 @@ -1420,7 +1420,7 @@ 0 0 wxID_ANY - %s field visibilities + Reset field visibilities 0 @@ -1484,7 +1484,7 @@ 0 0 wxID_ANY - %s field sizes and styles + Reset field sizes and styles 0 @@ -1548,7 +1548,7 @@ 0 0 wxID_ANY - %s field positions + Reset field positions 0 diff --git a/eeschema/dialogs/dialog_change_symbols_base.h b/eeschema/dialogs/dialog_change_symbols_base.h index 9dd9d852e1..257c3ee9d6 100644 --- a/eeschema/dialogs/dialog_change_symbols_base.h +++ b/eeschema/dialogs/dialog_change_symbols_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version 3.9.0 Jul 27 2020) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -93,7 +93,7 @@ class DIALOG_CHANGE_SYMBOLS_BASE : public DIALOG_SHIM public: - DIALOG_CHANGE_SYMBOLS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("%s"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_CHANGE_SYMBOLS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Update Symbols from Library"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_CHANGE_SYMBOLS_BASE(); };