Update description in footprint tree when it's edited.
Fixes: lp:1842660
* https://bugs.launchpad.net/kicad/+bug/1842660
(cherry picked from commit 6688e80131
)
This commit is contained in:
parent
a79526cad8
commit
0e90c719b0
|
@ -826,6 +826,22 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class BASIC_FOOTPRINT_INFO : public FOOTPRINT_INFO
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
BASIC_FOOTPRINT_INFO( MODULE* aModule )
|
||||||
|
{
|
||||||
|
m_nickname = aModule->GetFPID().GetLibNickname().wx_str();
|
||||||
|
m_fpname = aModule->GetFPID().GetLibItemName().wx_str();
|
||||||
|
m_pad_count = aModule->GetPadCount( DO_NOT_INCLUDE_NPTH );
|
||||||
|
m_unique_pad_count = aModule->GetUniquePadCount( DO_NOT_INCLUDE_NPTH );
|
||||||
|
m_keywords = aModule->GetKeywords();
|
||||||
|
m_doc = aModule->GetDescription();
|
||||||
|
m_loaded = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
void FOOTPRINT_EDIT_FRAME::editFootprintProperties( MODULE* aModule )
|
void FOOTPRINT_EDIT_FRAME::editFootprintProperties( MODULE* aModule )
|
||||||
{
|
{
|
||||||
LIB_ID oldFPID = aModule->GetFPID();
|
LIB_ID oldFPID = aModule->GetFPID();
|
||||||
|
@ -835,6 +851,12 @@ void FOOTPRINT_EDIT_FRAME::editFootprintProperties( MODULE* aModule )
|
||||||
|
|
||||||
GetScreen()->GetCurItem()->ClearFlags();
|
GetScreen()->GetCurItem()->ClearFlags();
|
||||||
|
|
||||||
|
// Update library tree
|
||||||
|
BASIC_FOOTPRINT_INFO footprintInfo( aModule );
|
||||||
|
wxDataViewItem treeItem = m_adapter->FindItem( oldFPID );
|
||||||
|
static_cast<LIB_TREE_NODE_LIB_ID*>( treeItem.GetID() )->Update( &footprintInfo );
|
||||||
|
m_treePane->GetLibTree()->Refresh();
|
||||||
|
|
||||||
updateTitle(); // in case of a name change...
|
updateTitle(); // in case of a name change...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,10 +176,7 @@ void FP_TREE_SYNCHRONIZING_ADAPTER::GetValue( wxVariant& aVariant, wxDataViewIte
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
if( node->LibId == m_frame->GetLoadedFPID() && !m_frame->IsCurrentFPFromBoard() )
|
aVariant = node->Desc;
|
||||||
aVariant = m_frame->GetBoard()->m_Modules->GetDescription();
|
|
||||||
else
|
|
||||||
aVariant = node->Desc;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: // column == -1 is used for default Compare function
|
default: // column == -1 is used for default Compare function
|
||||||
|
|
Loading…
Reference in New Issue