Loading eeschema/class_library.cpp +4 −4 Original line number Original line Diff line number Diff line Loading @@ -860,13 +860,13 @@ CMP_LIBRARY* CMP_LIBRARY::FindLibrary( const wxString& aName ) wxArrayString CMP_LIBRARY::GetLibraryNames( bool aSorted ) wxArrayString CMP_LIBRARY::GetLibraryNames( bool aSorted ) { { wxString cacheName; wxArrayString cacheNames; wxArrayString names; wxArrayString names; BOOST_FOREACH( CMP_LIBRARY& lib, CMP_LIBRARY::libraryList ) BOOST_FOREACH( CMP_LIBRARY& lib, CMP_LIBRARY::libraryList ) { { if( lib.isCache && aSorted ) if( lib.isCache && aSorted ) cacheName = lib.GetName(); cacheNames.Add( lib.GetName() ); else else names.Add( lib.GetName() ); names.Add( lib.GetName() ); } } Loading @@ -875,8 +875,8 @@ wxArrayString CMP_LIBRARY::GetLibraryNames( bool aSorted ) if( aSorted ) if( aSorted ) names.Sort(); names.Sort(); if( !cacheName.IsEmpty() ) for( unsigned int i = 0; i<cacheNames.Count(); i++ ) names.Add( cacheName ); names.Add( cacheNames.Item( i ) ); return names; return names; } } Loading eeschema/files-io.cpp +154 −58 Original line number Original line Diff line number Diff line Loading @@ -3,6 +3,7 @@ * * * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2013 CERN (www.cern.ch) * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * * * This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or Loading Loading @@ -40,6 +41,7 @@ #include <class_library.h> #include <class_library.h> #include <libeditframe.h> #include <libeditframe.h> #include <sch_sheet.h> #include <sch_sheet.h> #include <sch_component.h> #include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h> Loading Loading @@ -175,6 +177,73 @@ void SCH_EDIT_FRAME::Save_File( wxCommandEvent& event ) } } bool SCH_EDIT_FRAME::LoadCacheLibrary( const wxString& aFilename ) { wxString msg; bool LibCacheExist = false; wxFileName fn = aFilename; /* Loading the project library cache * until apr 2009 the lib is named <root_name>.cache.lib * and after (due to code change): <root_name>-cache.lib * so if the <name>-cache.lib is not found, the old way will be tried */ bool use_oldcachename = false; wxString cachename = fn.GetName() + wxT( "-cache" ); fn.SetName( cachename ); fn.SetExt( SchematicLibraryFileExtension ); if( ! fn.FileExists() ) { fn = aFilename; fn.SetExt( wxT( "cache.lib" ) ); use_oldcachename = true; } if( fn.FileExists() ) { wxString errMsg; wxLogDebug( wxT( "Load schematic cache library file <%s>" ), GetChars( fn.GetFullPath() ) ); msg = wxT( "Load " ) + fn.GetFullPath(); CMP_LIBRARY* LibCache = CMP_LIBRARY::LoadLibrary( fn, errMsg ); if( LibCache ) { LibCache->SetCache(); msg += wxT( " OK" ); if ( use_oldcachename ) // set the new name { fn.SetName( cachename ); fn.SetExt( SchematicLibraryFileExtension ); LibCache->SetFileName( fn ); } LibCacheExist = true; CMP_LIBRARY::GetLibraryList().push_back( LibCache ); } else { wxString prompt; prompt.Printf( _( "Component library <%s> failed to load.\nError: %s" ), GetChars( fn.GetFullPath() ), GetChars( errMsg ) ); DisplayError( this, prompt ); msg += _( " ->Error" ); } PrintMsg( msg ); } return LibCacheExist; } bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew ) bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew ) { { SCH_SCREEN* screen; SCH_SCREEN* screen; Loading Loading @@ -280,87 +349,114 @@ bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew ) // Delete old caches. // Delete old caches. CMP_LIBRARY::RemoveCacheLibrary(); CMP_LIBRARY::RemoveCacheLibrary(); /* Loading the project library cache LibCacheExist = LoadCacheLibrary( g_RootSheet->GetScreen()->GetFileName() ); * until apr 2009 the lib is named <root_name>.cache.lib * and after (due to code change): <root_name>-cache.lib * so if the <name>-cache.lib is not found, the old way will be tried */ fn = g_RootSheet->GetScreen()->GetFileName(); bool use_oldcachename = false; wxString cachename = fn.GetName() + wxT( "-cache" ); fn.SetName( cachename ); if( !wxFileExists( g_RootSheet->GetScreen()->GetFileName() ) && !LibCacheExist ) fn.SetExt( SchematicLibraryFileExtension ); if( ! fn.FileExists() ) { { fn = g_RootSheet->GetScreen()->GetFileName(); Zoom_Automatique( false ); fn.SetExt( wxT( "cache.lib" ) ); msg.Printf( _( "File <%s> not found." ), use_oldcachename = true; GetChars( g_RootSheet->GetScreen()->GetFileName() ) ); DisplayInfoMessage( this, msg ); return false; } } if( fn.FileExists() ) // load the project. { g_RootSheet->SetScreen( NULL ); wxString errMsg; bool diag = g_RootSheet->Load( this ); SetScreen( m_CurrentSheet->LastScreen() ); wxLogDebug( wxT( "LoadOneEEProject() load schematic cache library file <%s>" ), UpdateFileHistory( g_RootSheet->GetScreen()->GetFileName() ); GetChars( fn.GetFullPath() ) ); msg = wxT( "Load " ) + fn.GetFullPath(); CMP_LIBRARY* LibCache = CMP_LIBRARY::LoadLibrary( fn, errMsg ); /* Redraw base screen (ROOT) if necessary. */ GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); Zoom_Automatique( false ); SetSheetNumberAndCount(); m_canvas->Refresh( true ); return diag; } if( LibCache ) bool SCH_EDIT_FRAME::AppendOneEEProject() { { LibCache->SetCache(); SCH_SCREEN* screen; msg += wxT( " OK" ); wxString FullFileName; wxString msg; if ( use_oldcachename ) // set the new name screen = GetScreen(); if( !screen ) { { fn.SetName( cachename ); wxLogError( wxT("Document not ready, cannot import") ); fn.SetExt( SchematicLibraryFileExtension ); return false; LibCache->SetFileName( fn ); } } LibCacheExist = true; // open file chooser dialog CMP_LIBRARY::GetLibraryList().push_back( LibCache ); wxFileDialog dlg( this, _( "Import Schematic" ), wxGetCwd(), } wxEmptyString, SchematicFileWildcard, else wxFD_OPEN | wxFD_FILE_MUST_EXIST ); { wxString prompt; prompt.Printf( _( "Component library <%s> failed to load.\nError: %s" ), if( dlg.ShowModal() == wxID_CANCEL ) GetChars( fn.GetFullPath() ), return false; GetChars( errMsg ) ); DisplayError( this, prompt ); msg += _( " ->Error" ); } PrintMsg( msg ); FullFileName = dlg.GetPath(); } if( !wxFileExists( g_RootSheet->GetScreen()->GetFileName() ) && !LibCacheExist ) wxFileName fn = FullFileName; if( fn.IsRelative() ) { { Zoom_Automatique( false ); fn.MakeAbsolute(); msg.Printf( _( "File <%s> not found." ), FullFileName = fn.GetFullPath(); GetChars( g_RootSheet->GetScreen()->GetFileName() ) ); DisplayInfoMessage( this, msg ); return false; } } // load the project. LoadCacheLibrary( FullFileName ); g_RootSheet->SetScreen( NULL ); bool diag = g_RootSheet->Load( this ); SetScreen( m_CurrentSheet->LastScreen() ); UpdateFileHistory( g_RootSheet->GetScreen()->GetFileName() ); wxLogDebug( wxT( "Importing schematic " ) + FullFileName ); /* Redraw base screen (ROOT) if necessary. */ // load the project bool success = LoadOneEEFile( screen, FullFileName, true ); if( success ) { // load sub-sheets EDA_ITEM* bs = screen->GetDrawItems(); while( bs ) { // do not append hierarchical sheets if( bs->Type() == SCH_SHEET_T ) { screen->Remove( (SCH_SHEET*) bs ); } // clear annotation and init new time stamp for the new components else if( bs->Type() == SCH_COMPONENT_T ) { ( (SCH_COMPONENT*) bs )->SetTimeStamp( GetNewTimeStamp() ); ( (SCH_COMPONENT*) bs )->ClearAnnotation( NULL ); // Clear flags, which are set by these previous modifications: bs->ClearFlags(); } bs = bs->Next(); } } // redraw base screen (ROOT) if necessary GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); Zoom_Automatique( false ); Zoom_Automatique( false ); SetSheetNumberAndCount(); SetSheetNumberAndCount(); m_canvas->Refresh( true ); m_canvas->Refresh( true ); return diag; return success; } void SCH_EDIT_FRAME::OnAppendProject( wxCommandEvent& event ) { wxString msg = _( "This operation cannot be undone. " "Besides, take into account that hierarchical sheets will not be appended.\n\n" "Do you want to save the current document before proceeding?" ); if( IsOK( this, msg ) ) OnSaveProject( event ); AppendOneEEProject(); } } Loading eeschema/load_one_schematic_file.cpp +3 −2 Original line number Original line Diff line number Diff line Loading @@ -53,7 +53,7 @@ bool ReadSchemaDescr( LINE_READER* aLine, wxString& aMsgDiag, SCH_SCREEN* Window static void LoadLayers( LINE_READER* aLine ); static void LoadLayers( LINE_READER* aLine ); bool SCH_EDIT_FRAME::LoadOneEEFile( SCH_SCREEN* aScreen, const wxString& aFullFileName ) bool SCH_EDIT_FRAME::LoadOneEEFile( SCH_SCREEN* aScreen, const wxString& aFullFileName, bool append ) { { char name1[256]; char name1[256]; bool itemLoaded = false; bool itemLoaded = false; Loading @@ -74,6 +74,7 @@ bool SCH_EDIT_FRAME::LoadOneEEFile( SCH_SCREEN* aScreen, const wxString& aFullFi wxLogTrace( traceAutoSave, wxT( "Loading schematic file " ) + aFullFileName ); wxLogTrace( traceAutoSave, wxT( "Loading schematic file " ) + aFullFileName ); aScreen->SetCurItem( NULL ); aScreen->SetCurItem( NULL ); if( !append ) aScreen->SetFileName( aFullFileName ); aScreen->SetFileName( aFullFileName ); FILE* f; FILE* f; Loading eeschema/menubar.cpp +6 −0 Original line number Original line Diff line number Diff line Loading @@ -97,6 +97,12 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() _( "Open a recent opened schematic project" ), _( "Open a recent opened schematic project" ), KiBitmap( open_project_xpm ) ); KiBitmap( open_project_xpm ) ); // Import AddMenuItem( fileMenu, ID_APPEND_PROJECT, _( "&Append Schematic" ), _( "Append another schematic project to the current loaded schematic" ), KiBitmap( open_document_xpm ) ); // Separator // Separator fileMenu->AppendSeparator(); fileMenu->AppendSeparator(); Loading eeschema/schframe.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -75,6 +75,8 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME ) EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, SCH_EDIT_FRAME::OnLoadFile ) EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, SCH_EDIT_FRAME::OnLoadFile ) EVT_MENU( ID_APPEND_PROJECT, SCH_EDIT_FRAME::OnAppendProject ) EVT_TOOL( ID_NEW_PROJECT, SCH_EDIT_FRAME::OnNewProject ) EVT_TOOL( ID_NEW_PROJECT, SCH_EDIT_FRAME::OnNewProject ) EVT_TOOL( ID_LOAD_PROJECT, SCH_EDIT_FRAME::OnLoadProject ) EVT_TOOL( ID_LOAD_PROJECT, SCH_EDIT_FRAME::OnLoadProject ) Loading Loading @@ -512,7 +514,8 @@ double SCH_EDIT_FRAME::BestZoom() wxString SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet() wxString SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet() { { wxFileName fn = g_RootSheet->GetFileName(); SCH_SCREENS ScreenList; wxFileName fn = ScreenList.GetFirst()->GetFileName(); #ifndef KICAD_GOST #ifndef KICAD_GOST wxString filename = fn.GetName(); wxString filename = fn.GetName(); Loading Loading
eeschema/class_library.cpp +4 −4 Original line number Original line Diff line number Diff line Loading @@ -860,13 +860,13 @@ CMP_LIBRARY* CMP_LIBRARY::FindLibrary( const wxString& aName ) wxArrayString CMP_LIBRARY::GetLibraryNames( bool aSorted ) wxArrayString CMP_LIBRARY::GetLibraryNames( bool aSorted ) { { wxString cacheName; wxArrayString cacheNames; wxArrayString names; wxArrayString names; BOOST_FOREACH( CMP_LIBRARY& lib, CMP_LIBRARY::libraryList ) BOOST_FOREACH( CMP_LIBRARY& lib, CMP_LIBRARY::libraryList ) { { if( lib.isCache && aSorted ) if( lib.isCache && aSorted ) cacheName = lib.GetName(); cacheNames.Add( lib.GetName() ); else else names.Add( lib.GetName() ); names.Add( lib.GetName() ); } } Loading @@ -875,8 +875,8 @@ wxArrayString CMP_LIBRARY::GetLibraryNames( bool aSorted ) if( aSorted ) if( aSorted ) names.Sort(); names.Sort(); if( !cacheName.IsEmpty() ) for( unsigned int i = 0; i<cacheNames.Count(); i++ ) names.Add( cacheName ); names.Add( cacheNames.Item( i ) ); return names; return names; } } Loading
eeschema/files-io.cpp +154 −58 Original line number Original line Diff line number Diff line Loading @@ -3,6 +3,7 @@ * * * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2013 CERN (www.cern.ch) * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * * * This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or Loading Loading @@ -40,6 +41,7 @@ #include <class_library.h> #include <class_library.h> #include <libeditframe.h> #include <libeditframe.h> #include <sch_sheet.h> #include <sch_sheet.h> #include <sch_component.h> #include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h> Loading Loading @@ -175,6 +177,73 @@ void SCH_EDIT_FRAME::Save_File( wxCommandEvent& event ) } } bool SCH_EDIT_FRAME::LoadCacheLibrary( const wxString& aFilename ) { wxString msg; bool LibCacheExist = false; wxFileName fn = aFilename; /* Loading the project library cache * until apr 2009 the lib is named <root_name>.cache.lib * and after (due to code change): <root_name>-cache.lib * so if the <name>-cache.lib is not found, the old way will be tried */ bool use_oldcachename = false; wxString cachename = fn.GetName() + wxT( "-cache" ); fn.SetName( cachename ); fn.SetExt( SchematicLibraryFileExtension ); if( ! fn.FileExists() ) { fn = aFilename; fn.SetExt( wxT( "cache.lib" ) ); use_oldcachename = true; } if( fn.FileExists() ) { wxString errMsg; wxLogDebug( wxT( "Load schematic cache library file <%s>" ), GetChars( fn.GetFullPath() ) ); msg = wxT( "Load " ) + fn.GetFullPath(); CMP_LIBRARY* LibCache = CMP_LIBRARY::LoadLibrary( fn, errMsg ); if( LibCache ) { LibCache->SetCache(); msg += wxT( " OK" ); if ( use_oldcachename ) // set the new name { fn.SetName( cachename ); fn.SetExt( SchematicLibraryFileExtension ); LibCache->SetFileName( fn ); } LibCacheExist = true; CMP_LIBRARY::GetLibraryList().push_back( LibCache ); } else { wxString prompt; prompt.Printf( _( "Component library <%s> failed to load.\nError: %s" ), GetChars( fn.GetFullPath() ), GetChars( errMsg ) ); DisplayError( this, prompt ); msg += _( " ->Error" ); } PrintMsg( msg ); } return LibCacheExist; } bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew ) bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew ) { { SCH_SCREEN* screen; SCH_SCREEN* screen; Loading Loading @@ -280,87 +349,114 @@ bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew ) // Delete old caches. // Delete old caches. CMP_LIBRARY::RemoveCacheLibrary(); CMP_LIBRARY::RemoveCacheLibrary(); /* Loading the project library cache LibCacheExist = LoadCacheLibrary( g_RootSheet->GetScreen()->GetFileName() ); * until apr 2009 the lib is named <root_name>.cache.lib * and after (due to code change): <root_name>-cache.lib * so if the <name>-cache.lib is not found, the old way will be tried */ fn = g_RootSheet->GetScreen()->GetFileName(); bool use_oldcachename = false; wxString cachename = fn.GetName() + wxT( "-cache" ); fn.SetName( cachename ); if( !wxFileExists( g_RootSheet->GetScreen()->GetFileName() ) && !LibCacheExist ) fn.SetExt( SchematicLibraryFileExtension ); if( ! fn.FileExists() ) { { fn = g_RootSheet->GetScreen()->GetFileName(); Zoom_Automatique( false ); fn.SetExt( wxT( "cache.lib" ) ); msg.Printf( _( "File <%s> not found." ), use_oldcachename = true; GetChars( g_RootSheet->GetScreen()->GetFileName() ) ); DisplayInfoMessage( this, msg ); return false; } } if( fn.FileExists() ) // load the project. { g_RootSheet->SetScreen( NULL ); wxString errMsg; bool diag = g_RootSheet->Load( this ); SetScreen( m_CurrentSheet->LastScreen() ); wxLogDebug( wxT( "LoadOneEEProject() load schematic cache library file <%s>" ), UpdateFileHistory( g_RootSheet->GetScreen()->GetFileName() ); GetChars( fn.GetFullPath() ) ); msg = wxT( "Load " ) + fn.GetFullPath(); CMP_LIBRARY* LibCache = CMP_LIBRARY::LoadLibrary( fn, errMsg ); /* Redraw base screen (ROOT) if necessary. */ GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); Zoom_Automatique( false ); SetSheetNumberAndCount(); m_canvas->Refresh( true ); return diag; } if( LibCache ) bool SCH_EDIT_FRAME::AppendOneEEProject() { { LibCache->SetCache(); SCH_SCREEN* screen; msg += wxT( " OK" ); wxString FullFileName; wxString msg; if ( use_oldcachename ) // set the new name screen = GetScreen(); if( !screen ) { { fn.SetName( cachename ); wxLogError( wxT("Document not ready, cannot import") ); fn.SetExt( SchematicLibraryFileExtension ); return false; LibCache->SetFileName( fn ); } } LibCacheExist = true; // open file chooser dialog CMP_LIBRARY::GetLibraryList().push_back( LibCache ); wxFileDialog dlg( this, _( "Import Schematic" ), wxGetCwd(), } wxEmptyString, SchematicFileWildcard, else wxFD_OPEN | wxFD_FILE_MUST_EXIST ); { wxString prompt; prompt.Printf( _( "Component library <%s> failed to load.\nError: %s" ), if( dlg.ShowModal() == wxID_CANCEL ) GetChars( fn.GetFullPath() ), return false; GetChars( errMsg ) ); DisplayError( this, prompt ); msg += _( " ->Error" ); } PrintMsg( msg ); FullFileName = dlg.GetPath(); } if( !wxFileExists( g_RootSheet->GetScreen()->GetFileName() ) && !LibCacheExist ) wxFileName fn = FullFileName; if( fn.IsRelative() ) { { Zoom_Automatique( false ); fn.MakeAbsolute(); msg.Printf( _( "File <%s> not found." ), FullFileName = fn.GetFullPath(); GetChars( g_RootSheet->GetScreen()->GetFileName() ) ); DisplayInfoMessage( this, msg ); return false; } } // load the project. LoadCacheLibrary( FullFileName ); g_RootSheet->SetScreen( NULL ); bool diag = g_RootSheet->Load( this ); SetScreen( m_CurrentSheet->LastScreen() ); UpdateFileHistory( g_RootSheet->GetScreen()->GetFileName() ); wxLogDebug( wxT( "Importing schematic " ) + FullFileName ); /* Redraw base screen (ROOT) if necessary. */ // load the project bool success = LoadOneEEFile( screen, FullFileName, true ); if( success ) { // load sub-sheets EDA_ITEM* bs = screen->GetDrawItems(); while( bs ) { // do not append hierarchical sheets if( bs->Type() == SCH_SHEET_T ) { screen->Remove( (SCH_SHEET*) bs ); } // clear annotation and init new time stamp for the new components else if( bs->Type() == SCH_COMPONENT_T ) { ( (SCH_COMPONENT*) bs )->SetTimeStamp( GetNewTimeStamp() ); ( (SCH_COMPONENT*) bs )->ClearAnnotation( NULL ); // Clear flags, which are set by these previous modifications: bs->ClearFlags(); } bs = bs->Next(); } } // redraw base screen (ROOT) if necessary GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); Zoom_Automatique( false ); Zoom_Automatique( false ); SetSheetNumberAndCount(); SetSheetNumberAndCount(); m_canvas->Refresh( true ); m_canvas->Refresh( true ); return diag; return success; } void SCH_EDIT_FRAME::OnAppendProject( wxCommandEvent& event ) { wxString msg = _( "This operation cannot be undone. " "Besides, take into account that hierarchical sheets will not be appended.\n\n" "Do you want to save the current document before proceeding?" ); if( IsOK( this, msg ) ) OnSaveProject( event ); AppendOneEEProject(); } } Loading
eeschema/load_one_schematic_file.cpp +3 −2 Original line number Original line Diff line number Diff line Loading @@ -53,7 +53,7 @@ bool ReadSchemaDescr( LINE_READER* aLine, wxString& aMsgDiag, SCH_SCREEN* Window static void LoadLayers( LINE_READER* aLine ); static void LoadLayers( LINE_READER* aLine ); bool SCH_EDIT_FRAME::LoadOneEEFile( SCH_SCREEN* aScreen, const wxString& aFullFileName ) bool SCH_EDIT_FRAME::LoadOneEEFile( SCH_SCREEN* aScreen, const wxString& aFullFileName, bool append ) { { char name1[256]; char name1[256]; bool itemLoaded = false; bool itemLoaded = false; Loading @@ -74,6 +74,7 @@ bool SCH_EDIT_FRAME::LoadOneEEFile( SCH_SCREEN* aScreen, const wxString& aFullFi wxLogTrace( traceAutoSave, wxT( "Loading schematic file " ) + aFullFileName ); wxLogTrace( traceAutoSave, wxT( "Loading schematic file " ) + aFullFileName ); aScreen->SetCurItem( NULL ); aScreen->SetCurItem( NULL ); if( !append ) aScreen->SetFileName( aFullFileName ); aScreen->SetFileName( aFullFileName ); FILE* f; FILE* f; Loading
eeschema/menubar.cpp +6 −0 Original line number Original line Diff line number Diff line Loading @@ -97,6 +97,12 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() _( "Open a recent opened schematic project" ), _( "Open a recent opened schematic project" ), KiBitmap( open_project_xpm ) ); KiBitmap( open_project_xpm ) ); // Import AddMenuItem( fileMenu, ID_APPEND_PROJECT, _( "&Append Schematic" ), _( "Append another schematic project to the current loaded schematic" ), KiBitmap( open_document_xpm ) ); // Separator // Separator fileMenu->AppendSeparator(); fileMenu->AppendSeparator(); Loading
eeschema/schframe.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -75,6 +75,8 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME ) EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, SCH_EDIT_FRAME::OnLoadFile ) EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, SCH_EDIT_FRAME::OnLoadFile ) EVT_MENU( ID_APPEND_PROJECT, SCH_EDIT_FRAME::OnAppendProject ) EVT_TOOL( ID_NEW_PROJECT, SCH_EDIT_FRAME::OnNewProject ) EVT_TOOL( ID_NEW_PROJECT, SCH_EDIT_FRAME::OnNewProject ) EVT_TOOL( ID_LOAD_PROJECT, SCH_EDIT_FRAME::OnLoadProject ) EVT_TOOL( ID_LOAD_PROJECT, SCH_EDIT_FRAME::OnLoadProject ) Loading Loading @@ -512,7 +514,8 @@ double SCH_EDIT_FRAME::BestZoom() wxString SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet() wxString SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet() { { wxFileName fn = g_RootSheet->GetFileName(); SCH_SCREENS ScreenList; wxFileName fn = ScreenList.GetFirst()->GetFileName(); #ifndef KICAD_GOST #ifndef KICAD_GOST wxString filename = fn.GetName(); wxString filename = fn.GetName(); Loading