Don't nag user about changes they made in a text editor.

Fixes: lp:1806748
* https://bugs.launchpad.net/kicad/+bug/1806748
This commit is contained in:
Jeff Young 2018-12-04 22:15:14 +00:00
parent da40def69d
commit 4f5771f79f
1 changed files with 11 additions and 3 deletions

View File

@ -106,7 +106,15 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES( PCB_BASE_EDIT_FR
// Configure the layers list selector // Configure the layers list selector
if( m_moduleItem ) if( m_moduleItem )
m_LayerSelectionCtrl->SetNotAllowedLayerSet( LSET::ForbiddenFootprintLayers() ); {
LSET forbiddenLayers = LSET::ForbiddenFootprintLayers();
// If someone went to the trouble of setting the layer in a text editor, then there's
// very little sense in nagging them about it.
forbiddenLayers.set( m_item->GetLayer(), false );
m_LayerSelectionCtrl->SetNotAllowedLayerSet( forbiddenLayers );
}
m_LayerSelectionCtrl->SetLayersHotkeys( false ); m_LayerSelectionCtrl->SetLayersHotkeys( false );
m_LayerSelectionCtrl->SetBoardFrame( m_parent ); m_LayerSelectionCtrl->SetBoardFrame( m_parent );
@ -206,9 +214,9 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow()
if( m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() ) < 0 ) if( m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() ) < 0 )
{ {
wxMessageBox( _( "This item was on a forbidden or non-existing layer.\n" wxMessageBox( _( "This item was on a non-existing layer.\n"
"It has been moved to the first allowed layer." ) ); "It has been moved to the first allowed layer." ) );
m_LayerSelectionCtrl->SetSelection( F_SilkS ); m_LayerSelectionCtrl->SetSelection( 0 );
} }
return DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::TransferDataToWindow(); return DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::TransferDataToWindow();