Loading eeschema/files-io.cpp +11 −7 Original line number Original line Diff line number Diff line Loading @@ -368,20 +368,24 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in // Delete old caches. // Delete old caches. CMP_LIBRARY::RemoveCacheLibrary(); CMP_LIBRARY::RemoveCacheLibrary(); libCacheExist = LoadCacheLibrary( g_RootSheet->GetScreen()->GetFileName() ); if( !wxFileExists( g_RootSheet->GetScreen()->GetFileName() ) ) if( !wxFileExists( g_RootSheet->GetScreen()->GetFileName() ) && !libCacheExist ) { { Zoom_Automatique( false ); Zoom_Automatique( false ); if( aCtl == 0 ) { msg.Printf( _( "File '%s' not found." ), msg.Printf( _( "File '%s' not found." ), GetChars( g_RootSheet->GetScreen()->GetFileName() ) ); GetChars( g_RootSheet->GetScreen()->GetFileName() ) ); DisplayInfoMessage( this, msg ); DisplayInfoMessage( this, msg ); // return false; return false; } return true; // do not close Eeschema if the file if not found: return true; // do not close Eeschema if the file if not found: // we may have to create a new schematic file. // we may have to create a new schematic file. } } // load the project. // load the project. libCacheExist = LoadCacheLibrary( g_RootSheet->GetScreen()->GetFileName() ); g_RootSheet->SetScreen( NULL ); g_RootSheet->SetScreen( NULL ); bool diag = g_RootSheet->Load( this ); bool diag = g_RootSheet->Load( this ); SetScreen( m_CurrentSheet->LastScreen() ); SetScreen( m_CurrentSheet->LastScreen() ); Loading eeschema/schframe.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -730,13 +730,13 @@ void SCH_EDIT_FRAME::OnLoadCmpToFootprintLinkFile( wxCommandEvent& event ) void SCH_EDIT_FRAME::OnNewProject( wxCommandEvent& event ) void SCH_EDIT_FRAME::OnNewProject( wxCommandEvent& event ) { { wxFileDialog dlg( this, _( "Open Schematic" ), wxGetCwd(), wxFileDialog dlg( this, _( "New Schematic" ), wxGetCwd(), wxEmptyString, SchematicFileWildcard, wxEmptyString, SchematicFileWildcard, wxFD_OPEN | wxFD_FILE_MUST_EXIST ); wxFD_SAVE ); if( dlg.ShowModal() != wxID_CANCEL ) if( dlg.ShowModal() != wxID_CANCEL ) { { OpenProjectFiles( std::vector<wxString>( 1, dlg.GetPath() ) ); OpenProjectFiles( std::vector<wxString>( 1, dlg.GetPath() ), 1 ); } } } } Loading Loading
eeschema/files-io.cpp +11 −7 Original line number Original line Diff line number Diff line Loading @@ -368,20 +368,24 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in // Delete old caches. // Delete old caches. CMP_LIBRARY::RemoveCacheLibrary(); CMP_LIBRARY::RemoveCacheLibrary(); libCacheExist = LoadCacheLibrary( g_RootSheet->GetScreen()->GetFileName() ); if( !wxFileExists( g_RootSheet->GetScreen()->GetFileName() ) ) if( !wxFileExists( g_RootSheet->GetScreen()->GetFileName() ) && !libCacheExist ) { { Zoom_Automatique( false ); Zoom_Automatique( false ); if( aCtl == 0 ) { msg.Printf( _( "File '%s' not found." ), msg.Printf( _( "File '%s' not found." ), GetChars( g_RootSheet->GetScreen()->GetFileName() ) ); GetChars( g_RootSheet->GetScreen()->GetFileName() ) ); DisplayInfoMessage( this, msg ); DisplayInfoMessage( this, msg ); // return false; return false; } return true; // do not close Eeschema if the file if not found: return true; // do not close Eeschema if the file if not found: // we may have to create a new schematic file. // we may have to create a new schematic file. } } // load the project. // load the project. libCacheExist = LoadCacheLibrary( g_RootSheet->GetScreen()->GetFileName() ); g_RootSheet->SetScreen( NULL ); g_RootSheet->SetScreen( NULL ); bool diag = g_RootSheet->Load( this ); bool diag = g_RootSheet->Load( this ); SetScreen( m_CurrentSheet->LastScreen() ); SetScreen( m_CurrentSheet->LastScreen() ); Loading
eeschema/schframe.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -730,13 +730,13 @@ void SCH_EDIT_FRAME::OnLoadCmpToFootprintLinkFile( wxCommandEvent& event ) void SCH_EDIT_FRAME::OnNewProject( wxCommandEvent& event ) void SCH_EDIT_FRAME::OnNewProject( wxCommandEvent& event ) { { wxFileDialog dlg( this, _( "Open Schematic" ), wxGetCwd(), wxFileDialog dlg( this, _( "New Schematic" ), wxGetCwd(), wxEmptyString, SchematicFileWildcard, wxEmptyString, SchematicFileWildcard, wxFD_OPEN | wxFD_FILE_MUST_EXIST ); wxFD_SAVE ); if( dlg.ShowModal() != wxID_CANCEL ) if( dlg.ShowModal() != wxID_CANCEL ) { { OpenProjectFiles( std::vector<wxString>( 1, dlg.GetPath() ) ); OpenProjectFiles( std::vector<wxString>( 1, dlg.GetPath() ), 1 ); } } } } Loading