PCM: autoload libs from installed packages to global lib tables
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/9713
This commit is contained in:
parent
fc813b79aa
commit
6ebb3baa3b
|
@ -30,11 +30,13 @@
|
|||
#include <lib_table_lexer.h>
|
||||
#include <pgm_base.h>
|
||||
#include <search_stack.h>
|
||||
#include <settings/kicad_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <systemdirsappend.h>
|
||||
#include <fp_lib_table.h>
|
||||
#include <footprint.h>
|
||||
|
||||
#include <wx/dir.h>
|
||||
#include <wx/hash.h>
|
||||
|
||||
#define OPT_SEP '|' ///< options separator character
|
||||
|
@ -478,6 +480,66 @@ const wxString FP_LIB_TABLE::GlobalPathEnvVariableName()
|
|||
}
|
||||
|
||||
|
||||
class PCM_FP_LIB_TRAVERSER final : public wxDirTraverser
|
||||
{
|
||||
public:
|
||||
explicit PCM_FP_LIB_TRAVERSER( const wxString& aPath, FP_LIB_TABLE& aTable,
|
||||
const wxString& aPrefix ) :
|
||||
m_path_prefix( aPath ),
|
||||
m_lib_table( aTable ), m_lib_prefix( aPrefix )
|
||||
{
|
||||
wxFileName f( aPath, "" );
|
||||
m_prefix_dir_count = f.GetDirCount();
|
||||
}
|
||||
|
||||
wxDirTraverseResult OnFile( const wxString& aFilePath ) override { return wxDIR_CONTINUE; }
|
||||
|
||||
wxDirTraverseResult OnDir( const wxString& dirPath ) override
|
||||
{
|
||||
wxFileName dir = wxFileName::DirName( dirPath );
|
||||
|
||||
// consider a directory to be a lib if it's name ends with .pretty and
|
||||
// it is under $KICAD6_3RD_PARTY/footprints/<pkgid>/ i.e. has nested level of at least +3
|
||||
if( dirPath.EndsWith( ".pretty" ) && dir.GetDirCount() >= m_prefix_dir_count + 3 )
|
||||
{
|
||||
wxArrayString parts = dir.GetDirs();
|
||||
parts.RemoveAt( 0, m_prefix_dir_count );
|
||||
parts.Insert( "${KICAD6_3RD_PARTY}", 0 );
|
||||
|
||||
wxString libPath = wxJoin( parts, '/' );
|
||||
|
||||
if( !m_lib_table.HasLibraryWithPath( libPath ) )
|
||||
{
|
||||
wxString name = parts.Last().substr( 0, parts.Last().length() - 7 );
|
||||
wxString nickname = wxString::Format( "%s%s", m_lib_prefix, name );
|
||||
|
||||
if( m_lib_table.HasLibrary( nickname ) )
|
||||
{
|
||||
int increment = 1;
|
||||
do
|
||||
{
|
||||
nickname = wxString::Format( "%s%s_%d", m_lib_prefix, name, increment );
|
||||
increment++;
|
||||
} while( m_lib_table.HasLibrary( nickname ) );
|
||||
}
|
||||
|
||||
m_lib_table.InsertRow(
|
||||
new FP_LIB_TABLE_ROW( nickname, libPath, wxT( "KiCad" ), wxEmptyString,
|
||||
_( "Added by Plugin and Content Manager" ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
return wxDIR_CONTINUE;
|
||||
}
|
||||
|
||||
private:
|
||||
FP_LIB_TABLE& m_lib_table;
|
||||
wxString m_path_prefix;
|
||||
wxString m_lib_prefix;
|
||||
size_t m_prefix_dir_count;
|
||||
};
|
||||
|
||||
|
||||
bool FP_LIB_TABLE::LoadGlobalTable( FP_LIB_TABLE& aTable )
|
||||
{
|
||||
bool tableExists = true;
|
||||
|
@ -518,6 +580,45 @@ bool FP_LIB_TABLE::LoadGlobalTable( FP_LIB_TABLE& aTable )
|
|||
|
||||
aTable.Load( fn.GetFullPath() );
|
||||
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
KICAD_SETTINGS* settings = mgr.GetAppSettings<KICAD_SETTINGS>();
|
||||
|
||||
wxString packagesPath = Pgm().GetLocalEnvVariables().at( wxT( "KICAD6_3RD_PARTY" ) ).GetValue();
|
||||
|
||||
if( settings->m_PcmLibAutoAdd )
|
||||
{
|
||||
// Scan for libraries in PCM packages directory
|
||||
|
||||
wxFileName d( packagesPath, "" );
|
||||
d.AppendDir( "footprints" );
|
||||
|
||||
if( d.DirExists() )
|
||||
{
|
||||
PCM_FP_LIB_TRAVERSER traverser( packagesPath, aTable, settings->m_PcmLibPrefix );
|
||||
wxDir dir( d.GetPath() );
|
||||
|
||||
dir.Traverse( traverser );
|
||||
}
|
||||
}
|
||||
|
||||
if( settings->m_PcmLibAutoRemove )
|
||||
{
|
||||
// Remove PCM libraries that no longer exist
|
||||
std::vector<wxString> to_remove;
|
||||
|
||||
for( size_t i = 0; i < aTable.GetCount(); i++ )
|
||||
{
|
||||
LIB_TABLE_ROW& row = aTable.At( i );
|
||||
wxString path = row.GetFullURI( true );
|
||||
|
||||
if( path.StartsWith( packagesPath ) && !wxDir::Exists( path ) )
|
||||
to_remove.push_back( row.GetNickName() );
|
||||
}
|
||||
|
||||
for( const wxString& nickName : to_remove )
|
||||
aTable.RemoveRow( aTable.FindRow( nickName ) );
|
||||
}
|
||||
|
||||
return tableExists;
|
||||
}
|
||||
|
||||
|
|
|
@ -168,6 +168,18 @@ bool LIB_TABLE::HasLibrary( const wxString& aNickname, bool aCheckEnabled ) cons
|
|||
}
|
||||
|
||||
|
||||
bool LIB_TABLE::HasLibraryWithPath( const wxString& aPath ) const
|
||||
{
|
||||
for( const LIB_TABLE_ROW& row : rows )
|
||||
{
|
||||
if( row.GetFullURI() == aPath )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
wxString LIB_TABLE::GetFullURI( const wxString& aNickname, bool aExpandEnvVars ) const
|
||||
{
|
||||
const LIB_TABLE_ROW* row = findRow( aNickname, true );
|
||||
|
|
|
@ -80,8 +80,13 @@ KICAD_SETTINGS::KICAD_SETTINGS() :
|
|||
m_params.emplace_back(
|
||||
new PARAM<wxString>( "pcm.last_download_dir", &m_PcmLastDownloadDir, "" ) );
|
||||
|
||||
m_params.emplace_back(
|
||||
new PARAM<bool>( "pcm.check_for_updates", &m_PcmUpdateCheck, true ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "pcm.check_for_updates", &m_PcmUpdateCheck, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "pcm.lib_auto_add", &m_PcmLibAutoAdd, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<bool>( "pcm.lib_auto_remove", &m_PcmLibAutoRemove, true ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<wxString>( "pcm.lib_prefix", &m_PcmLibPrefix, "PCM_" ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -27,11 +27,15 @@
|
|||
#include <lib_table_lexer.h>
|
||||
#include <pgm_base.h>
|
||||
#include <search_stack.h>
|
||||
#include <settings/kicad_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <systemdirsappend.h>
|
||||
#include <symbol_lib_table.h>
|
||||
#include <lib_symbol.h>
|
||||
|
||||
#include <wx/dir.h>
|
||||
|
||||
|
||||
#define OPT_SEP '|' ///< options separator character
|
||||
|
||||
using namespace LIB_TABLE_T;
|
||||
|
@ -516,6 +520,67 @@ const wxString SYMBOL_LIB_TABLE::GlobalPathEnvVariableName()
|
|||
}
|
||||
|
||||
|
||||
class PCM_SYM_LIB_TRAVERSER final : public wxDirTraverser
|
||||
{
|
||||
public:
|
||||
explicit PCM_SYM_LIB_TRAVERSER( const wxString& aPath, SYMBOL_LIB_TABLE& aTable,
|
||||
const wxString& aPrefix ) :
|
||||
m_path_prefix( aPath ),
|
||||
m_lib_table( aTable ), m_lib_prefix( aPrefix )
|
||||
{
|
||||
wxFileName f( aPath, "" );
|
||||
m_prefix_dir_count = f.GetDirCount();
|
||||
}
|
||||
|
||||
wxDirTraverseResult OnFile( const wxString& aFilePath ) override
|
||||
{
|
||||
wxFileName file = wxFileName::FileName( aFilePath );
|
||||
|
||||
// consider a file to be a lib if it's name ends with .kicad_sym and
|
||||
// it is under $KICAD6_3RD_PARTY/symbols/<pkgid>/ i.e. has nested level of at least +2
|
||||
if( file.GetExt() == wxT( "kicad_sym" ) && file.GetDirCount() >= m_prefix_dir_count + 2 )
|
||||
{
|
||||
wxArrayString parts = file.GetDirs();
|
||||
parts.RemoveAt( 0, m_prefix_dir_count );
|
||||
parts.Insert( "${KICAD6_3RD_PARTY}", 0 );
|
||||
parts.Add( file.GetFullName() );
|
||||
|
||||
wxString libPath = wxJoin( parts, '/' );
|
||||
|
||||
if( !m_lib_table.HasLibraryWithPath( libPath ) )
|
||||
{
|
||||
wxString name = parts.Last().substr( 0, parts.Last().length() - 10 );
|
||||
wxString nickname = wxString::Format( "%s%s", m_lib_prefix, name );
|
||||
|
||||
if( m_lib_table.HasLibrary( nickname ) )
|
||||
{
|
||||
int increment = 1;
|
||||
do
|
||||
{
|
||||
nickname = wxString::Format( "%s%s_%d", m_lib_prefix, name, increment );
|
||||
increment++;
|
||||
} while( m_lib_table.HasLibrary( nickname ) );
|
||||
}
|
||||
|
||||
m_lib_table.InsertRow(
|
||||
new SYMBOL_LIB_TABLE_ROW( nickname, libPath, wxT( "KiCad" ), wxEmptyString,
|
||||
_( "Added by Plugin and Content Manager" ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
return wxDIR_CONTINUE;
|
||||
}
|
||||
|
||||
wxDirTraverseResult OnDir( const wxString& dirPath ) override { return wxDIR_CONTINUE; }
|
||||
|
||||
private:
|
||||
SYMBOL_LIB_TABLE& m_lib_table;
|
||||
wxString m_path_prefix;
|
||||
wxString m_lib_prefix;
|
||||
size_t m_prefix_dir_count;
|
||||
};
|
||||
|
||||
|
||||
bool SYMBOL_LIB_TABLE::LoadGlobalTable( SYMBOL_LIB_TABLE& aTable )
|
||||
{
|
||||
bool tableExists = true;
|
||||
|
@ -556,6 +621,44 @@ bool SYMBOL_LIB_TABLE::LoadGlobalTable( SYMBOL_LIB_TABLE& aTable )
|
|||
|
||||
aTable.Load( fn.GetFullPath() );
|
||||
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
KICAD_SETTINGS* settings = mgr.GetAppSettings<KICAD_SETTINGS>();
|
||||
|
||||
wxString packagesPath = Pgm().GetLocalEnvVariables().at( wxT( "KICAD6_3RD_PARTY" ) ).GetValue();
|
||||
|
||||
if( settings->m_PcmLibAutoAdd )
|
||||
{
|
||||
// Scan for libraries in PCM packages directory
|
||||
wxFileName d( packagesPath, "" );
|
||||
d.AppendDir( "symbols" );
|
||||
|
||||
if( d.DirExists() )
|
||||
{
|
||||
PCM_SYM_LIB_TRAVERSER traverser( packagesPath, aTable, settings->m_PcmLibPrefix );
|
||||
wxDir dir( d.GetPath() );
|
||||
|
||||
dir.Traverse( traverser );
|
||||
}
|
||||
}
|
||||
|
||||
if( settings->m_PcmLibAutoRemove )
|
||||
{
|
||||
// Remove PCM libraries that no longer exist
|
||||
std::vector<wxString> to_remove;
|
||||
|
||||
for( size_t i = 0; i < aTable.GetCount(); i++ )
|
||||
{
|
||||
LIB_TABLE_ROW& row = aTable.At( i );
|
||||
wxString path = row.GetFullURI( true );
|
||||
|
||||
if( path.StartsWith( packagesPath ) && !wxFile::Exists( path ) )
|
||||
to_remove.push_back( row.GetNickName() );
|
||||
}
|
||||
|
||||
for( const wxString& nickName : to_remove )
|
||||
aTable.RemoveRow( aTable.FindRow( nickName ) );
|
||||
}
|
||||
|
||||
return tableExists;
|
||||
}
|
||||
|
||||
|
|
|
@ -420,6 +420,14 @@ public:
|
|||
*/
|
||||
bool HasLibrary( const wxString& aNickname, bool aCheckEnabled = false ) const;
|
||||
|
||||
/**
|
||||
* Test for the existence of \a aPath in the library table.
|
||||
*
|
||||
* @param aCheckEnabled if true will only return true for enabled libraries
|
||||
* @return true if a library \a aNickname exists in the table.
|
||||
*/
|
||||
bool HasLibraryWithPath( const wxString& aPath ) const;
|
||||
|
||||
/**
|
||||
* Return the logical library names, all of them that are pertinent to
|
||||
* a look up done on this LIB_TABLE.
|
||||
|
@ -450,7 +458,7 @@ public:
|
|||
* @param aRow is the row to remove
|
||||
* @return true if the row was found (and removed)
|
||||
*/
|
||||
bool RemoveRow( LIB_TABLE_ROW* aRow )
|
||||
bool RemoveRow( const LIB_TABLE_ROW* aRow )
|
||||
{
|
||||
for( auto iter = rows.begin(); iter != rows.end(); ++iter )
|
||||
{
|
||||
|
|
|
@ -46,7 +46,8 @@ public:
|
|||
*/
|
||||
int m_updateCheck;
|
||||
|
||||
enum UPDATE_CHECK {
|
||||
enum UPDATE_CHECK
|
||||
{
|
||||
UNINITIALIZED = 0,
|
||||
NOT_ALLOWED = 1,
|
||||
ALLOWED = 2
|
||||
|
@ -60,6 +61,12 @@ public:
|
|||
// This controls background update check for PCM.
|
||||
// It is set according to m_updateCheck on first start.
|
||||
bool m_PcmUpdateCheck;
|
||||
// Auto add libs to global table
|
||||
bool m_PcmLibAutoAdd;
|
||||
// Auto remove libs
|
||||
bool m_PcmLibAutoRemove;
|
||||
// Generated library nickname prefix
|
||||
wxString m_PcmLibPrefix;
|
||||
|
||||
protected:
|
||||
virtual std::string getLegacyFrameName() const override { return "KicadFrame"; }
|
||||
|
|
|
@ -27,9 +27,11 @@
|
|||
#include <pgm_base.h>
|
||||
#include <settings/kicad_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <widgets/ui_common.h>
|
||||
|
||||
PANEL_PCM_SETTINGS::PANEL_PCM_SETTINGS( wxWindow* parent ) : PANEL_PCM_SETTINGS_BASE( parent )
|
||||
{
|
||||
m_libHelp->SetFont( KIUI::GetInfoFont( this ).Italic() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,6 +41,9 @@ bool PANEL_PCM_SETTINGS::TransferDataToWindow()
|
|||
KICAD_SETTINGS* settings = mgr.GetAppSettings<KICAD_SETTINGS>();
|
||||
|
||||
m_updateCheck->SetValue( settings->m_PcmUpdateCheck );
|
||||
m_libAutoAdd->SetValue( settings->m_PcmLibAutoAdd );
|
||||
m_libAutoRemove->SetValue( settings->m_PcmLibAutoRemove );
|
||||
m_libPrefix->SetValue( settings->m_PcmLibPrefix );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -50,6 +55,9 @@ bool PANEL_PCM_SETTINGS::TransferDataFromWindow()
|
|||
KICAD_SETTINGS* settings = mgr.GetAppSettings<KICAD_SETTINGS>();
|
||||
|
||||
settings->m_PcmUpdateCheck = m_updateCheck->GetValue();
|
||||
settings->m_PcmLibAutoAdd = m_libAutoAdd->GetValue();
|
||||
settings->m_PcmLibAutoRemove = m_libAutoRemove->GetValue();
|
||||
settings->m_PcmLibPrefix = m_libPrefix->GetValue();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -14,9 +14,46 @@ PANEL_PCM_SETTINGS_BASE::PANEL_PCM_SETTINGS_BASE( wxWindow* parent, wxWindowID i
|
|||
wxBoxSizer* bSizer1;
|
||||
bSizer1 = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_updateCheck = new wxCheckBox( this, wxID_ANY, _("Check for package updates on startup"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
wxStaticBoxSizer* sbSizer1;
|
||||
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("General") ), wxVERTICAL );
|
||||
|
||||
m_updateCheck = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Check for package updates on startup"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_updateCheck->SetValue(true);
|
||||
bSizer1->Add( m_updateCheck, 0, wxALL, 5 );
|
||||
sbSizer1->Add( m_updateCheck, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bSizer1->Add( sbSizer1, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxStaticBoxSizer* sbSizer2;
|
||||
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Library package handling") ), wxVERTICAL );
|
||||
|
||||
m_libAutoAdd = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_ANY, _("Automatically add installed libraries to global lib table"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_libAutoAdd->SetValue(true);
|
||||
sbSizer2->Add( m_libAutoAdd, 0, wxALL, 5 );
|
||||
|
||||
m_libAutoRemove = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_ANY, _("Automatically remove uninstalled libraries"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_libAutoRemove->SetValue(true);
|
||||
sbSizer2->Add( m_libAutoRemove, 0, wxALL, 5 );
|
||||
|
||||
wxBoxSizer* bSizer2;
|
||||
bSizer2 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_staticText1 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Library nickname prefix:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText1->Wrap( -1 );
|
||||
bSizer2->Add( m_staticText1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_libPrefix = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer2->Add( m_libPrefix, 0, wxALL, 5 );
|
||||
|
||||
|
||||
sbSizer2->Add( bSizer2, 1, wxEXPAND, 5 );
|
||||
|
||||
m_libHelp = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("After packages are (un)installed KiCad may need to be restarted to reflect changes in the global library table."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_libHelp->Wrap( -1 );
|
||||
sbSizer2->Add( m_libHelp, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bSizer1->Add( sbSizer2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bSizer1 );
|
||||
|
|
|
@ -59,66 +59,419 @@
|
|||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">1</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<object class="wxStaticBoxSizer" expanded="1">
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Check for package updates on startup</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="label">General</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_updateCheck</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="name">sbSizer1</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="parent">1</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">1</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Check for package updates on startup</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_updateCheck</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticBoxSizer" expanded="1">
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Library package handling</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">sbSizer2</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="parent">1</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">1</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Automatically add installed libraries to global lib table</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_libAutoAdd</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">1</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Automatically remove uninstalled libraries</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_libAutoRemove</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizer2</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Library nickname prefix:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticText1</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_libPrefix</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">After packages are (un)installed KiCad may need to be restarted to reflect changes in the global library table.</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_libHelp</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/panel.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
@ -31,6 +34,11 @@ class PANEL_PCM_SETTINGS_BASE : public wxPanel
|
|||
|
||||
protected:
|
||||
wxCheckBox* m_updateCheck;
|
||||
wxCheckBox* m_libAutoAdd;
|
||||
wxCheckBox* m_libAutoRemove;
|
||||
wxStaticText* m_staticText1;
|
||||
wxTextCtrl* m_libPrefix;
|
||||
wxStaticText* m_libHelp;
|
||||
|
||||
public:
|
||||
|
||||
|
|
Loading…
Reference in New Issue