Loading common/edaappl.cpp +95 −73 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <wx/stdpaths.h> #include <wx/apptrait.h> #include <wx/snglinst.h> #include <wx/tokenzr.h> #include "appl_wxstruct.h" #include "common.h" Loading Loading @@ -267,6 +268,7 @@ WinEDA_App::~WinEDA_App() void WinEDA_App::InitEDA_Appl( const wxString& aName, id_app_type aId ) { wxString EnvLang; m_Id = aId; m_Checker = new wxSingleInstanceChecker( aName.Lower() + wxT( "-" ) + wxGetUserId() ); Loading Loading @@ -474,6 +476,7 @@ void WinEDA_App::SetDefaultSearchPaths( void ) m_searchPaths.Clear(); #ifdef __WINDOWS__ /* m_BinDir path is in unix notation. * But wxFileName expect (to work fine) native notation * specifically when using a path including a server, like Loading Loading @@ -553,6 +556,7 @@ void WinEDA_App::SetDefaultSearchPaths( void ) { fn.Clear(); fn.SetPath( m_searchPaths[i] ); /* Add schematic library file path to search path list. * we must add <kicad path>/library and <kicad path>/library/doc */ Loading Loading @@ -963,6 +967,7 @@ wxString WinEDA_App::GetHelpFile( void ) { subdirs.RemoveAt( subdirs.GetCount() - 1 ); altsubdirs.RemoveAt( altsubdirs.GetCount() - 1 ); // wxLocale::GetName() does not return always the short name subdirs.Add( m_Locale->GetName().BeforeLast( '_' ) ); altsubdirs.Add( m_Locale->GetName().BeforeLast( '_' ) ); Loading Loading @@ -1001,6 +1006,7 @@ wxString WinEDA_App::GetLibraryFile( const wxString& filename ) return FindFileInSearchPaths( filename, &subdirs ); } /** ReturnLastVisitedLibraryPath * Returns the last visited library directory, or (if void) the first * path in lib path list ( but not the CWD ) Loading Loading @@ -1046,11 +1052,13 @@ wxString WinEDA_App::ReturnLastVisitedLibraryPath( const wxString & aSubPathToSe return path; } void WinEDA_App::SaveLastVisitedLibraryPath( const wxString& aPath ) { m_LastVisitedLibPath = aPath; } /** ReturnFilenameWithRelativePathInLibPath * @return a short filename (with extension) with only a relative path if this filename * can be found in library paths Loading @@ -1068,6 +1076,7 @@ wxString WinEDA_App::ReturnFilenameWithRelativePathInLibPath(const wxString & aF wxFileName fn = aFullFilename; wxString filename = aFullFilename; int pathlen = -1; // path len, used to find the better subpath within defualts paths if( m_libSearchPaths.Index( fn.GetPath() ) != wxNOT_FOUND ) // Ok, trivial case filename = fn.GetName(); else // not in the default, : see if this file is in a subpath: Loading Loading @@ -1108,37 +1117,50 @@ wxString WinEDA_App::FindLibraryPath( const wxString& aFileName ) return m_libSearchPaths.FindValidPath( aFileName ); } /** Function RemoveLibraryPath * Removes the given path from the library path list * @param path = the path to remove * Removes the given path(s) from the library path list * @param aPaths = path or path list to remove. paths must be separated by ";" */ void WinEDA_App::RemoveLibraryPath( const wxString& path ) void WinEDA_App::RemoveLibraryPath( const wxString& aPaths ) { wxStringTokenizer Token( aPaths, wxT( ";\n\r" ) ); while( Token.HasMoreTokens() ) { wxString path = Token.GetNextToken(); if( m_libSearchPaths.Index( path, wxFileName::IsCaseSensitive() ) != wxNOT_FOUND ) { wxLogDebug( wxT( "Removing path <%s> from library path search list." ), path.c_str() ); m_libSearchPaths.Remove( path ); } } } void WinEDA_App::InsertLibraryPath( const wxString& path, size_t index ) /** Function InsertLibraryPath * insert path(s) int lib paths list. * @param aPaths = path or path list to add. paths must be separated by ";" * @param aIndex = insertion point */ void WinEDA_App::InsertLibraryPath( const wxString& aPaths, size_t aIndex ) { wxStringTokenizer Token( aPaths, wxT( ";\n\r" ) ); while( Token.HasMoreTokens() ) { wxString path = Token.GetNextToken(); if( wxFileName::DirExists( path ) && m_libSearchPaths.Index( path, wxFileName::IsCaseSensitive() ) == wxNOT_FOUND ) { if( index >= m_libSearchPaths.GetCount() ) if( aIndex >= m_libSearchPaths.GetCount() ) { wxLogDebug( wxT( "Adding path <%s> to library path search list." ), path.c_str() ); m_libSearchPaths.Add( path ); } else { wxLogDebug( wxT( "Inserting path <%s> in library path search " \ "list at index position %d." ), path.c_str(), index ); m_libSearchPaths.Insert( path, index ); m_libSearchPaths.Insert( path, aIndex ); } aIndex++; } } } Loading eeschema/dialog_eeschema_config.cpp +93 −20 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ ///////////////////////////////////////////////////////////////////////////// #include "fctsys.h" #include <wx/tokenzr.h> #include "appl_wxstruct.h" #include "common.h" #include "confirm.h" Loading @@ -30,6 +31,8 @@ class DIALOG_EESCHEMA_CONFIG : public DIALOG_EESCHEMA_CONFIG_FBP private: WinEDA_SchematicFrame* m_Parent; bool m_LibListChanged; bool m_LibPathChanged; wxString m_UserLibDirBufferImg; // Copy of original g_UserLibDirBuffer private: Loading @@ -39,7 +42,7 @@ private: void OnSaveCfgClick( wxCommandEvent& event ); void OnRemoveLibClick( wxCommandEvent& event ); void OnAddOrInsertLibClick( wxCommandEvent& event ); void OnLibPathSelClick( wxCommandEvent& event ); void OnAddOrInsertPath( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event ); void OnRemoveUserPath( wxCommandEvent& event ); Loading Loading @@ -69,7 +72,6 @@ DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent ) wxString msg; m_Parent = parent; m_LibListChanged = false; Init(); Loading @@ -88,6 +90,10 @@ void DIALOG_EESCHEMA_CONFIG::Init() SetFont( *g_DialogFont ); SetFocus(); m_LibListChanged = false; m_LibPathChanged = false; m_UserLibDirBufferImg = g_UserLibDirBuffer; // Save the original lib path // Display current files extension (info) wxString msg = m_InfoCmpFileExt->GetLabel() + g_NetCmpExtBuffer; m_InfoCmpFileExt->SetLabel( msg ); Loading Loading @@ -126,7 +132,15 @@ void DIALOG_EESCHEMA_CONFIG::Init() m_NetFormatBox->SetSelection( g_NetFormat - NET_TYPE_PCBNEW ); m_ListLibr->InsertItems( g_LibName_List, 0 ); m_LibDirCtrl->SetValue( g_UserLibDirBuffer ); // Load user libs paths: wxStringTokenizer Token( m_UserLibDirBufferImg, wxT( ";\n\r" ) ); while( Token.HasMoreTokens() ) { wxString path = Token.GetNextToken(); if( wxFileName::DirExists( path ) ) m_listUserPaths->Append(path); } // Display actual libraries paths: wxPathList libpaths = wxGetApp().GetLibraryPathList(); Loading @@ -134,6 +148,10 @@ void DIALOG_EESCHEMA_CONFIG::Init() { m_DefaultLibraryPathslistBox->Append( libpaths[ii]); } // select the first path afer the current path project if ( libpaths.GetCount() > 1 ) m_DefaultLibraryPathslistBox->Select( 1 ); } Loading @@ -141,6 +159,13 @@ void DIALOG_EESCHEMA_CONFIG::Init() void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event ) /******************************************************************/ { // Recreate the user lib path if ( m_LibPathChanged ) { for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ ) wxGetApp().RemoveLibraryPath( m_listUserPaths->GetString(ii)) ; wxGetApp().InsertLibraryPath( g_UserLibDirBuffer, 1); } EndModal( -1 ); } Loading @@ -152,17 +177,21 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event ) // Set new netlist format g_NetFormat = m_NetFormatBox->GetSelection() + NET_TYPE_PCBNEW; // Set new default path lib if ( g_UserLibDirBuffer != m_LibDirCtrl->GetValue() ) // Recreate the user lib path if ( m_LibPathChanged ) { wxGetApp().RemoveLibraryPath( g_UserLibDirBuffer ); g_UserLibDirBuffer = m_LibDirCtrl->GetValue(); wxGetApp().InsertLibraryPath( g_UserLibDirBuffer, 1 ); m_LibListChanged = true; g_UserLibDirBuffer.Empty(); for ( unsigned ii = 0; ii < m_listUserPaths->GetCount(); ii ++ ) { if ( ii > 0 ) g_UserLibDirBuffer << wxT(";"); g_UserLibDirBuffer << m_listUserPaths->GetString(ii); } } // Set new active library list if the list of default path was modified if( m_LibListChanged ) // Set new active library list if the lib list of if default path list was modified if( m_LibListChanged || m_LibPathChanged ) { // Recreate lib list g_LibName_List.Clear(); Loading Loading @@ -223,7 +252,8 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) if( ii == wxNOT_FOUND && event.GetId() != ID_ADD_LIB ) ii = 0; wxString libpath = m_LibDirCtrl->GetValue(); wxString libpath; libpath = m_DefaultLibraryPathslistBox->GetStringSelection(); if ( libpath.IsEmpty() ) libpath = wxGetApp().ReturnLastVisitedLibraryPath(); Loading Loading @@ -295,14 +325,12 @@ void DIALOG_EESCHEMA_CONFIG::OnSaveCfgClick( wxCommandEvent& event ) /***********************************************************************/ void DIALOG_EESCHEMA_CONFIG::OnLibPathSelClick( wxCommandEvent& event ) void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath( wxCommandEvent& event ) /***********************************************************************/ { wxString path = m_LibDirCtrl->GetValue(); if ( path.IsEmpty() ) path = wxGetApp().ReturnLastVisitedLibraryPath(); wxString path = wxGetApp().ReturnLastVisitedLibraryPath(); bool select = EDA_DirectorySelector( _( " Default Path for libraries" ), /* Titre de la fenetre */ bool select = EDA_DirectorySelector( _( "Default Path for Libraries" ), /* Titre de la fenetre */ path, /* Chemin par defaut */ wxDD_DEFAULT_STYLE, this, /* parent frame */ Loading @@ -311,7 +339,36 @@ void DIALOG_EESCHEMA_CONFIG::OnLibPathSelClick( wxCommandEvent& event ) if( !select ) return; m_LibDirCtrl->SetValue( path ); if( ! wxFileName::DirExists( path ) ) // Should not occurs return; // Add or insert path if not already in list if( m_listUserPaths->FindString( path ) == wxNOT_FOUND ) { int ipos = m_listUserPaths->GetCount(); if ( event.GetId() == wxID_INSERT_PATH ) { if ( ipos ) ipos--; int jj = m_listUserPaths->GetSelection(); if ( jj >= 0 ) ipos = jj; } m_listUserPaths->Insert(path, ipos); m_LibPathChanged = true; wxGetApp().InsertLibraryPath( path, ipos+1 ); // Display actual libraries paths: wxPathList libpaths = wxGetApp().GetLibraryPathList(); m_DefaultLibraryPathslistBox->Clear(); for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ ) { m_DefaultLibraryPathslistBox->Append( libpaths[ii]); } } else DisplayError(this, _("Path already in use") ); wxGetApp().SaveLastVisitedLibraryPath( path ); } Loading @@ -321,5 +378,21 @@ void DIALOG_EESCHEMA_CONFIG::OnLibPathSelClick( wxCommandEvent& event ) void DIALOG_EESCHEMA_CONFIG::OnRemoveUserPath( wxCommandEvent& event ) /***********************************************************************/ { m_LibDirCtrl->Clear( ); int ii = m_listUserPaths->GetSelection(); if ( ii < 0 ) ii = m_listUserPaths->GetCount()-1; if ( ii >= 0 ) { wxGetApp().RemoveLibraryPath( m_listUserPaths->GetStringSelection() ); m_listUserPaths->Delete( ii ); m_LibPathChanged = true; } // Display actual libraries paths: wxPathList libpaths = wxGetApp().GetLibraryPathList(); m_DefaultLibraryPathslistBox->Clear(); for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ ) { m_DefaultLibraryPathslistBox->Append( libpaths[ii]); } } eeschema/dialog_eeschema_config_fbp.cpp +25 −27 Original line number Diff line number Diff line Loading @@ -83,38 +83,33 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind bRightSizer = new wxBoxSizer( wxVERTICAL ); m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonRemoveLib->SetForegroundColour( wxColour( 186, 1, 38 ) ); m_buttonRemoveLib->SetToolTip( _("Unload the selected library") ); bRightSizer->Add( m_buttonRemoveLib, 0, wxALL, 5 ); bRightSizer->Add( m_buttonRemoveLib, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonAdd = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonAdd->SetForegroundColour( wxColour( 13, 118, 1 ) ); m_buttonAdd->SetToolTip( _("Add a new library after the selected library, and load it") ); m_buttonAddLib = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonAddLib->SetToolTip( _("Add a new library after the selected library, and load it") ); bRightSizer->Add( m_buttonAdd, 0, wxRIGHT|wxLEFT, 5 ); bRightSizer->Add( m_buttonAddLib, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonIns = new wxButton( this, wxID_ANY, _("Ins"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonIns->SetForegroundColour( wxColour( 0, 65, 130 ) ); m_buttonIns = new wxButton( this, wxID_ANY, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonIns->SetToolTip( _("Add a new library before the selected library, and load it") ); bRightSizer->Add( m_buttonIns, 0, wxALL, 5 ); bRightSizer->Add( m_buttonIns, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); bRightSizer->Add( 0, 20, 1, wxEXPAND, 5 ); m_buttonOk = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 ); bRightSizer->Add( m_buttonOk, 0, wxALL, 5 ); bRightSizer->Add( m_buttonOk, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonCancel->SetForegroundColour( wxColour( 14, 0, 179 ) ); bRightSizer->Add( m_buttonCancel, 0, wxRIGHT|wxLEFT, 5 ); bRightSizer->Add( m_buttonCancel, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonSave = new wxButton( this, ID_SAVE_CFG, _("Save Cfg"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonSave->SetToolTip( _("Accept and save current configuration setting in the local .pro file") ); bRightSizer->Add( m_buttonSave, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); bRightSizer->Add( m_buttonSave, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); bUpperSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); Loading @@ -135,21 +130,22 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind wxBoxSizer* bUserListSizer; bUserListSizer = new wxBoxSizer( wxVERTICAL ); m_LibDirCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_LibDirCtrl->SetToolTip( _("Default path to search libraries which have no absolute path in name,\nor a name which does not start by ./ or ../\nIf void, the default path is kicad/share/library") ); bUserListSizer->Add( m_LibDirCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); bUserListSizer->Add( m_listUserPaths, 1, wxALL|wxEXPAND, 5 ); sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL, 5 ); sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); wxBoxSizer* bUserPathsButtonsSizer; bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL ); m_buttonBrowse = new wxButton( this, ID_LIB_PATH_SEL, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); bUserPathsButtonsSizer->Add( m_buttonBrowse, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_buttonRemovePath = new wxButton( this, wxID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxRIGHT|wxLEFT, 5 ); m_buttonAddPath = new wxButton( this, ID_LIB_PATH_SEL, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); bUserPathsButtonsSizer->Add( m_buttonAddPath, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_buttonRemovePath = new wxButton( this, wxID_ANY, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_buttonInsPath = new wxButton( this, wxID_INSERT_PATH, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); sbSizer4->Add( bUserPathsButtonsSizer, 0, wxEXPAND, 5 ); Loading @@ -175,13 +171,14 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) ); m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); m_buttonAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonAddLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonIns->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonOk->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this ); m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this ); m_buttonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnSaveCfgClick ), NULL, this ); m_buttonBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnLibPathSelClick ), NULL, this ); m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); m_buttonAddPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonInsPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); } DIALOG_EESCHEMA_CONFIG_FBP::~DIALOG_EESCHEMA_CONFIG_FBP() Loading @@ -189,11 +186,12 @@ DIALOG_EESCHEMA_CONFIG_FBP::~DIALOG_EESCHEMA_CONFIG_FBP() // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) ); m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); m_buttonAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonAddLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonIns->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonOk->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this ); m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this ); m_buttonSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnSaveCfgClick ), NULL, this ); m_buttonBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnLibPathSelClick ), NULL, this ); m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); m_buttonAddPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonInsPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); } Loading
common/edaappl.cpp +95 −73 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <wx/stdpaths.h> #include <wx/apptrait.h> #include <wx/snglinst.h> #include <wx/tokenzr.h> #include "appl_wxstruct.h" #include "common.h" Loading Loading @@ -267,6 +268,7 @@ WinEDA_App::~WinEDA_App() void WinEDA_App::InitEDA_Appl( const wxString& aName, id_app_type aId ) { wxString EnvLang; m_Id = aId; m_Checker = new wxSingleInstanceChecker( aName.Lower() + wxT( "-" ) + wxGetUserId() ); Loading Loading @@ -474,6 +476,7 @@ void WinEDA_App::SetDefaultSearchPaths( void ) m_searchPaths.Clear(); #ifdef __WINDOWS__ /* m_BinDir path is in unix notation. * But wxFileName expect (to work fine) native notation * specifically when using a path including a server, like Loading Loading @@ -553,6 +556,7 @@ void WinEDA_App::SetDefaultSearchPaths( void ) { fn.Clear(); fn.SetPath( m_searchPaths[i] ); /* Add schematic library file path to search path list. * we must add <kicad path>/library and <kicad path>/library/doc */ Loading Loading @@ -963,6 +967,7 @@ wxString WinEDA_App::GetHelpFile( void ) { subdirs.RemoveAt( subdirs.GetCount() - 1 ); altsubdirs.RemoveAt( altsubdirs.GetCount() - 1 ); // wxLocale::GetName() does not return always the short name subdirs.Add( m_Locale->GetName().BeforeLast( '_' ) ); altsubdirs.Add( m_Locale->GetName().BeforeLast( '_' ) ); Loading Loading @@ -1001,6 +1006,7 @@ wxString WinEDA_App::GetLibraryFile( const wxString& filename ) return FindFileInSearchPaths( filename, &subdirs ); } /** ReturnLastVisitedLibraryPath * Returns the last visited library directory, or (if void) the first * path in lib path list ( but not the CWD ) Loading Loading @@ -1046,11 +1052,13 @@ wxString WinEDA_App::ReturnLastVisitedLibraryPath( const wxString & aSubPathToSe return path; } void WinEDA_App::SaveLastVisitedLibraryPath( const wxString& aPath ) { m_LastVisitedLibPath = aPath; } /** ReturnFilenameWithRelativePathInLibPath * @return a short filename (with extension) with only a relative path if this filename * can be found in library paths Loading @@ -1068,6 +1076,7 @@ wxString WinEDA_App::ReturnFilenameWithRelativePathInLibPath(const wxString & aF wxFileName fn = aFullFilename; wxString filename = aFullFilename; int pathlen = -1; // path len, used to find the better subpath within defualts paths if( m_libSearchPaths.Index( fn.GetPath() ) != wxNOT_FOUND ) // Ok, trivial case filename = fn.GetName(); else // not in the default, : see if this file is in a subpath: Loading Loading @@ -1108,37 +1117,50 @@ wxString WinEDA_App::FindLibraryPath( const wxString& aFileName ) return m_libSearchPaths.FindValidPath( aFileName ); } /** Function RemoveLibraryPath * Removes the given path from the library path list * @param path = the path to remove * Removes the given path(s) from the library path list * @param aPaths = path or path list to remove. paths must be separated by ";" */ void WinEDA_App::RemoveLibraryPath( const wxString& path ) void WinEDA_App::RemoveLibraryPath( const wxString& aPaths ) { wxStringTokenizer Token( aPaths, wxT( ";\n\r" ) ); while( Token.HasMoreTokens() ) { wxString path = Token.GetNextToken(); if( m_libSearchPaths.Index( path, wxFileName::IsCaseSensitive() ) != wxNOT_FOUND ) { wxLogDebug( wxT( "Removing path <%s> from library path search list." ), path.c_str() ); m_libSearchPaths.Remove( path ); } } } void WinEDA_App::InsertLibraryPath( const wxString& path, size_t index ) /** Function InsertLibraryPath * insert path(s) int lib paths list. * @param aPaths = path or path list to add. paths must be separated by ";" * @param aIndex = insertion point */ void WinEDA_App::InsertLibraryPath( const wxString& aPaths, size_t aIndex ) { wxStringTokenizer Token( aPaths, wxT( ";\n\r" ) ); while( Token.HasMoreTokens() ) { wxString path = Token.GetNextToken(); if( wxFileName::DirExists( path ) && m_libSearchPaths.Index( path, wxFileName::IsCaseSensitive() ) == wxNOT_FOUND ) { if( index >= m_libSearchPaths.GetCount() ) if( aIndex >= m_libSearchPaths.GetCount() ) { wxLogDebug( wxT( "Adding path <%s> to library path search list." ), path.c_str() ); m_libSearchPaths.Add( path ); } else { wxLogDebug( wxT( "Inserting path <%s> in library path search " \ "list at index position %d." ), path.c_str(), index ); m_libSearchPaths.Insert( path, index ); m_libSearchPaths.Insert( path, aIndex ); } aIndex++; } } } Loading
eeschema/dialog_eeschema_config.cpp +93 −20 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ ///////////////////////////////////////////////////////////////////////////// #include "fctsys.h" #include <wx/tokenzr.h> #include "appl_wxstruct.h" #include "common.h" #include "confirm.h" Loading @@ -30,6 +31,8 @@ class DIALOG_EESCHEMA_CONFIG : public DIALOG_EESCHEMA_CONFIG_FBP private: WinEDA_SchematicFrame* m_Parent; bool m_LibListChanged; bool m_LibPathChanged; wxString m_UserLibDirBufferImg; // Copy of original g_UserLibDirBuffer private: Loading @@ -39,7 +42,7 @@ private: void OnSaveCfgClick( wxCommandEvent& event ); void OnRemoveLibClick( wxCommandEvent& event ); void OnAddOrInsertLibClick( wxCommandEvent& event ); void OnLibPathSelClick( wxCommandEvent& event ); void OnAddOrInsertPath( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event ); void OnRemoveUserPath( wxCommandEvent& event ); Loading Loading @@ -69,7 +72,6 @@ DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent ) wxString msg; m_Parent = parent; m_LibListChanged = false; Init(); Loading @@ -88,6 +90,10 @@ void DIALOG_EESCHEMA_CONFIG::Init() SetFont( *g_DialogFont ); SetFocus(); m_LibListChanged = false; m_LibPathChanged = false; m_UserLibDirBufferImg = g_UserLibDirBuffer; // Save the original lib path // Display current files extension (info) wxString msg = m_InfoCmpFileExt->GetLabel() + g_NetCmpExtBuffer; m_InfoCmpFileExt->SetLabel( msg ); Loading Loading @@ -126,7 +132,15 @@ void DIALOG_EESCHEMA_CONFIG::Init() m_NetFormatBox->SetSelection( g_NetFormat - NET_TYPE_PCBNEW ); m_ListLibr->InsertItems( g_LibName_List, 0 ); m_LibDirCtrl->SetValue( g_UserLibDirBuffer ); // Load user libs paths: wxStringTokenizer Token( m_UserLibDirBufferImg, wxT( ";\n\r" ) ); while( Token.HasMoreTokens() ) { wxString path = Token.GetNextToken(); if( wxFileName::DirExists( path ) ) m_listUserPaths->Append(path); } // Display actual libraries paths: wxPathList libpaths = wxGetApp().GetLibraryPathList(); Loading @@ -134,6 +148,10 @@ void DIALOG_EESCHEMA_CONFIG::Init() { m_DefaultLibraryPathslistBox->Append( libpaths[ii]); } // select the first path afer the current path project if ( libpaths.GetCount() > 1 ) m_DefaultLibraryPathslistBox->Select( 1 ); } Loading @@ -141,6 +159,13 @@ void DIALOG_EESCHEMA_CONFIG::Init() void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event ) /******************************************************************/ { // Recreate the user lib path if ( m_LibPathChanged ) { for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ ) wxGetApp().RemoveLibraryPath( m_listUserPaths->GetString(ii)) ; wxGetApp().InsertLibraryPath( g_UserLibDirBuffer, 1); } EndModal( -1 ); } Loading @@ -152,17 +177,21 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event ) // Set new netlist format g_NetFormat = m_NetFormatBox->GetSelection() + NET_TYPE_PCBNEW; // Set new default path lib if ( g_UserLibDirBuffer != m_LibDirCtrl->GetValue() ) // Recreate the user lib path if ( m_LibPathChanged ) { wxGetApp().RemoveLibraryPath( g_UserLibDirBuffer ); g_UserLibDirBuffer = m_LibDirCtrl->GetValue(); wxGetApp().InsertLibraryPath( g_UserLibDirBuffer, 1 ); m_LibListChanged = true; g_UserLibDirBuffer.Empty(); for ( unsigned ii = 0; ii < m_listUserPaths->GetCount(); ii ++ ) { if ( ii > 0 ) g_UserLibDirBuffer << wxT(";"); g_UserLibDirBuffer << m_listUserPaths->GetString(ii); } } // Set new active library list if the list of default path was modified if( m_LibListChanged ) // Set new active library list if the lib list of if default path list was modified if( m_LibListChanged || m_LibPathChanged ) { // Recreate lib list g_LibName_List.Clear(); Loading Loading @@ -223,7 +252,8 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) if( ii == wxNOT_FOUND && event.GetId() != ID_ADD_LIB ) ii = 0; wxString libpath = m_LibDirCtrl->GetValue(); wxString libpath; libpath = m_DefaultLibraryPathslistBox->GetStringSelection(); if ( libpath.IsEmpty() ) libpath = wxGetApp().ReturnLastVisitedLibraryPath(); Loading Loading @@ -295,14 +325,12 @@ void DIALOG_EESCHEMA_CONFIG::OnSaveCfgClick( wxCommandEvent& event ) /***********************************************************************/ void DIALOG_EESCHEMA_CONFIG::OnLibPathSelClick( wxCommandEvent& event ) void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath( wxCommandEvent& event ) /***********************************************************************/ { wxString path = m_LibDirCtrl->GetValue(); if ( path.IsEmpty() ) path = wxGetApp().ReturnLastVisitedLibraryPath(); wxString path = wxGetApp().ReturnLastVisitedLibraryPath(); bool select = EDA_DirectorySelector( _( " Default Path for libraries" ), /* Titre de la fenetre */ bool select = EDA_DirectorySelector( _( "Default Path for Libraries" ), /* Titre de la fenetre */ path, /* Chemin par defaut */ wxDD_DEFAULT_STYLE, this, /* parent frame */ Loading @@ -311,7 +339,36 @@ void DIALOG_EESCHEMA_CONFIG::OnLibPathSelClick( wxCommandEvent& event ) if( !select ) return; m_LibDirCtrl->SetValue( path ); if( ! wxFileName::DirExists( path ) ) // Should not occurs return; // Add or insert path if not already in list if( m_listUserPaths->FindString( path ) == wxNOT_FOUND ) { int ipos = m_listUserPaths->GetCount(); if ( event.GetId() == wxID_INSERT_PATH ) { if ( ipos ) ipos--; int jj = m_listUserPaths->GetSelection(); if ( jj >= 0 ) ipos = jj; } m_listUserPaths->Insert(path, ipos); m_LibPathChanged = true; wxGetApp().InsertLibraryPath( path, ipos+1 ); // Display actual libraries paths: wxPathList libpaths = wxGetApp().GetLibraryPathList(); m_DefaultLibraryPathslistBox->Clear(); for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ ) { m_DefaultLibraryPathslistBox->Append( libpaths[ii]); } } else DisplayError(this, _("Path already in use") ); wxGetApp().SaveLastVisitedLibraryPath( path ); } Loading @@ -321,5 +378,21 @@ void DIALOG_EESCHEMA_CONFIG::OnLibPathSelClick( wxCommandEvent& event ) void DIALOG_EESCHEMA_CONFIG::OnRemoveUserPath( wxCommandEvent& event ) /***********************************************************************/ { m_LibDirCtrl->Clear( ); int ii = m_listUserPaths->GetSelection(); if ( ii < 0 ) ii = m_listUserPaths->GetCount()-1; if ( ii >= 0 ) { wxGetApp().RemoveLibraryPath( m_listUserPaths->GetStringSelection() ); m_listUserPaths->Delete( ii ); m_LibPathChanged = true; } // Display actual libraries paths: wxPathList libpaths = wxGetApp().GetLibraryPathList(); m_DefaultLibraryPathslistBox->Clear(); for( unsigned ii = 0; ii < libpaths.GetCount(); ii++ ) { m_DefaultLibraryPathslistBox->Append( libpaths[ii]); } }
eeschema/dialog_eeschema_config_fbp.cpp +25 −27 Original line number Diff line number Diff line Loading @@ -83,38 +83,33 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind bRightSizer = new wxBoxSizer( wxVERTICAL ); m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonRemoveLib->SetForegroundColour( wxColour( 186, 1, 38 ) ); m_buttonRemoveLib->SetToolTip( _("Unload the selected library") ); bRightSizer->Add( m_buttonRemoveLib, 0, wxALL, 5 ); bRightSizer->Add( m_buttonRemoveLib, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonAdd = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonAdd->SetForegroundColour( wxColour( 13, 118, 1 ) ); m_buttonAdd->SetToolTip( _("Add a new library after the selected library, and load it") ); m_buttonAddLib = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonAddLib->SetToolTip( _("Add a new library after the selected library, and load it") ); bRightSizer->Add( m_buttonAdd, 0, wxRIGHT|wxLEFT, 5 ); bRightSizer->Add( m_buttonAddLib, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonIns = new wxButton( this, wxID_ANY, _("Ins"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonIns->SetForegroundColour( wxColour( 0, 65, 130 ) ); m_buttonIns = new wxButton( this, wxID_ANY, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonIns->SetToolTip( _("Add a new library before the selected library, and load it") ); bRightSizer->Add( m_buttonIns, 0, wxALL, 5 ); bRightSizer->Add( m_buttonIns, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); bRightSizer->Add( 0, 20, 1, wxEXPAND, 5 ); m_buttonOk = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 ); bRightSizer->Add( m_buttonOk, 0, wxALL, 5 ); bRightSizer->Add( m_buttonOk, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonCancel->SetForegroundColour( wxColour( 14, 0, 179 ) ); bRightSizer->Add( m_buttonCancel, 0, wxRIGHT|wxLEFT, 5 ); bRightSizer->Add( m_buttonCancel, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); m_buttonSave = new wxButton( this, ID_SAVE_CFG, _("Save Cfg"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonSave->SetToolTip( _("Accept and save current configuration setting in the local .pro file") ); bRightSizer->Add( m_buttonSave, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); bRightSizer->Add( m_buttonSave, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); bUpperSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); Loading @@ -135,21 +130,22 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind wxBoxSizer* bUserListSizer; bUserListSizer = new wxBoxSizer( wxVERTICAL ); m_LibDirCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_LibDirCtrl->SetToolTip( _("Default path to search libraries which have no absolute path in name,\nor a name which does not start by ./ or ../\nIf void, the default path is kicad/share/library") ); bUserListSizer->Add( m_LibDirCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); bUserListSizer->Add( m_listUserPaths, 1, wxALL|wxEXPAND, 5 ); sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL, 5 ); sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); wxBoxSizer* bUserPathsButtonsSizer; bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL ); m_buttonBrowse = new wxButton( this, ID_LIB_PATH_SEL, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); bUserPathsButtonsSizer->Add( m_buttonBrowse, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_buttonRemovePath = new wxButton( this, wxID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxRIGHT|wxLEFT, 5 ); m_buttonAddPath = new wxButton( this, ID_LIB_PATH_SEL, _("Add"), wxDefaultPosition, wxDefaultSize, 0 ); bUserPathsButtonsSizer->Add( m_buttonAddPath, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_buttonRemovePath = new wxButton( this, wxID_ANY, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_buttonInsPath = new wxButton( this, wxID_INSERT_PATH, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); sbSizer4->Add( bUserPathsButtonsSizer, 0, wxEXPAND, 5 ); Loading @@ -175,13 +171,14 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) ); m_buttonRemoveLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); m_buttonAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonAddLib->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonIns->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonOk->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this ); m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this ); m_buttonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnSaveCfgClick ), NULL, this ); m_buttonBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnLibPathSelClick ), NULL, this ); m_buttonRemovePath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); m_buttonAddPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonInsPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); } DIALOG_EESCHEMA_CONFIG_FBP::~DIALOG_EESCHEMA_CONFIG_FBP() Loading @@ -189,11 +186,12 @@ DIALOG_EESCHEMA_CONFIG_FBP::~DIALOG_EESCHEMA_CONFIG_FBP() // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) ); m_buttonRemoveLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this ); m_buttonAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonAddLib->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonIns->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this ); m_buttonOk->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this ); m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this ); m_buttonSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnSaveCfgClick ), NULL, this ); m_buttonBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnLibPathSelClick ), NULL, this ); m_buttonRemovePath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveUserPath ), NULL, this ); m_buttonAddPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); m_buttonInsPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertPath ), NULL, this ); }