Commit ff68ae0b authored by charras's avatar charras

Added: handling multiple user paths in library path list (currently, only in Eeschema)

parent bb5832c8
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <wx/stdpaths.h> #include <wx/stdpaths.h>
#include <wx/apptrait.h> #include <wx/apptrait.h>
#include <wx/snglinst.h> #include <wx/snglinst.h>
#include <wx/tokenzr.h>
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
...@@ -46,7 +47,7 @@ static const wxChar* CommonConfigPath = wxT( "kicad_common" ); ...@@ -46,7 +47,7 @@ static const wxChar* CommonConfigPath = wxT( "kicad_common" );
/* Just add new languages to the list. This macro will properly recalculate /* Just add new languages to the list. This macro will properly recalculate
* the size of the array. */ * the size of the array. */
#define LANGUAGE_DESCR_COUNT ( sizeof( s_Language_List ) / \ #define LANGUAGE_DESCR_COUNT ( sizeof( s_Language_List ) / \
sizeof( struct LANGUAGE_DESCR ) ) sizeof( struct LANGUAGE_DESCR ) )
/* Default font size */ /* Default font size */
#define FONT_DEFAULT_SIZE 10 /* Default font size. */ #define FONT_DEFAULT_SIZE 10 /* Default font size. */
...@@ -222,14 +223,14 @@ static struct LANGUAGE_DESCR s_Language_List[] = ...@@ -222,14 +223,14 @@ static struct LANGUAGE_DESCR s_Language_List[] =
*/ */
WinEDA_App::WinEDA_App() WinEDA_App::WinEDA_App()
{ {
m_Checker = NULL; m_Checker = NULL;
m_HtmlCtrl = NULL; m_HtmlCtrl = NULL;
m_EDA_Config = NULL; m_EDA_Config = NULL;
m_Env_Defined = FALSE; m_Env_Defined = FALSE;
m_LanguageId = wxLANGUAGE_DEFAULT; m_LanguageId = wxLANGUAGE_DEFAULT;
m_PdfBrowserIsDefault = TRUE; m_PdfBrowserIsDefault = TRUE;
m_Locale = NULL; m_Locale = NULL;
m_ProjectConfig = NULL; m_ProjectConfig = NULL;
m_EDA_CommonConfig = NULL; m_EDA_CommonConfig = NULL;
} }
...@@ -267,9 +268,10 @@ WinEDA_App::~WinEDA_App() ...@@ -267,9 +268,10 @@ WinEDA_App::~WinEDA_App()
void WinEDA_App::InitEDA_Appl( const wxString& aName, id_app_type aId ) void WinEDA_App::InitEDA_Appl( const wxString& aName, id_app_type aId )
{ {
wxString EnvLang; wxString EnvLang;
m_Id = aId; m_Id = aId;
m_Checker = new wxSingleInstanceChecker( aName.Lower() + wxT( "-" ) + m_Checker = new wxSingleInstanceChecker( aName.Lower() + wxT( "-" ) +
wxGetUserId() ); wxGetUserId() );
/* Init kicad environment /* Init kicad environment
* the environment variable KICAD (if exists) gives the kicad path: * the environment variable KICAD (if exists) gives the kicad path:
...@@ -297,7 +299,7 @@ void WinEDA_App::InitEDA_Appl( const wxString& aName, id_app_type aId ) ...@@ -297,7 +299,7 @@ void WinEDA_App::InitEDA_Appl( const wxString& aName, id_app_type aId )
SetVendorName( wxT( "kicad" ) ); SetVendorName( wxT( "kicad" ) );
SetAppName( aName.Lower() ); SetAppName( aName.Lower() );
SetTitle( aName ); SetTitle( aName );
m_EDA_Config = new wxConfig( ); m_EDA_Config = new wxConfig();
wxASSERT( m_EDA_Config != NULL ); wxASSERT( m_EDA_Config != NULL );
m_EDA_CommonConfig = new wxConfig( CommonConfigPath ); m_EDA_CommonConfig = new wxConfig( CommonConfigPath );
wxASSERT( m_EDA_CommonConfig != NULL ); wxASSERT( m_EDA_CommonConfig != NULL );
...@@ -443,7 +445,7 @@ bool WinEDA_App::SetBinDir() ...@@ -443,7 +445,7 @@ bool WinEDA_App::SetBinDir()
/* Use unix notation for paths. I am not sure this is a good idea, /* Use unix notation for paths. I am not sure this is a good idea,
* but it simplify compatibility between Windows and Unices * but it simplify compatibility between Windows and Unices
* However it is a potential problem in path handling under Windows * However it is a potential problem in path handling under Windows
*/ */
m_BinDir.Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP ); m_BinDir.Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP );
// Remove file name form command line: // Remove file name form command line:
...@@ -456,7 +458,7 @@ bool WinEDA_App::SetBinDir() ...@@ -456,7 +458,7 @@ bool WinEDA_App::SetBinDir()
wxLogDebug( wxT( "Windows path: " ) + wfn.GetFullPath() ); wxLogDebug( wxT( "Windows path: " ) + wfn.GetFullPath() );
wxLogDebug( wxT( "Executable path the Kicad way: " ) + m_BinDir ); wxLogDebug( wxT( "Executable path the Kicad way: " ) + m_BinDir );
wxLogDebug( wxT( "Executable path the wxWidgets way: " ) + wxLogDebug( wxT( "Executable path the wxWidgets way: " ) +
GetTraits()->GetStandardPaths().GetExecutablePath() ); GetTraits()->GetStandardPaths().GetExecutablePath() );
return TRUE; return TRUE;
} }
...@@ -474,6 +476,7 @@ void WinEDA_App::SetDefaultSearchPaths( void ) ...@@ -474,6 +476,7 @@ void WinEDA_App::SetDefaultSearchPaths( void )
m_searchPaths.Clear(); m_searchPaths.Clear();
#ifdef __WINDOWS__ #ifdef __WINDOWS__
/* m_BinDir path is in unix notation. /* m_BinDir path is in unix notation.
* But wxFileName expect (to work fine) native notation * But wxFileName expect (to work fine) native notation
* specifically when using a path including a server, like * specifically when using a path including a server, like
...@@ -509,10 +512,10 @@ void WinEDA_App::SetDefaultSearchPaths( void ) ...@@ -509,10 +512,10 @@ void WinEDA_App::SetDefaultSearchPaths( void )
m_searchPaths.Add( fn.GetPath() ); m_searchPaths.Add( fn.GetPath() );
/* The normal OS program file install paths allow for binary to be /* The normal OS program file install paths allow for binary to be
* installed in a different path from the library files. This is * installed in a different path from the library files. This is
* useful for development purposes so the library and documentation * useful for development purposes so the library and documentation
* files do not need to be installed separately. If someone can * files do not need to be installed separately. If someone can
* figure out a way to implement this without #ifdef, please do. */ * figure out a way to implement this without #ifdef, please do. */
#ifdef __WXMSW__ #ifdef __WXMSW__
tmp.AddEnvList( wxT( "PROGRAMFILES" ) ); tmp.AddEnvList( wxT( "PROGRAMFILES" ) );
#else #else
...@@ -545,7 +548,7 @@ void WinEDA_App::SetDefaultSearchPaths( void ) ...@@ -545,7 +548,7 @@ void WinEDA_App::SetDefaultSearchPaths( void )
if( !wxFileName::IsDirReadable( m_searchPaths[i] ) ) if( !wxFileName::IsDirReadable( m_searchPaths[i] ) )
{ {
wxLogDebug( wxT( "Removing <" ) + m_searchPaths[i] + wxLogDebug( wxT( "Removing <" ) + m_searchPaths[i] +
wxT( "> from search path list." ) ); wxT( "> from search path list." ) );
m_searchPaths.RemoveAt( i ); m_searchPaths.RemoveAt( i );
i -= 1; i -= 1;
} }
...@@ -553,25 +556,26 @@ void WinEDA_App::SetDefaultSearchPaths( void ) ...@@ -553,25 +556,26 @@ void WinEDA_App::SetDefaultSearchPaths( void )
{ {
fn.Clear(); fn.Clear();
fn.SetPath( m_searchPaths[i] ); fn.SetPath( m_searchPaths[i] );
/* Add schematic library file path to search path list. /* Add schematic library file path to search path list.
* we must add <kicad path>/library and <kicad path>/library/doc * we must add <kicad path>/library and <kicad path>/library/doc
*/ */
if ( m_Id == APP_TYPE_EESCHEMA ) if( m_Id == APP_TYPE_EESCHEMA )
{ {
fn.AppendDir( wxT( "library") ); fn.AppendDir( wxT( "library" ) );
if( fn.IsDirReadable() ) if( fn.IsDirReadable() )
{ {
wxLogDebug( wxT( "Adding <%s> to search path list" ), wxLogDebug( wxT( "Adding <%s> to search path list" ),
fn.GetPath().c_str() ); fn.GetPath().c_str() );
m_libSearchPaths.Add( fn.GetPath() ); m_libSearchPaths.Add( fn.GetPath() );
} }
/* Add schematic doc file path (library/doc)to search path list. */ /* Add schematic doc file path (library/doc)to search path list. */
fn.AppendDir( wxT( "doc") ); fn.AppendDir( wxT( "doc" ) );
if( fn.IsDirReadable() ) if( fn.IsDirReadable() )
{ {
wxLogDebug( wxT( "Adding <%s> to search path list" ), wxLogDebug( wxT( "Adding <%s> to search path list" ),
fn.GetPath().c_str() ); fn.GetPath().c_str() );
m_libSearchPaths.Add( fn.GetPath() ); m_libSearchPaths.Add( fn.GetPath() );
} }
fn.RemoveLastDir(); fn.RemoveLastDir();
...@@ -584,20 +588,20 @@ void WinEDA_App::SetDefaultSearchPaths( void ) ...@@ -584,20 +588,20 @@ void WinEDA_App::SetDefaultSearchPaths( void )
if( fn.IsDirReadable() ) if( fn.IsDirReadable() )
{ {
wxLogDebug( wxT( "Adding <%s> to search path list" ), wxLogDebug( wxT( "Adding <%s> to search path list" ),
fn.GetPath().c_str() ); fn.GetPath().c_str() );
m_libSearchPaths.Add( fn.GetPath() ); m_libSearchPaths.Add( fn.GetPath() );
} }
fn.RemoveLastDir(); fn.RemoveLastDir();
/* Add PCB library file path to search path list. */ /* Add PCB library file path to search path list. */
if ( ( m_Id == APP_TYPE_PCBNEW ) || ( m_Id == APP_TYPE_CVPCB ) ) if( ( m_Id == APP_TYPE_PCBNEW ) || ( m_Id == APP_TYPE_CVPCB ) )
{ {
fn.AppendDir( wxT( "modules" ) ); fn.AppendDir( wxT( "modules" ) );
if( fn.IsDirReadable() ) if( fn.IsDirReadable() )
{ {
wxLogDebug( wxT( "Adding <%s> to library search path list" ), wxLogDebug( wxT( "Adding <%s> to library search path list" ),
fn.GetPath().c_str() ); fn.GetPath().c_str() );
m_libSearchPaths.Add( fn.GetPath() ); m_libSearchPaths.Add( fn.GetPath() );
} }
...@@ -607,7 +611,7 @@ void WinEDA_App::SetDefaultSearchPaths( void ) ...@@ -607,7 +611,7 @@ void WinEDA_App::SetDefaultSearchPaths( void )
if( fn.IsDirReadable() ) if( fn.IsDirReadable() )
{ {
wxLogDebug( wxT( "Adding <%s> to search path list" ), wxLogDebug( wxT( "Adding <%s> to search path list" ),
fn.GetPath().c_str() ); fn.GetPath().c_str() );
m_libSearchPaths.Add( fn.GetPath() ); m_libSearchPaths.Add( fn.GetPath() );
} }
} }
...@@ -791,21 +795,21 @@ void WinEDA_App::SetLanguagePath( void ) ...@@ -791,21 +795,21 @@ void WinEDA_App::SetLanguagePath( void )
if( fn.DirExists() ) if( fn.DirExists() )
{ {
wxLogDebug( wxT( "Adding locale lookup path: " ) + wxLogDebug( wxT( "Adding locale lookup path: " ) +
fn.GetPath() ); fn.GetPath() );
wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() ); wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() );
} }
// Append path for unix standard install // Append path for unix standard install
fn.RemoveLastDir(); fn.RemoveLastDir();
// Append path for unix standard install // Append path for unix standard install
fn.AppendDir( wxT( "kicad" ) ); fn.AppendDir( wxT( "kicad" ) );
fn.AppendDir( wxT( "internat" ) ); fn.AppendDir( wxT( "internat" ) );
if( fn.DirExists() ) if( fn.DirExists() )
{ {
wxLogDebug( wxT( "Adding locale lookup path: " ) + wxLogDebug( wxT( "Adding locale lookup path: " ) +
fn.GetPath() ); fn.GetPath() );
wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() ); wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() );
} }
} }
...@@ -834,7 +838,7 @@ void WinEDA_App::AddMenuLanguageList( wxMenu* MasterMenu ) ...@@ -834,7 +838,7 @@ void WinEDA_App::AddMenuLanguageList( wxMenu* MasterMenu )
for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ ) for( ii = 0; ii < LANGUAGE_DESCR_COUNT; ii++ )
{ {
wxString label; wxString label;
if ( s_Language_List[ii].m_DoNotTranslate ) if( s_Language_List[ii].m_DoNotTranslate )
label = s_Language_List[ii].m_Lang_Label; label = s_Language_List[ii].m_Lang_Label;
else else
label = wxGetTranslation( s_Language_List[ii].m_Lang_Label ); label = wxGetTranslation( s_Language_List[ii].m_Lang_Label );
...@@ -888,7 +892,7 @@ wxString WinEDA_App::FindFileInSearchPaths( const wxString& filename, ...@@ -888,7 +892,7 @@ wxString WinEDA_App::FindFileInSearchPaths( const wxString& filename,
if( fn.DirExists() ) if( fn.DirExists() )
{ {
wxLogDebug( _T( "Adding <" ) + fn.GetPath() + _T( "> to " ) + wxLogDebug( _T( "Adding <" ) + fn.GetPath() + _T( "> to " ) +
_T( "file \"" ) + filename + _T( "\" search path." ) ); _T( "file \"" ) + filename + _T( "\" search path." ) );
paths.Add( fn.GetPath() ); paths.Add( fn.GetPath() );
} }
} }
...@@ -963,11 +967,12 @@ wxString WinEDA_App::GetHelpFile( void ) ...@@ -963,11 +967,12 @@ wxString WinEDA_App::GetHelpFile( void )
{ {
subdirs.RemoveAt( subdirs.GetCount() - 1 ); subdirs.RemoveAt( subdirs.GetCount() - 1 );
altsubdirs.RemoveAt( altsubdirs.GetCount() - 1 ); altsubdirs.RemoveAt( altsubdirs.GetCount() - 1 );
// wxLocale::GetName() does not return always the short name
// wxLocale::GetName() does not return always the short name
subdirs.Add( m_Locale->GetName().BeforeLast( '_' ) ); subdirs.Add( m_Locale->GetName().BeforeLast( '_' ) );
altsubdirs.Add( m_Locale->GetName().BeforeLast( '_' ) ); altsubdirs.Add( m_Locale->GetName().BeforeLast( '_' ) );
fn = FindFileInSearchPaths( m_HelpFileName, &altsubdirs ); fn = FindFileInSearchPaths( m_HelpFileName, &altsubdirs );
if ( ! fn ) if( !fn )
fn = FindFileInSearchPaths( m_HelpFileName, &subdirs ); fn = FindFileInSearchPaths( m_HelpFileName, &subdirs );
} }
...@@ -979,7 +984,7 @@ wxString WinEDA_App::GetHelpFile( void ) ...@@ -979,7 +984,7 @@ wxString WinEDA_App::GetHelpFile( void )
subdirs.Add( _T( "en" ) ); subdirs.Add( _T( "en" ) );
altsubdirs.Add( _T( "en" ) ); altsubdirs.Add( _T( "en" ) );
fn = FindFileInSearchPaths( m_HelpFileName, &altsubdirs ); fn = FindFileInSearchPaths( m_HelpFileName, &altsubdirs );
if ( ! fn ) if( !fn )
fn = FindFileInSearchPaths( m_HelpFileName, &subdirs ); fn = FindFileInSearchPaths( m_HelpFileName, &subdirs );
} }
...@@ -1001,38 +1006,39 @@ wxString WinEDA_App::GetLibraryFile( const wxString& filename ) ...@@ -1001,38 +1006,39 @@ wxString WinEDA_App::GetLibraryFile( const wxString& filename )
return FindFileInSearchPaths( filename, &subdirs ); return FindFileInSearchPaths( filename, &subdirs );
} }
/** ReturnLastVisitedLibraryPath /** ReturnLastVisitedLibraryPath
* Returns the last visited library directory, or (if void) the first * Returns the last visited library directory, or (if void) the first
* path in lib path list ( but not the CWD ) * path in lib path list ( but not the CWD )
* @param aSubPathToSearch = Prefered sub path to search in path list (defualt = empty string) * @param aSubPathToSearch = Prefered sub path to search in path list (defualt = empty string)
*/ */
wxString WinEDA_App::ReturnLastVisitedLibraryPath( const wxString & aSubPathToSearch ) wxString WinEDA_App::ReturnLastVisitedLibraryPath( const wxString& aSubPathToSearch )
{ {
if ( ! m_LastVisitedLibPath.IsEmpty() ) if( !m_LastVisitedLibPath.IsEmpty() )
return m_LastVisitedLibPath; return m_LastVisitedLibPath;
wxString path; wxString path;
/* Initialize default path to the main default lib path /* Initialize default path to the main default lib path
* this is the second path in list (the first is the project path) * this is the second path in list (the first is the project path)
*/ */
unsigned pcount = m_libSearchPaths.GetCount(); unsigned pcount = m_libSearchPaths.GetCount();
if ( pcount ) if( pcount )
{ {
unsigned ipath = 0; unsigned ipath = 0;
if ( m_libSearchPaths[0] == wxGetCwd() ) if( m_libSearchPaths[0] == wxGetCwd() )
ipath = 1; ipath = 1;
// First choice of path: // First choice of path:
if ( ipath < pcount ) if( ipath < pcount )
path = m_libSearchPaths[ipath]; path = m_libSearchPaths[ipath];
// Search a sub path matching aSubPathToSearch // Search a sub path matching aSubPathToSearch
if ( ! aSubPathToSearch.IsEmpty() ) if( !aSubPathToSearch.IsEmpty() )
{ {
for ( ; ipath < pcount; ipath++ ) for( ; ipath < pcount; ipath++ )
{ {
if ( m_libSearchPaths[ipath].Contains( aSubPathToSearch ) ) if( m_libSearchPaths[ipath].Contains( aSubPathToSearch ) )
{ {
path = m_libSearchPaths[ipath]; path = m_libSearchPaths[ipath];
break; break;
...@@ -1041,24 +1047,26 @@ wxString WinEDA_App::ReturnLastVisitedLibraryPath( const wxString & aSubPathToSe ...@@ -1041,24 +1047,26 @@ wxString WinEDA_App::ReturnLastVisitedLibraryPath( const wxString & aSubPathToSe
} }
} }
if ( path.IsEmpty() ) if( path.IsEmpty() )
path = wxGetCwd(); path = wxGetCwd();
return path; return path;
} }
void WinEDA_App::SaveLastVisitedLibraryPath( const wxString & aPath)
void WinEDA_App::SaveLastVisitedLibraryPath( const wxString& aPath )
{ {
m_LastVisitedLibPath = aPath; m_LastVisitedLibPath = aPath;
} }
/** ReturnFilenameWithRelativePathInLibPath /** ReturnFilenameWithRelativePathInLibPath
* @return a short filename (with extension) with only a relative path if this filename * @return a short filename (with extension) with only a relative path if this filename
* can be found in library paths * can be found in library paths
* @param aFullFilename = filename with path and extension. * @param aFullFilename = filename with path and extension.
*/ */
wxString WinEDA_App::ReturnFilenameWithRelativePathInLibPath(const wxString & aFullFilename) wxString WinEDA_App::ReturnFilenameWithRelativePathInLibPath( const wxString& aFullFilename )
{ {
/* If the library path is already in the library search paths /* If the library path is already in the library search paths
* list, just add the library name to the list. Otherwise, add * list, just add the library name to the list. Otherwise, add
* the library name with the full or relative path. * the library name with the full or relative path.
* the relative path, when possible is preferable, * the relative path, when possible is preferable,
...@@ -1066,16 +1074,17 @@ wxString WinEDA_App::ReturnFilenameWithRelativePathInLibPath(const wxString & aF ...@@ -1066,16 +1074,17 @@ wxString WinEDA_App::ReturnFilenameWithRelativePathInLibPath(const wxString & aF
* *
*/ */
wxFileName fn = aFullFilename; wxFileName fn = aFullFilename;
wxString filename = aFullFilename; wxString filename = aFullFilename;
int pathlen = -1; // path len, used to find the better subpath within defualts paths 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
if( m_libSearchPaths.Index( fn.GetPath() ) != wxNOT_FOUND ) // Ok, trivial case
filename = fn.GetName(); filename = fn.GetName();
else // not in the default, : see if this file is in a subpath: else // not in the default, : see if this file is in a subpath:
{ {
filename = fn.GetPathWithSep() + fn.GetFullName(); filename = fn.GetPathWithSep() + fn.GetFullName();
for( unsigned kk = 0; kk < m_libSearchPaths.GetCount(); kk++ ) for( unsigned kk = 0; kk < m_libSearchPaths.GetCount(); kk++ )
{ {
if( fn.MakeRelativeTo(m_libSearchPaths[kk] ) ) if( fn.MakeRelativeTo( m_libSearchPaths[kk] ) )
{ {
if( pathlen < 0 // a subpath is found if( pathlen < 0 // a subpath is found
|| pathlen > (int) fn.GetPath().Len() ) // a better subpath if found || pathlen > (int) fn.GetPath().Len() ) // a better subpath if found
...@@ -1108,37 +1117,50 @@ wxString WinEDA_App::FindLibraryPath( const wxString& aFileName ) ...@@ -1108,37 +1117,50 @@ wxString WinEDA_App::FindLibraryPath( const wxString& aFileName )
return m_libSearchPaths.FindValidPath( aFileName ); return m_libSearchPaths.FindValidPath( aFileName );
} }
/** Function RemoveLibraryPath /** Function RemoveLibraryPath
* Removes the given path from the library path list * Removes the given path(s) from the library path list
* @param path = the path to remove * @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 )
{ {
if( m_libSearchPaths.Index( path, wxFileName::IsCaseSensitive() ) != wxNOT_FOUND ) wxStringTokenizer Token( aPaths, wxT( ";\n\r" ) );
while( Token.HasMoreTokens() )
{ {
wxLogDebug( wxT( "Removing path <%s> from library path search list." ), wxString path = Token.GetNextToken();
path.c_str() ); if( m_libSearchPaths.Index( path, wxFileName::IsCaseSensitive() ) != wxNOT_FOUND )
m_libSearchPaths.Remove( path ); {
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 )
{ {
if( wxFileName::DirExists( path ) wxStringTokenizer Token( aPaths, wxT( ";\n\r" ) );
&& m_libSearchPaths.Index( path, wxFileName::IsCaseSensitive() ) == wxNOT_FOUND )
while( Token.HasMoreTokens() )
{ {
if( index >= m_libSearchPaths.GetCount() ) wxString path = Token.GetNextToken();
{ if( wxFileName::DirExists( path )
wxLogDebug( wxT( "Adding path <%s> to library path search list." ), && m_libSearchPaths.Index( path, wxFileName::IsCaseSensitive() ) == wxNOT_FOUND )
path.c_str() );
m_libSearchPaths.Add( path );
}
else
{ {
wxLogDebug( wxT( "Inserting path <%s> in library path search " \ if( aIndex >= m_libSearchPaths.GetCount() )
"list at index position %d." ), {
path.c_str(), index ); m_libSearchPaths.Add( path );
m_libSearchPaths.Insert( path, index ); }
else
{
m_libSearchPaths.Insert( path, aIndex );
}
aIndex++;
} }
} }
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#include "fctsys.h" #include "fctsys.h"
#include <wx/tokenzr.h>
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "confirm.h" #include "confirm.h"
...@@ -30,6 +31,8 @@ class DIALOG_EESCHEMA_CONFIG : public DIALOG_EESCHEMA_CONFIG_FBP ...@@ -30,6 +31,8 @@ class DIALOG_EESCHEMA_CONFIG : public DIALOG_EESCHEMA_CONFIG_FBP
private: private:
WinEDA_SchematicFrame* m_Parent; WinEDA_SchematicFrame* m_Parent;
bool m_LibListChanged; bool m_LibListChanged;
bool m_LibPathChanged;
wxString m_UserLibDirBufferImg; // Copy of original g_UserLibDirBuffer
private: private:
...@@ -39,7 +42,7 @@ private: ...@@ -39,7 +42,7 @@ private:
void OnSaveCfgClick( wxCommandEvent& event ); void OnSaveCfgClick( wxCommandEvent& event );
void OnRemoveLibClick( wxCommandEvent& event ); void OnRemoveLibClick( wxCommandEvent& event );
void OnAddOrInsertLibClick( wxCommandEvent& event ); void OnAddOrInsertLibClick( wxCommandEvent& event );
void OnLibPathSelClick( wxCommandEvent& event ); void OnAddOrInsertPath( wxCommandEvent& event );
void OnOkClick( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
void OnRemoveUserPath( wxCommandEvent& event ); void OnRemoveUserPath( wxCommandEvent& event );
...@@ -69,7 +72,6 @@ DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent ) ...@@ -69,7 +72,6 @@ DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent )
wxString msg; wxString msg;
m_Parent = parent; m_Parent = parent;
m_LibListChanged = false;
Init(); Init();
...@@ -88,6 +90,10 @@ void DIALOG_EESCHEMA_CONFIG::Init() ...@@ -88,6 +90,10 @@ void DIALOG_EESCHEMA_CONFIG::Init()
SetFont( *g_DialogFont ); SetFont( *g_DialogFont );
SetFocus(); SetFocus();
m_LibListChanged = false;
m_LibPathChanged = false;
m_UserLibDirBufferImg = g_UserLibDirBuffer; // Save the original lib path
// Display current files extension (info) // Display current files extension (info)
wxString msg = m_InfoCmpFileExt->GetLabel() + g_NetCmpExtBuffer; wxString msg = m_InfoCmpFileExt->GetLabel() + g_NetCmpExtBuffer;
m_InfoCmpFileExt->SetLabel( msg ); m_InfoCmpFileExt->SetLabel( msg );
...@@ -126,7 +132,15 @@ void DIALOG_EESCHEMA_CONFIG::Init() ...@@ -126,7 +132,15 @@ void DIALOG_EESCHEMA_CONFIG::Init()
m_NetFormatBox->SetSelection( g_NetFormat - NET_TYPE_PCBNEW ); m_NetFormatBox->SetSelection( g_NetFormat - NET_TYPE_PCBNEW );
m_ListLibr->InsertItems( g_LibName_List, 0 ); 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: // Display actual libraries paths:
wxPathList libpaths = wxGetApp().GetLibraryPathList(); wxPathList libpaths = wxGetApp().GetLibraryPathList();
...@@ -134,6 +148,10 @@ void DIALOG_EESCHEMA_CONFIG::Init() ...@@ -134,6 +148,10 @@ void DIALOG_EESCHEMA_CONFIG::Init()
{ {
m_DefaultLibraryPathslistBox->Append( libpaths[ii]); m_DefaultLibraryPathslistBox->Append( libpaths[ii]);
} }
// select the first path afer the current path project
if ( libpaths.GetCount() > 1 )
m_DefaultLibraryPathslistBox->Select( 1 );
} }
...@@ -141,6 +159,13 @@ void DIALOG_EESCHEMA_CONFIG::Init() ...@@ -141,6 +159,13 @@ void DIALOG_EESCHEMA_CONFIG::Init()
void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event ) 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 ); EndModal( -1 );
} }
...@@ -152,17 +177,21 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event ) ...@@ -152,17 +177,21 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event )
// Set new netlist format // Set new netlist format
g_NetFormat = m_NetFormatBox->GetSelection() + NET_TYPE_PCBNEW; g_NetFormat = m_NetFormatBox->GetSelection() + NET_TYPE_PCBNEW;
// Set new default path lib // Recreate the user lib path
if ( g_UserLibDirBuffer != m_LibDirCtrl->GetValue() ) if ( m_LibPathChanged )
{ {
wxGetApp().RemoveLibraryPath( g_UserLibDirBuffer ); g_UserLibDirBuffer.Empty();
g_UserLibDirBuffer = m_LibDirCtrl->GetValue(); for ( unsigned ii = 0; ii < m_listUserPaths->GetCount(); ii ++ )
wxGetApp().InsertLibraryPath( g_UserLibDirBuffer, 1 ); {
m_LibListChanged = true; 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 // Recreate lib list
g_LibName_List.Clear(); g_LibName_List.Clear();
...@@ -223,7 +252,8 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) ...@@ -223,7 +252,8 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
if( ii == wxNOT_FOUND && event.GetId() != ID_ADD_LIB ) if( ii == wxNOT_FOUND && event.GetId() != ID_ADD_LIB )
ii = 0; ii = 0;
wxString libpath = m_LibDirCtrl->GetValue(); wxString libpath;
libpath = m_DefaultLibraryPathslistBox->GetStringSelection();
if ( libpath.IsEmpty() ) if ( libpath.IsEmpty() )
libpath = wxGetApp().ReturnLastVisitedLibraryPath(); libpath = wxGetApp().ReturnLastVisitedLibraryPath();
...@@ -295,14 +325,12 @@ void DIALOG_EESCHEMA_CONFIG::OnSaveCfgClick( wxCommandEvent& event ) ...@@ -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(); wxString path = wxGetApp().ReturnLastVisitedLibraryPath();
if ( path.IsEmpty() )
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 */ path, /* Chemin par defaut */
wxDD_DEFAULT_STYLE, wxDD_DEFAULT_STYLE,
this, /* parent frame */ this, /* parent frame */
...@@ -311,7 +339,36 @@ void DIALOG_EESCHEMA_CONFIG::OnLibPathSelClick( wxCommandEvent& event ) ...@@ -311,7 +339,36 @@ void DIALOG_EESCHEMA_CONFIG::OnLibPathSelClick( wxCommandEvent& event )
if( !select ) if( !select )
return; 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 ); wxGetApp().SaveLastVisitedLibraryPath( path );
} }
...@@ -321,5 +378,21 @@ void DIALOG_EESCHEMA_CONFIG::OnLibPathSelClick( wxCommandEvent& event ) ...@@ -321,5 +378,21 @@ void DIALOG_EESCHEMA_CONFIG::OnLibPathSelClick( wxCommandEvent& event )
void DIALOG_EESCHEMA_CONFIG::OnRemoveUserPath( 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]);
}
}
...@@ -83,38 +83,33 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind ...@@ -83,38 +83,33 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind
bRightSizer = new wxBoxSizer( wxVERTICAL ); bRightSizer = new wxBoxSizer( wxVERTICAL );
m_buttonRemoveLib = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); 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") ); 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_buttonAddLib = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonAdd->SetForegroundColour( wxColour( 13, 118, 1 ) ); m_buttonAddLib->SetToolTip( _("Add a new library after the selected library, and load it") );
m_buttonAdd->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 = new wxButton( this, wxID_ANY, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonIns->SetForegroundColour( wxColour( 0, 65, 130 ) );
m_buttonIns->SetToolTip( _("Add a new library before the selected library, and load it") ); 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 ); bRightSizer->Add( 0, 20, 1, wxEXPAND, 5 );
m_buttonOk = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 ); 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 = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonCancel->SetForegroundColour( wxColour( 14, 0, 179 ) ); bRightSizer->Add( m_buttonCancel, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 );
bRightSizer->Add( m_buttonCancel, 0, wxRIGHT|wxLEFT, 5 );
m_buttonSave = new wxButton( this, ID_SAVE_CFG, _("Save Cfg"), wxDefaultPosition, wxDefaultSize, 0 ); 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") ); 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 ); bUpperSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
...@@ -135,21 +130,22 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind ...@@ -135,21 +130,22 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind
wxBoxSizer* bUserListSizer; wxBoxSizer* bUserListSizer;
bUserListSizer = new wxBoxSizer( wxVERTICAL ); bUserListSizer = new wxBoxSizer( wxVERTICAL );
m_LibDirCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_listUserPaths = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 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_listUserPaths, 1, wxALL|wxEXPAND, 5 );
bUserListSizer->Add( m_LibDirCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL, 5 ); sbSizer4->Add( bUserListSizer, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
wxBoxSizer* bUserPathsButtonsSizer; wxBoxSizer* bUserPathsButtonsSizer;
bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL ); bUserPathsButtonsSizer = new wxBoxSizer( wxVERTICAL );
m_buttonBrowse = new wxButton( this, ID_LIB_PATH_SEL, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonRemovePath = new wxButton( this, wxID_REMOVE_PATH, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
bUserPathsButtonsSizer->Add( m_buttonBrowse, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); 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 ); m_buttonInsPath = new wxButton( this, wxID_INSERT_PATH, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 );
bUserPathsButtonsSizer->Add( m_buttonRemovePath, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bUserPathsButtonsSizer->Add( m_buttonInsPath, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbSizer4->Add( bUserPathsButtonsSizer, 0, wxEXPAND, 5 ); sbSizer4->Add( bUserPathsButtonsSizer, 0, wxEXPAND, 5 );
...@@ -175,13 +171,14 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind ...@@ -175,13 +171,14 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind
// Connect Events // Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) ); 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_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_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_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_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_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_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() DIALOG_EESCHEMA_CONFIG_FBP::~DIALOG_EESCHEMA_CONFIG_FBP()
...@@ -189,11 +186,12 @@ DIALOG_EESCHEMA_CONFIG_FBP::~DIALOG_EESCHEMA_CONFIG_FBP() ...@@ -189,11 +186,12 @@ DIALOG_EESCHEMA_CONFIG_FBP::~DIALOG_EESCHEMA_CONFIG_FBP()
// Disconnect Events // Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) ); 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_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_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_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_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_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_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 );
} }
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">DIALOG_EESCHEMA_CONFIG_FBP</property> <property name="name">DIALOG_EESCHEMA_CONFIG_FBP</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">593,500</property> <property name="size">593,559</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property> <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="title"></property> <property name="title"></property>
...@@ -616,14 +616,14 @@ ...@@ -616,14 +616,14 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="default">0</property> <property name="default">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg">186,1,38</property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_REMOVE_LIB</property> <property name="id">ID_REMOVE_LIB</property>
...@@ -668,21 +668,21 @@ ...@@ -668,21 +668,21 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT</property> <property name="flag">wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="default">0</property> <property name="default">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg">13,118,1</property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_ADD_LIB</property> <property name="id">ID_ADD_LIB</property>
<property name="label">Add</property> <property name="label">Add</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_buttonAdd</property> <property name="name">m_buttonAddLib</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
...@@ -720,18 +720,18 @@ ...@@ -720,18 +720,18 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="default">0</property> <property name="default">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg">0,65,130</property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Ins</property> <property name="label">Insert</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_buttonIns</property> <property name="name">m_buttonIns</property>
...@@ -782,7 +782,7 @@ ...@@ -782,7 +782,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -834,14 +834,14 @@ ...@@ -834,14 +834,14 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT</property> <property name="flag">wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="default">0</property> <property name="default">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg">14,0,179</property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_CANCEL</property> <property name="id">wxID_CANCEL</property>
...@@ -886,7 +886,7 @@ ...@@ -886,7 +886,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND</property> <property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -1024,7 +1024,7 @@ ...@@ -1024,7 +1024,7 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
...@@ -1033,10 +1033,11 @@ ...@@ -1033,10 +1033,11 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">1</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxListBox" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="choices"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
...@@ -1044,16 +1045,14 @@ ...@@ -1044,16 +1045,14 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_LibDirCtrl</property> <property name="name">m_listUserPaths</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">Default path to search libraries which have no absolute path in name,&#x0A;or a name which does not start by ./ or ../&#x0A;If void, the default path is kicad/share/library</property> <property name="tooltip"></property>
<property name="value"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
...@@ -1067,6 +1066,8 @@ ...@@ -1067,6 +1066,8 @@
<event name="OnLeftDClick"></event> <event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event> <event name="OnLeftDown"></event>
<event name="OnLeftUp"></event> <event name="OnLeftUp"></event>
<event name="OnListBox"></event>
<event name="OnListBoxDClick"></event>
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event> <event name="OnMiddleUp"></event>
...@@ -1079,10 +1080,6 @@ ...@@ -1079,10 +1080,6 @@
<event name="OnRightUp"></event> <event name="OnRightUp"></event>
<event name="OnSetFocus"></event> <event name="OnSetFocus"></event>
<event name="OnSize"></event> <event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
...@@ -1097,6 +1094,58 @@ ...@@ -1097,6 +1094,58 @@
<property name="name">bUserPathsButtonsSizer</property> <property name="name">bUserPathsButtonsSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_REMOVE_PATH</property>
<property name="label">Remove</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_buttonRemovePath</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnRemoveUserPath</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
...@@ -1110,10 +1159,10 @@ ...@@ -1110,10 +1159,10 @@
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_LIB_PATH_SEL</property> <property name="id">ID_LIB_PATH_SEL</property>
<property name="label">Browse</property> <property name="label">Add</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_buttonBrowse</property> <property name="name">m_buttonAddPath</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
...@@ -1123,7 +1172,7 @@ ...@@ -1123,7 +1172,7 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnButtonClick">OnLibPathSelClick</event> <event name="OnButtonClick">OnAddOrInsertPath</event>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
...@@ -1161,11 +1210,11 @@ ...@@ -1161,11 +1210,11 @@
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_INSERT_PATH</property>
<property name="label">Remove</property> <property name="label">Insert</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_buttonRemovePath</property> <property name="name">m_buttonInsPath</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
...@@ -1175,7 +1224,7 @@ ...@@ -1175,7 +1224,7 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnButtonClick">OnRemoveUserPath</event> <event name="OnButtonClick">OnAddOrInsertPath</event>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/statline.h> #include <wx/statline.h>
#include <wx/textctrl.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
...@@ -39,7 +38,9 @@ class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog ...@@ -39,7 +38,9 @@ class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog
ID_REMOVE_LIB = 1000, ID_REMOVE_LIB = 1000,
ID_ADD_LIB, ID_ADD_LIB,
ID_SAVE_CFG, ID_SAVE_CFG,
wxID_REMOVE_PATH,
ID_LIB_PATH_SEL, ID_LIB_PATH_SEL,
wxID_INSERT_PATH,
}; };
wxStaticText* m_staticTextNetListFormats; wxStaticText* m_staticTextNetListFormats;
...@@ -53,16 +54,17 @@ class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog ...@@ -53,16 +54,17 @@ class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog
wxStaticText* m_staticTextlibList; wxStaticText* m_staticTextlibList;
wxListBox* m_ListLibr; wxListBox* m_ListLibr;
wxButton* m_buttonRemoveLib; wxButton* m_buttonRemoveLib;
wxButton* m_buttonAdd; wxButton* m_buttonAddLib;
wxButton* m_buttonIns; wxButton* m_buttonIns;
wxButton* m_buttonOk; wxButton* m_buttonOk;
wxButton* m_buttonCancel; wxButton* m_buttonCancel;
wxButton* m_buttonSave; wxButton* m_buttonSave;
wxStaticLine* m_staticline1; wxStaticLine* m_staticline1;
wxTextCtrl* m_LibDirCtrl; wxListBox* m_listUserPaths;
wxButton* m_buttonBrowse;
wxButton* m_buttonRemovePath; wxButton* m_buttonRemovePath;
wxButton* m_buttonAddPath;
wxButton* m_buttonInsPath;
wxStaticText* m_staticTextcurrenpaths; wxStaticText* m_staticTextcurrenpaths;
wxListBox* m_DefaultLibraryPathslistBox; wxListBox* m_DefaultLibraryPathslistBox;
...@@ -73,12 +75,12 @@ class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog ...@@ -73,12 +75,12 @@ class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnSaveCfgClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnSaveCfgClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnLibPathSelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRemoveUserPath( wxCommandEvent& event ){ event.Skip(); } virtual void OnRemoveUserPath( wxCommandEvent& event ){ event.Skip(); }
virtual void OnAddOrInsertPath( wxCommandEvent& event ){ event.Skip(); }
public: public:
DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 593,500 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 593,559 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EESCHEMA_CONFIG_FBP(); ~DIALOG_EESCHEMA_CONFIG_FBP();
}; };
......
...@@ -185,13 +185,19 @@ public: ...@@ -185,13 +185,19 @@ public:
* @param aFullFilename = filename with path and extension. * @param aFullFilename = filename with path and extension.
*/ */
wxString ReturnFilenameWithRelativePathInLibPath(const wxString & aFullFilename); wxString ReturnFilenameWithRelativePathInLibPath(const wxString & aFullFilename);
/** Function RemoveLibraryPath /** Function RemoveLibraryPath
* Removes the given ptah from the libary path list * Removes the given path(s) from the library path list
* @param path = the path to remove * @param aPaths = path or path list to remove. paths must be separated by ";"
*/
void RemoveLibraryPath( const wxString& aPaths );
/** 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 RemoveLibraryPath( const wxString& path ); void InsertLibraryPath( const wxString& aPaths, size_t aIndex );
void InsertLibraryPath( const wxString& path, size_t index );
}; };
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment