Eesschema, dialog rescue: enhancements:

- Slightly change the info text in the dialog. Add a definition of  exactly what it means to "rescue" a component.
- Reload the project libraries when a project is opened, even if kicad  is already running and the same project is open (to be sure the lib cache is up to date).
- Set the Modified flag on cancel, because a change has indeed been  made (choosing not to rescue is equivalent to updating the components)
This commit is contained in:
unknown 2015-06-29 18:31:00 +02:00 committed by jean-pierre charras
parent 3adf12344a
commit 15cc245a83
3 changed files with 10 additions and 4 deletions

View File

@ -84,8 +84,9 @@ DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH( SCH_EDIT_FRAME* aParent, RESCUER& aRescu
wxString info_message = wxString info_message =
_( "It looks like this project was made using older schematic component libraries.\n" _( "It looks like this project was made using older schematic component libraries.\n"
"Some parts may need to be relinked to a different symbol name, and some symbols\n" "Some parts may need to be relinked to a different symbol name, and some symbols\n"
"may need to be \"rescued\" into a new library.\n" "may need to be \"rescued\" (cloned and renamed) into a new library.\n"
"The following changes are recommended to update the project.\n" ); "\n"
"The following changes are recommended to update the project." );
m_lblInfo->SetLabel( info_message ); m_lblInfo->SetLabel( info_message );
} }

View File

@ -4,7 +4,7 @@
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2013 CERN (www.cern.ch) * Copyright (C) 2013 CERN (www.cern.ch)
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2015 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
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -285,6 +285,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
// event handler in there. // event handler in there.
// And when a schematic file is loaded, we need these libs to initialize // And when a schematic file is loaded, we need these libs to initialize
// some parameters (links to PART LIB, dangling ends ...) // some parameters (links to PART LIB, dangling ends ...)
Prj().SetElem( PROJECT::ELEM_SCH_PART_LIBS, NULL );
Prj().SchLibs(); Prj().SchLibs();
if( is_new ) if( is_new )

View File

@ -330,7 +330,7 @@ public:
wxString part_name( each_component->GetPartName() ); wxString part_name( each_component->GetPartName() );
LIB_PART* cache_match = find_component( part_name, aRescuer.GetLibs(), /* aCached */ true ); LIB_PART* cache_match = find_component( part_name, aRescuer.GetLibs(), /* aCached */ true );
LIB_PART* lib_match = find_component( part_name, aRescuer.GetLibs(), /* aCached */ false ); LIB_PART* lib_match = aRescuer.GetLibs()->FindLibPart( part_name );
// Test whether there is a conflict // Test whether there is a conflict
if( !cache_match || !lib_match ) if( !cache_match || !lib_match )
@ -515,6 +515,10 @@ bool SCH_EDIT_FRAME::RescueProject( bool aRunningOnDemand )
{ {
wxMessageDialog dlg( this, _( "No symbols were rescued." ) ); wxMessageDialog dlg( this, _( "No symbols were rescued." ) );
dlg.ShowModal(); dlg.ShowModal();
// Set the modified flag even on Cancel. Many users seem to instinctively want to Save at
// this point, due to the reloading of the symbols, so we'll make the save button active.
OnModify();
return true; return true;
} }