Commit 22645084 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: fix bug1082146 (Keep-out areas get destroyed by "export settings to other zones" )

Eeschema: fix bug 1082107 (error message" component not found" when no component selected from select component dialog box)
parent eb3ba806
...@@ -121,7 +121,7 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const wxString& aLibname, ...@@ -121,7 +121,7 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const wxString& aLibname,
DIALOG_GET_COMPONENT dlg( this, GetComponentDialogPosition(), aHistoryList, DIALOG_GET_COMPONENT dlg( this, GetComponentDialogPosition(), aHistoryList,
msg, aUseLibBrowser ); msg, aUseLibBrowser );
if( aHistoryList.GetCount() ) if( aHistoryList.GetCount() )
dlg.SetComponentName( aHistoryList[0] ); dlg.SetComponentName( aHistoryList[0] );
if ( dlg.ShowModal() == wxID_CANCEL ) if ( dlg.ShowModal() == wxID_CANCEL )
...@@ -144,6 +144,9 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const wxString& aLibname, ...@@ -144,6 +144,9 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const wxString& aLibname,
if( cmpName.IsEmpty() ) if( cmpName.IsEmpty() )
return wxEmptyString; return wxEmptyString;
// Here, cmpName contains the component name,
// or "*" if the Select All dialog button was pressed
#ifndef KICAD_KEEPCASE #ifndef KICAD_KEEPCASE
cmpName.MakeUpper(); cmpName.MakeUpper();
#endif #endif
...@@ -175,7 +178,7 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const wxString& aLibname, ...@@ -175,7 +178,7 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const wxString& aLibname,
libEntry = CMP_LIBRARY::FindLibraryComponent( cmpName, aLibname ); libEntry = CMP_LIBRARY::FindLibraryComponent( cmpName, aLibname );
if( ( libEntry == NULL ) && allowWildSeach ) /* Search with wildcard */ if( ( libEntry == NULL ) && allowWildSeach ) // Search with wildcard
{ {
allowWildSeach = false; allowWildSeach = false;
wxString wildname = wxChar( '*' ) + cmpName + wxChar( '*' ); wxString wildname = wxChar( '*' ) + cmpName + wxChar( '*' );
...@@ -191,7 +194,7 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const wxString& aLibname, ...@@ -191,7 +194,7 @@ wxString SCH_BASE_FRAME::SelectComponentFromLibrary( const wxString& aLibname,
if( libEntry == NULL ) if( libEntry == NULL )
{ {
msg = _( "Failed to find part " ) + cmpName + _( " in library" ); msg.Printf( _( "Failed to find part <%s> in library" ), GetChars( cmpName ) );
DisplayError( this, msg ); DisplayError( this, msg );
return wxEmptyString; return wxEmptyString;
} }
......
...@@ -79,7 +79,7 @@ int GetNameOfPartToLoad( EDA_DRAW_FRAME* frame, CMP_LIBRARY* Library, wxString& ...@@ -79,7 +79,7 @@ int GetNameOfPartToLoad( EDA_DRAW_FRAME* frame, CMP_LIBRARY* Library, wxString&
static wxString OldCmpName; static wxString OldCmpName;
ii = DisplayComponentsNamesInLib( frame, Library, BufName, OldCmpName ); ii = DisplayComponentsNamesInLib( frame, Library, BufName, OldCmpName );
if( ii <= 0 ) if( ii <= 0 || BufName.IsEmpty() )
return 0; return 0;
OldCmpName = BufName; OldCmpName = BufName;
......
...@@ -641,6 +641,8 @@ void ZONE_CONTAINER::DisplayInfo( EDA_DRAW_FRAME* frame ) ...@@ -641,6 +641,8 @@ void ZONE_CONTAINER::DisplayInfo( EDA_DRAW_FRAME* frame )
msg = _( "Zone Outline" ); msg = _( "Zone Outline" );
// Display Cutout instead of Outline for holes inside a zone
// i.e. when num contour !=0
int ncont = m_Poly->GetContour( m_CornerSelection ); int ncont = m_Poly->GetContour( m_CornerSelection );
if( ncont ) if( ncont )
...@@ -648,7 +650,27 @@ void ZONE_CONTAINER::DisplayInfo( EDA_DRAW_FRAME* frame ) ...@@ -648,7 +650,27 @@ void ZONE_CONTAINER::DisplayInfo( EDA_DRAW_FRAME* frame )
frame->AppendMsgPanel( _( "Type" ), msg, DARKCYAN ); frame->AppendMsgPanel( _( "Type" ), msg, DARKCYAN );
if( IsOnCopperLayer() ) if( GetIsKeepout() )
{
msg.Empty();
if( GetDoNotAllowVias() )
msg = _("No via");
if( GetDoNotAllowTracks() )
{
if( !msg.IsEmpty() )
msg += wxT(", ");
msg += _("No track");
}
if( GetDoNotAllowCopperPour() )
{
if( !msg.IsEmpty() )
msg += wxT(", ");
msg += _("No copper pour");
}
frame->AppendMsgPanel( _( "Keepout" ), msg, RED );
}
else if( IsOnCopperLayer() )
{ {
if( GetNet() >= 0 ) if( GetNet() >= 0 )
{ {
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <zones.h> #include <zones.h>
#include <base_units.h> #include <base_units.h>
#include <class_zone_settings.h> #include <class_zone.h>
#include <class_board.h> #include <class_board.h>
#include <dialog_copper_zones_base.h> #include <dialog_copper_zones_base.h>
...@@ -545,11 +545,16 @@ void DIALOG_COPPER_ZONE::ExportSetupToOtherCopperZones( wxCommandEvent& event ) ...@@ -545,11 +545,16 @@ void DIALOG_COPPER_ZONE::ExportSetupToOtherCopperZones( wxCommandEvent& event )
if( !AcceptOptions( true, true ) ) if( !AcceptOptions( true, true ) )
return; return;
// Export settings ( but layer and netcode ) to others zones: // Export settings ( but layer and netcode ) to others copper zones
BOARD* pcb = m_Parent->GetBoard(); BOARD* pcb = m_Parent->GetBoard();
for( int ii = 0; ii < pcb->GetAreaCount(); ii++ ) for( int ii = 0; ii < pcb->GetAreaCount(); ii++ )
{ {
ZONE_CONTAINER* zone = pcb->GetArea( ii ); ZONE_CONTAINER* zone = pcb->GetArea( ii );
// Cannot export settings from a copper zone
// to a zone keepout:
if( zone->GetIsKeepout() )
continue;
m_settings.ExportSetting( *zone, false ); // false = partial export m_settings.ExportSetting( *zone, false ); // false = partial export
m_Parent->OnModify(); m_Parent->OnModify();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment