Loading common/confirm.cpp +9 −5 Original line number Original line Diff line number Diff line Loading @@ -73,10 +73,14 @@ void DisplayError( wxWindow* parent, const wxString& text, int displaytime ) if( displaytime > 0 ) if( displaytime > 0 ) dialog = new wxMessageDialog( parent, text, _( "Warning" ), dialog = new wxMessageDialog( parent, text, _( "Warning" ), wxOK | wxCENTRE | wxICON_INFORMATION ); wxOK | wxCENTRE | wxICON_INFORMATION | wxRESIZE_BORDER ); else else dialog = new wxMessageDialog( parent, text, _( "Error" ), dialog = new wxMessageDialog( parent, text, _( "Error" ), wxOK | wxCENTRE | wxICON_ERROR ); wxOK | wxCENTRE | wxICON_ERROR | wxRESIZE_BORDER ); dialog->ShowModal(); dialog->ShowModal(); dialog->Destroy(); dialog->Destroy(); Loading pcbnew/dialogs/dialog_fp_lib_table.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -40,7 +40,7 @@ #include <fp_lib_table_lexer.h> #include <fp_lib_table_lexer.h> #include <invoke_pcb_dialog.h> #include <invoke_pcb_dialog.h> #include <grid_tricks.h> #include <grid_tricks.h> #include <confirm.h> /// grid column order is established by this sequence /// grid column order is established by this sequence enum COL_ORDER enum COL_ORDER Loading Loading @@ -244,7 +244,7 @@ protected: } } catch( PARSE_ERROR& pe ) catch( PARSE_ERROR& pe ) { { // @todo tell what line and offset DisplayError( NULL, pe.errorText ); parsed = false; parsed = false; } } Loading pcbnew/eagle_plugin.cpp +41 −16 Original line number Original line Diff line number Diff line Loading @@ -97,17 +97,28 @@ const wxChar* traceEaglePlugin = wxT( "KicadEaglePlugin" ); /// Test footprint name for kicad legality, fix if needed and return true if fixing was required. /// Test footprint name for kicad legality, fix if needed and return true if fixing was required. static bool fix_eagle_package_name( string* aName ) static bool fix_eagle_package_name( string* aName ) { { string result; bool changed = false; bool changed = false; for( string::iterator it = aName->begin(); it != aName->end(); ++it ) for( string::iterator it = aName->begin(); it != aName->end(); ++it ) { { switch( *it ) // for mapping, I always prefer a tabular switch presentation: switch( *it ) { { case ':': *it = '_'; changed = true; break; case ':': case '/': *it = '-'; changed = true; break; case '/': // replace *it with %xx, as in URL encoding StrPrintf( &result, "%%%02x", *it ); changed = true; break; default: result += *it; } } } } if( changed ) *aName = result; return changed; return changed; } } Loading Loading @@ -1292,9 +1303,6 @@ void EAGLE_PLUGIN::loadDesignRules( CPTREE& aDesignRules ) void EAGLE_PLUGIN::loadLayerDefs( CPTREE& aLayers ) void EAGLE_PLUGIN::loadLayerDefs( CPTREE& aLayers ) { { if( m_board == NULL ) return; typedef std::vector<ELAYER> ELAYERS; typedef std::vector<ELAYER> ELAYERS; typedef ELAYERS::const_iterator EITER; typedef ELAYERS::const_iterator EITER; Loading Loading @@ -1333,6 +1341,9 @@ void EAGLE_PLUGIN::loadLayerDefs( CPTREE& aLayers ) } } #endif #endif // Set the layer names and cu count iff we're loading a board. if( m_board ) { m_board->SetCopperLayerCount( cu.size() ); m_board->SetCopperLayerCount( cu.size() ); for( EITER it = cu.begin(); it != cu.end(); ++it ) for( EITER it = cu.begin(); it != cu.end(); ++it ) Loading @@ -1346,6 +1357,7 @@ void EAGLE_PLUGIN::loadLayerDefs( CPTREE& aLayers ) // could map the colors here // could map the colors here } } } } } void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics ) void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics ) Loading Loading @@ -1625,7 +1637,9 @@ void EAGLE_PLUGIN::loadLibrary( CPTREE& aLib, const string* aLibName ) // add the templating MODULE to the MODULE template factory "m_templates" // add the templating MODULE to the MODULE template factory "m_templates" std::pair<MODULE_ITER, bool> r = m_templates.insert( key, m ); std::pair<MODULE_ITER, bool> r = m_templates.insert( key, m ); if( !r.second ) if( !r.second // && !( m_props && m_props->Value( "ignore_duplicates" ) ) ) { { wxString lib = aLibName ? FROM_UTF8( aLibName->c_str() ) : m_lib_path; wxString lib = aLibName ? FROM_UTF8( aLibName->c_str() ) : m_lib_path; wxString pkg = FROM_UTF8( pack_name.c_str() ); wxString pkg = FROM_UTF8( pack_name.c_str() ); Loading Loading @@ -2876,6 +2890,17 @@ MODULE* EAGLE_PLUGIN::FootprintLoad( const wxString& aLibraryPath, const wxStrin } } void EAGLE_PLUGIN::FootprintLibOptions( PROPERTIES* aListToAppendTo ) const { /* (*aListToAppendTo)["ignore_duplicates"] = wxString( _( "Ignore duplicately named footprints within the same Eagle library. " "Only the first similarly named footprint will be loaded." )).utf8_str(); */ } /* /* void EAGLE_PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties ) void EAGLE_PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties ) { { Loading pcbnew/eagle_plugin.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -95,6 +95,8 @@ public: return false; // until someone writes others like FootprintSave(), etc. return false; // until someone writes others like FootprintSave(), etc. } } void FootprintLibOptions( PROPERTIES* aProperties ) const; /* /* void Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties = NULL ); void Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties = NULL ); Loading Loading
common/confirm.cpp +9 −5 Original line number Original line Diff line number Diff line Loading @@ -73,10 +73,14 @@ void DisplayError( wxWindow* parent, const wxString& text, int displaytime ) if( displaytime > 0 ) if( displaytime > 0 ) dialog = new wxMessageDialog( parent, text, _( "Warning" ), dialog = new wxMessageDialog( parent, text, _( "Warning" ), wxOK | wxCENTRE | wxICON_INFORMATION ); wxOK | wxCENTRE | wxICON_INFORMATION | wxRESIZE_BORDER ); else else dialog = new wxMessageDialog( parent, text, _( "Error" ), dialog = new wxMessageDialog( parent, text, _( "Error" ), wxOK | wxCENTRE | wxICON_ERROR ); wxOK | wxCENTRE | wxICON_ERROR | wxRESIZE_BORDER ); dialog->ShowModal(); dialog->ShowModal(); dialog->Destroy(); dialog->Destroy(); Loading
pcbnew/dialogs/dialog_fp_lib_table.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -40,7 +40,7 @@ #include <fp_lib_table_lexer.h> #include <fp_lib_table_lexer.h> #include <invoke_pcb_dialog.h> #include <invoke_pcb_dialog.h> #include <grid_tricks.h> #include <grid_tricks.h> #include <confirm.h> /// grid column order is established by this sequence /// grid column order is established by this sequence enum COL_ORDER enum COL_ORDER Loading Loading @@ -244,7 +244,7 @@ protected: } } catch( PARSE_ERROR& pe ) catch( PARSE_ERROR& pe ) { { // @todo tell what line and offset DisplayError( NULL, pe.errorText ); parsed = false; parsed = false; } } Loading
pcbnew/eagle_plugin.cpp +41 −16 Original line number Original line Diff line number Diff line Loading @@ -97,17 +97,28 @@ const wxChar* traceEaglePlugin = wxT( "KicadEaglePlugin" ); /// Test footprint name for kicad legality, fix if needed and return true if fixing was required. /// Test footprint name for kicad legality, fix if needed and return true if fixing was required. static bool fix_eagle_package_name( string* aName ) static bool fix_eagle_package_name( string* aName ) { { string result; bool changed = false; bool changed = false; for( string::iterator it = aName->begin(); it != aName->end(); ++it ) for( string::iterator it = aName->begin(); it != aName->end(); ++it ) { { switch( *it ) // for mapping, I always prefer a tabular switch presentation: switch( *it ) { { case ':': *it = '_'; changed = true; break; case ':': case '/': *it = '-'; changed = true; break; case '/': // replace *it with %xx, as in URL encoding StrPrintf( &result, "%%%02x", *it ); changed = true; break; default: result += *it; } } } } if( changed ) *aName = result; return changed; return changed; } } Loading Loading @@ -1292,9 +1303,6 @@ void EAGLE_PLUGIN::loadDesignRules( CPTREE& aDesignRules ) void EAGLE_PLUGIN::loadLayerDefs( CPTREE& aLayers ) void EAGLE_PLUGIN::loadLayerDefs( CPTREE& aLayers ) { { if( m_board == NULL ) return; typedef std::vector<ELAYER> ELAYERS; typedef std::vector<ELAYER> ELAYERS; typedef ELAYERS::const_iterator EITER; typedef ELAYERS::const_iterator EITER; Loading Loading @@ -1333,6 +1341,9 @@ void EAGLE_PLUGIN::loadLayerDefs( CPTREE& aLayers ) } } #endif #endif // Set the layer names and cu count iff we're loading a board. if( m_board ) { m_board->SetCopperLayerCount( cu.size() ); m_board->SetCopperLayerCount( cu.size() ); for( EITER it = cu.begin(); it != cu.end(); ++it ) for( EITER it = cu.begin(); it != cu.end(); ++it ) Loading @@ -1346,6 +1357,7 @@ void EAGLE_PLUGIN::loadLayerDefs( CPTREE& aLayers ) // could map the colors here // could map the colors here } } } } } void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics ) void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics ) Loading Loading @@ -1625,7 +1637,9 @@ void EAGLE_PLUGIN::loadLibrary( CPTREE& aLib, const string* aLibName ) // add the templating MODULE to the MODULE template factory "m_templates" // add the templating MODULE to the MODULE template factory "m_templates" std::pair<MODULE_ITER, bool> r = m_templates.insert( key, m ); std::pair<MODULE_ITER, bool> r = m_templates.insert( key, m ); if( !r.second ) if( !r.second // && !( m_props && m_props->Value( "ignore_duplicates" ) ) ) { { wxString lib = aLibName ? FROM_UTF8( aLibName->c_str() ) : m_lib_path; wxString lib = aLibName ? FROM_UTF8( aLibName->c_str() ) : m_lib_path; wxString pkg = FROM_UTF8( pack_name.c_str() ); wxString pkg = FROM_UTF8( pack_name.c_str() ); Loading Loading @@ -2876,6 +2890,17 @@ MODULE* EAGLE_PLUGIN::FootprintLoad( const wxString& aLibraryPath, const wxStrin } } void EAGLE_PLUGIN::FootprintLibOptions( PROPERTIES* aListToAppendTo ) const { /* (*aListToAppendTo)["ignore_duplicates"] = wxString( _( "Ignore duplicately named footprints within the same Eagle library. " "Only the first similarly named footprint will be loaded." )).utf8_str(); */ } /* /* void EAGLE_PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties ) void EAGLE_PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties ) { { Loading
pcbnew/eagle_plugin.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -95,6 +95,8 @@ public: return false; // until someone writes others like FootprintSave(), etc. return false; // until someone writes others like FootprintSave(), etc. } } void FootprintLibOptions( PROPERTIES* aProperties ) const; /* /* void Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties = NULL ); void Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties = NULL ); Loading