Make symbol/footprint trees sensitive to language change.
(cherry picked from commit eef3492fc0
)
This commit is contained in:
parent
724262651f
commit
1f34883a27
|
@ -613,8 +613,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 );
|
||||
}
|
||||
|
|
|
@ -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" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -1199,6 +1199,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();
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -144,6 +144,8 @@ public:
|
|||
*/
|
||||
void FocusSearchFieldIfExists();
|
||||
|
||||
void ShowChangedLanguage();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Expand or collapse a node, switching it to the opposite state.
|
||||
|
|
|
@ -873,6 +873,8 @@ void FOOTPRINT_EDIT_FRAME::ShowChangedLanguage()
|
|||
tree_pane_info.Show( tree_shown );
|
||||
m_auimgr.Update();
|
||||
|
||||
m_treePane->GetLibTree()->ShowChangedLanguage();
|
||||
|
||||
UpdateTitle();
|
||||
}
|
||||
|
||||
|
|
|
@ -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…
Reference in New Issue