Browse Source

Revert modifications to SCH_EDIT_FRAME::OpenProjectFiles()

pull/5/merge
Maciej Suminski 8 years ago
parent
commit
6b44d12bd8
  1. 2
      common/wildcards_and_files_ext.cpp
  2. 16
      eeschema/files-io.cpp

2
common/wildcards_and_files_ext.cpp

@ -71,7 +71,7 @@ const wxString GedaPcbFootprintLibFileExtension( wxT( "fp" ) );
const wxString SchematicSymbolFileWildcard( _( "KiCad drawing symbol file (*.sym)|*.sym" ) );
const wxString SchematicLibraryFileWildcard( _( "KiCad component library file (*.lib)|*.lib" ) );
const wxString ProjectFileWildcard( _( "KiCad project files (*.pro)|*.pro" ) );
const wxString SchematicFileWildcard( _( "KiCad schematic files (*.sch)|*.sch|Eagle 6.x XML schematic file (*.sch)|*.sch" ) );
const wxString SchematicFileWildcard( _( "KiCad schematic files (*.sch)|*.sch" ) );
const wxString EagleSchematicFileWildcard( _( "Eagle XML schematic file (*.sch)|*.sch" ) );
const wxString EagleFilesWildcard( _( "Eagle XML files (*.sch *.brd)|*.sch;*.brd" ) );
const wxString NetlistFileWildcard( _( "KiCad netlist files (*.net)|*.net" ) );

16
eeschema/files-io.cpp

@ -315,24 +315,10 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
{
delete g_RootSheet; // Delete the current project.
g_RootSheet = NULL; // Force CreateScreens() to build new empty project on load failure.
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi;
// Iterate through the available plugins to determine the file type
for( auto pluginType : SCH_IO_MGR::SCH_FILE_T_vector )
{
pi.set( SCH_IO_MGR::FindPlugin( pluginType ) );
if( pi && pi->CheckHeader( fullFileName ) )
break; // got the right plugin
else
pi.set( nullptr ); // do not give a false impression that we have a valid plugin
}
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_LEGACY ) );
try
{
if( !pi )
THROW_IO_ERROR( _( "File format not recognized" ) );
g_RootSheet = pi->Load( fullFileName, &Kiway() );
m_CurrentSheet->clear();
m_CurrentSheet->push_back( g_RootSheet );

Loading…
Cancel
Save