Browse Source

Make symbol/footprint trees sensitive to language change.

newinvert
Jeff Young 3 years ago
parent
commit
eef3492fc0
  1. 4
      common/eda_draw_frame.cpp
  2. 2
      common/lib_tree_model_adapter.cpp
  3. 10
      common/widgets/lib_tree.cpp
  4. 10
      eeschema/symbol_editor/symbol_edit_frame.cpp
  5. 10
      include/lib_tree_model_adapter.h
  6. 2
      include/widgets/lib_tree.h
  7. 2
      pcbnew/footprint_edit_frame.cpp
  8. 4
      pcbnew/widgets/appearance_controls.cpp

4
common/eda_draw_frame.cpp

@ -605,8 +605,8 @@ void EDA_DRAW_FRAME::DisplayGridMsg()
{
wxString msg;
msg.Printf( wxS( "grid %s" ), MessageTextFromValue( GetCanvas()->GetGAL()->GetGridSize().x,
false ) );
msg.Printf( _( "grid %s" ), MessageTextFromValue( GetCanvas()->GetGAL()->GetGridSize().x,
false ) );
SetStatusText( msg, 4 );
}

2
common/lib_tree_model_adapter.cpp

@ -269,7 +269,7 @@ void LIB_TREE_MODEL_ADAPTER::recreateColumns()
for( const wxString& colName : m_shownColumns )
{
if( !m_colNameMap.count( colName ) )
doAddColumn( colName, false );
doAddColumn( colName, colName == wxT( "Description" ) );
}
}

10
common/widgets/lib_tree.cpp

@ -185,6 +185,16 @@ LIB_TREE::~LIB_TREE()
}
void LIB_TREE::ShowChangedLanguage()
{
if( m_query_ctrl )
m_query_ctrl->SetDescriptiveText( _( "Filter" ) );
if( m_adapter )
m_adapter->ShowChangedLanguage();
}
LIB_ID LIB_TREE::GetSelectedLibId( int* aUnit ) const
{
wxDataViewItem sel = m_tree_ctrl->GetSelection();

10
eeschema/symbol_editor/symbol_edit_frame.cpp

@ -1197,6 +1197,16 @@ void SYMBOL_EDIT_FRAME::ShowChangedLanguage()
// tooltips in toolbars
RecreateToolbars();
// For some obscure reason, the AUI manager hides the first modified pane.
// So force show panes
wxAuiPaneInfo& tree_pane_info = m_auimgr.GetPane( m_treePane );
bool tree_shown = tree_pane_info.IsShown();
tree_pane_info.Caption( _( "Libraries" ) );
tree_pane_info.Show( tree_shown );
m_auimgr.Update();
m_treePane->GetLibTree()->ShowChangedLanguage();
// status bar
UpdateMsgPanel();

10
include/lib_tree_model_adapter.h

@ -181,11 +181,6 @@ public:
const std::vector<LIB_TREE_ITEM*>& aItemList,
bool pinned, bool presorted );
void AddColumn( const wxString& aHeader )
{
doAddColumn( aHeader, false );
}
std::vector<wxString> GetAvailableColumns() const { return m_availableColumns; }
std::vector<wxString> GetShownColumns() const { return m_shownColumns; }
@ -303,6 +298,11 @@ public:
void PinLibrary( LIB_TREE_NODE* aTreeNode );
void UnpinLibrary( LIB_TREE_NODE* aTreeNode );
void ShowChangedLanguage()
{
recreateColumns();
}
protected:
/**
* Convert #SYM_TREE_NODE -> wxDataViewItem.

2
include/widgets/lib_tree.h

@ -144,6 +144,8 @@ public:
*/
void FocusSearchFieldIfExists();
void ShowChangedLanguage();
protected:
/**
* Expand or collapse a node, switching it to the opposite state.

2
pcbnew/footprint_edit_frame.cpp

@ -890,6 +890,8 @@ void FOOTPRINT_EDIT_FRAME::ShowChangedLanguage()
tree_pane_info.Show( tree_shown );
m_auimgr.Update();
m_treePane->GetLibTree()->ShowChangedLanguage();
UpdateTitle();
}

4
pcbnew/widgets/appearance_controls.cpp

@ -1005,7 +1005,9 @@ void APPEARANCE_CONTROLS::OnLanguageChanged()
{
m_notebook->SetPageText( 0, _( "Layers" ) );
m_notebook->SetPageText( 1, _( "Objects" ) );
m_notebook->SetPageText( 2, _( "Nets" ) );
if( m_notebook->GetPageCount() >= 3 )
m_notebook->SetPageText( 2, _( "Nets" ) );
Freeze();
rebuildLayers();

Loading…
Cancel
Save