Cvpcb: Reload footprint libraries in CVPCB
CHANGED: Reload footprint libraries in CVPCB when footprint library table(fp-lib-table) is updated
This commit is contained in:
parent
3a7068b346
commit
5b9fcc0ba0
|
@ -1040,6 +1040,7 @@ void CVPCB_MAINFRAME::BuildLibrariesListBox()
|
||||||
FP_LIB_TABLE* tbl = Prj().PcbFootprintLibs();
|
FP_LIB_TABLE* tbl = Prj().PcbFootprintLibs();
|
||||||
std::set<wxString> pinnedMatches;
|
std::set<wxString> pinnedMatches;
|
||||||
std::set<wxString> otherMatches;
|
std::set<wxString> otherMatches;
|
||||||
|
m_librariesListBox->ClearList();
|
||||||
|
|
||||||
auto process =
|
auto process =
|
||||||
[&]( const wxString& aNickname )
|
[&]( const wxString& aNickname )
|
||||||
|
@ -1247,7 +1248,13 @@ void CVPCB_MAINFRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
||||||
Go into SCH_EDIT_FRAME::OnOpenCvpcb( wxCommandEvent& event ) and trim GNL_ALL down.
|
Go into SCH_EDIT_FRAME::OnOpenCvpcb( wxCommandEvent& event ) and trim GNL_ALL down.
|
||||||
*/
|
*/
|
||||||
break;
|
break;
|
||||||
|
case MAIL_RELOAD_LIB:
|
||||||
|
m_cannotClose = true;
|
||||||
|
LoadFootprintFiles();
|
||||||
|
BuildFootprintsListBox();
|
||||||
|
BuildLibrariesListBox();
|
||||||
|
m_cannotClose = false;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
; // ignore most
|
; // ignore most
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,6 +129,10 @@ void LIBRARY_LISTBOX::Finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LIBRARY_LISTBOX::ClearList()
|
||||||
|
{
|
||||||
|
m_libraryList.clear();
|
||||||
|
}
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE( LIBRARY_LISTBOX, ITEMS_LISTBOX_BASE )
|
BEGIN_EVENT_TABLE( LIBRARY_LISTBOX, ITEMS_LISTBOX_BASE )
|
||||||
EVT_CHAR( LIBRARY_LISTBOX::OnChar )
|
EVT_CHAR( LIBRARY_LISTBOX::OnChar )
|
||||||
|
|
|
@ -150,6 +150,7 @@ public:
|
||||||
void SetString( unsigned linecount, const wxString& text );
|
void SetString( unsigned linecount, const wxString& text );
|
||||||
void AppendLine( const wxString& text );
|
void AppendLine( const wxString& text );
|
||||||
void Finish();
|
void Finish();
|
||||||
|
void ClearList();
|
||||||
|
|
||||||
wxString GetSelectedLibrary();
|
wxString GetSelectedLibrary();
|
||||||
wxString OnGetItemText( long item, long column ) const override;
|
wxString OnGetItemText( long item, long column ) const override;
|
||||||
|
|
|
@ -51,7 +51,8 @@ enum MAIL_T
|
||||||
MAIL_PCB_UPDATE_LINKS, // Update the schematic symbol paths in the PCB's footprints
|
MAIL_PCB_UPDATE_LINKS, // Update the schematic symbol paths in the PCB's footprints
|
||||||
MAIL_SCH_REFRESH, // Tell the schematic editor to refresh the display.
|
MAIL_SCH_REFRESH, // Tell the schematic editor to refresh the display.
|
||||||
MAIL_LIB_EDIT,
|
MAIL_LIB_EDIT,
|
||||||
MAIL_FP_EDIT
|
MAIL_FP_EDIT,
|
||||||
|
MAIL_RELOAD_LIB //Reload Library List if one was added
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAIL_TYPE_H_
|
#endif // MAIL_TYPE_H_
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
#include <footprint_viewer_frame.h>
|
#include <footprint_viewer_frame.h>
|
||||||
#include <footprint_edit_frame.h>
|
#include <footprint_edit_frame.h>
|
||||||
#include <kiway.h>
|
#include <kiway.h>
|
||||||
|
#include <kiway_express.h>
|
||||||
#include <widgets/grid_readonly_text_helpers.h>
|
#include <widgets/grid_readonly_text_helpers.h>
|
||||||
#include <widgets/grid_text_button_helpers.h>
|
#include <widgets/grid_text_button_helpers.h>
|
||||||
#include <pcbnew_id.h> // For ID_PCBNEW_END_LIST
|
#include <pcbnew_id.h> // For ID_PCBNEW_END_LIST
|
||||||
|
@ -1136,4 +1137,7 @@ void InvokePcbLibTableEditor( KIWAY* aKiway, wxWindow* aCaller )
|
||||||
|
|
||||||
if( viewer )
|
if( viewer )
|
||||||
viewer->ReCreateLibraryList();
|
viewer->ReCreateLibraryList();
|
||||||
|
|
||||||
|
std::string payload = "";
|
||||||
|
aKiway->ExpressMail( FRAME_CVPCB, MAIL_RELOAD_LIB, payload );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue