Loading include/wxPcbStruct.h +0 −3 Original line number Original line Diff line number Diff line Loading @@ -59,7 +59,6 @@ class PCB_EDIT_FRAME : public PCB_BASE_FRAME int m_saveInterval; ///< Time interval in seconds for automatic saving. int m_saveInterval; ///< Time interval in seconds for automatic saving. int m_lastSaveTime; ///< Last save time. int m_lastSaveTime; ///< Last save time. wxArrayString m_libraryNames; ///< List of footprint library names to load. protected: protected: Loading Loading @@ -235,8 +234,6 @@ public: void SetAutoSaveTimeInterval( int aInterval ) { m_saveInterval = aInterval; } void SetAutoSaveTimeInterval( int aInterval ) { m_saveInterval = aInterval; } wxArrayString& GetFootprintLibraryNames() { return m_libraryNames; } // Configurations: // Configurations: void InstallConfigFrame(); void InstallConfigFrame(); void Process_Config( wxCommandEvent& event ); void Process_Config( wxCommandEvent& event ); Loading pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -55,7 +55,7 @@ void DIALOG_PCBNEW_CONFIG_LIBS::Init() m_LibPathChanged = false; m_LibPathChanged = false; m_UserLibDirBufferImg = g_UserLibDirBuffer; // Save the original lib path m_UserLibDirBufferImg = g_UserLibDirBuffer; // Save the original lib path m_ListLibr->InsertItems( GetParent()->GetFootprintLibraryNames(), 0 ); m_ListLibr->InsertItems( g_LibraryNames, 0 ); // Display current modules doc file: // Display current modules doc file: m_Config->Read( wxT( "module_doc_file" ), g_DocModulesFileName ); m_Config->Read( wxT( "module_doc_file" ), g_DocModulesFileName ); Loading Loading @@ -122,10 +122,10 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnOkClick( wxCommandEvent& event ) if( m_LibListChanged || m_LibPathChanged ) if( m_LibListChanged || m_LibPathChanged ) { { // Recreate lib list // Recreate lib list GetParent()->GetFootprintLibraryNames().Clear(); g_LibraryNames.Clear(); for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ ) for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ ) GetParent()->GetFootprintLibraryNames().Add( m_ListLibr->GetString(ii) ); g_LibraryNames.Add( m_ListLibr->GetString(ii) ); } } GetParent()->SaveProjectSettings(); GetParent()->SaveProjectSettings(); Loading pcbnew/librairi.cpp +2 −4 Original line number Original line Diff line number Diff line Loading @@ -705,13 +705,11 @@ MODULE* PCB_BASE_FRAME::Create_1_Module( const wxString& aModuleName ) void FOOTPRINT_EDIT_FRAME::Select_Active_Library() void FOOTPRINT_EDIT_FRAME::Select_Active_Library() { { wxString msg; wxString msg; PCB_EDIT_FRAME* parent = (PCB_EDIT_FRAME*) GetParent(); if( parent->GetFootprintLibraryNames().GetCount() == 0 || parent == NULL ) if( g_LibraryNames.GetCount() == 0 ) return; return; EDA_LIST_DIALOG dlg( this, _( "Select Active Library:" ), EDA_LIST_DIALOG dlg( this, _( "Select Active Library:" ), g_LibraryNames, m_CurrentLib ); parent->GetFootprintLibraryNames(), m_CurrentLib ); if( dlg.ShowModal() != wxID_OK ) if( dlg.ShowModal() != wxID_OK ) return; return; Loading pcbnew/loadcmp.cpp +5 −6 Original line number Original line Diff line number Diff line Loading @@ -195,13 +195,12 @@ MODULE* PCB_BASE_FRAME::GetModuleLibrary( const wxString& aLibraryFullFilename, bool one_lib = aLibraryFullFilename.IsEmpty() ? false : true; bool one_lib = aLibraryFullFilename.IsEmpty() ? false : true; PCB_EDIT_FRAME* parent = (PCB_EDIT_FRAME*) GetParent(); PCB_EDIT_FRAME* parent = (PCB_EDIT_FRAME*) GetParent(); for( ii = 0; ii < parent->GetFootprintLibraryNames().GetCount(); ii++ ) for( ii = 0; ii < g_LibraryNames.GetCount(); ii++ ) { { if( one_lib ) if( one_lib ) fn = aLibraryFullFilename; fn = aLibraryFullFilename; else else fn = wxFileName( wxEmptyString, parent->GetFootprintLibraryNames()[ii], fn = wxFileName( wxEmptyString, g_LibraryNames[ii], ModuleFileExtension ); ModuleFileExtension ); tmp = wxGetApp().FindLibraryPath( fn ); tmp = wxGetApp().FindLibraryPath( fn ); Loading Loading @@ -252,6 +251,7 @@ MODULE* PCB_BASE_FRAME::GetModuleLibrary( const wxString& aLibraryFullFilename, if( found ) if( found ) { { fileReader.Rewind(); fileReader.Rewind(); while( reader.ReadLine() ) while( reader.ReadLine() ) { { char * line = reader.Line(); char * line = reader.Line(); Loading Loading @@ -302,10 +302,9 @@ wxString PCB_BASE_FRAME::Select_1_Module_From_List( EDA_DRAW_FRAME* aWindow, wxString CmpName; wxString CmpName; wxString msg; wxString msg; wxArrayString libnames_list; wxArrayString libnames_list; PCB_EDIT_FRAME* parent = (PCB_EDIT_FRAME*) GetParent(); if( aLibraryFullFilename.IsEmpty() ) if( aLibraryFullFilename.IsEmpty() ) libnames_list = parent->GetFootprintLibraryNames(); libnames_list = g_LibraryNames; else else libnames_list.Add( aLibraryFullFilename ); libnames_list.Add( aLibraryFullFilename ); Loading pcbnew/pcbnew.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -61,6 +61,9 @@ const wxString g_FootprintLibFileWildcard( wxT( "Kicad footprint library file (* */ */ wxString g_DocModulesFileName = wxT( "footprints_doc/footprints.pdf" ); wxString g_DocModulesFileName = wxT( "footprints_doc/footprints.pdf" ); wxArrayString g_LibraryNames; IMPLEMENT_APP( EDA_APP ) IMPLEMENT_APP( EDA_APP ) Loading Loading
include/wxPcbStruct.h +0 −3 Original line number Original line Diff line number Diff line Loading @@ -59,7 +59,6 @@ class PCB_EDIT_FRAME : public PCB_BASE_FRAME int m_saveInterval; ///< Time interval in seconds for automatic saving. int m_saveInterval; ///< Time interval in seconds for automatic saving. int m_lastSaveTime; ///< Last save time. int m_lastSaveTime; ///< Last save time. wxArrayString m_libraryNames; ///< List of footprint library names to load. protected: protected: Loading Loading @@ -235,8 +234,6 @@ public: void SetAutoSaveTimeInterval( int aInterval ) { m_saveInterval = aInterval; } void SetAutoSaveTimeInterval( int aInterval ) { m_saveInterval = aInterval; } wxArrayString& GetFootprintLibraryNames() { return m_libraryNames; } // Configurations: // Configurations: void InstallConfigFrame(); void InstallConfigFrame(); void Process_Config( wxCommandEvent& event ); void Process_Config( wxCommandEvent& event ); Loading
pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -55,7 +55,7 @@ void DIALOG_PCBNEW_CONFIG_LIBS::Init() m_LibPathChanged = false; m_LibPathChanged = false; m_UserLibDirBufferImg = g_UserLibDirBuffer; // Save the original lib path m_UserLibDirBufferImg = g_UserLibDirBuffer; // Save the original lib path m_ListLibr->InsertItems( GetParent()->GetFootprintLibraryNames(), 0 ); m_ListLibr->InsertItems( g_LibraryNames, 0 ); // Display current modules doc file: // Display current modules doc file: m_Config->Read( wxT( "module_doc_file" ), g_DocModulesFileName ); m_Config->Read( wxT( "module_doc_file" ), g_DocModulesFileName ); Loading Loading @@ -122,10 +122,10 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnOkClick( wxCommandEvent& event ) if( m_LibListChanged || m_LibPathChanged ) if( m_LibListChanged || m_LibPathChanged ) { { // Recreate lib list // Recreate lib list GetParent()->GetFootprintLibraryNames().Clear(); g_LibraryNames.Clear(); for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ ) for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ ) GetParent()->GetFootprintLibraryNames().Add( m_ListLibr->GetString(ii) ); g_LibraryNames.Add( m_ListLibr->GetString(ii) ); } } GetParent()->SaveProjectSettings(); GetParent()->SaveProjectSettings(); Loading
pcbnew/librairi.cpp +2 −4 Original line number Original line Diff line number Diff line Loading @@ -705,13 +705,11 @@ MODULE* PCB_BASE_FRAME::Create_1_Module( const wxString& aModuleName ) void FOOTPRINT_EDIT_FRAME::Select_Active_Library() void FOOTPRINT_EDIT_FRAME::Select_Active_Library() { { wxString msg; wxString msg; PCB_EDIT_FRAME* parent = (PCB_EDIT_FRAME*) GetParent(); if( parent->GetFootprintLibraryNames().GetCount() == 0 || parent == NULL ) if( g_LibraryNames.GetCount() == 0 ) return; return; EDA_LIST_DIALOG dlg( this, _( "Select Active Library:" ), EDA_LIST_DIALOG dlg( this, _( "Select Active Library:" ), g_LibraryNames, m_CurrentLib ); parent->GetFootprintLibraryNames(), m_CurrentLib ); if( dlg.ShowModal() != wxID_OK ) if( dlg.ShowModal() != wxID_OK ) return; return; Loading
pcbnew/loadcmp.cpp +5 −6 Original line number Original line Diff line number Diff line Loading @@ -195,13 +195,12 @@ MODULE* PCB_BASE_FRAME::GetModuleLibrary( const wxString& aLibraryFullFilename, bool one_lib = aLibraryFullFilename.IsEmpty() ? false : true; bool one_lib = aLibraryFullFilename.IsEmpty() ? false : true; PCB_EDIT_FRAME* parent = (PCB_EDIT_FRAME*) GetParent(); PCB_EDIT_FRAME* parent = (PCB_EDIT_FRAME*) GetParent(); for( ii = 0; ii < parent->GetFootprintLibraryNames().GetCount(); ii++ ) for( ii = 0; ii < g_LibraryNames.GetCount(); ii++ ) { { if( one_lib ) if( one_lib ) fn = aLibraryFullFilename; fn = aLibraryFullFilename; else else fn = wxFileName( wxEmptyString, parent->GetFootprintLibraryNames()[ii], fn = wxFileName( wxEmptyString, g_LibraryNames[ii], ModuleFileExtension ); ModuleFileExtension ); tmp = wxGetApp().FindLibraryPath( fn ); tmp = wxGetApp().FindLibraryPath( fn ); Loading Loading @@ -252,6 +251,7 @@ MODULE* PCB_BASE_FRAME::GetModuleLibrary( const wxString& aLibraryFullFilename, if( found ) if( found ) { { fileReader.Rewind(); fileReader.Rewind(); while( reader.ReadLine() ) while( reader.ReadLine() ) { { char * line = reader.Line(); char * line = reader.Line(); Loading Loading @@ -302,10 +302,9 @@ wxString PCB_BASE_FRAME::Select_1_Module_From_List( EDA_DRAW_FRAME* aWindow, wxString CmpName; wxString CmpName; wxString msg; wxString msg; wxArrayString libnames_list; wxArrayString libnames_list; PCB_EDIT_FRAME* parent = (PCB_EDIT_FRAME*) GetParent(); if( aLibraryFullFilename.IsEmpty() ) if( aLibraryFullFilename.IsEmpty() ) libnames_list = parent->GetFootprintLibraryNames(); libnames_list = g_LibraryNames; else else libnames_list.Add( aLibraryFullFilename ); libnames_list.Add( aLibraryFullFilename ); Loading
pcbnew/pcbnew.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -61,6 +61,9 @@ const wxString g_FootprintLibFileWildcard( wxT( "Kicad footprint library file (* */ */ wxString g_DocModulesFileName = wxT( "footprints_doc/footprints.pdf" ); wxString g_DocModulesFileName = wxT( "footprints_doc/footprints.pdf" ); wxArrayString g_LibraryNames; IMPLEMENT_APP( EDA_APP ) IMPLEMENT_APP( EDA_APP ) Loading