Fixed loading layer visibility setting for printouts

This commit is contained in:
Maciej Suminski 2018-10-07 00:37:24 +02:00
parent 90b6156448
commit 3d15092643
3 changed files with 10 additions and 11 deletions

View File

@ -44,7 +44,7 @@ void BOARD_PRINTOUT_SETTINGS::Load( wxConfigBase* aConfig )
{ {
PRINTOUT_SETTINGS::Load( aConfig ); PRINTOUT_SETTINGS::Load( aConfig );
for( unsigned layer = 0; layer < m_layerSet.count(); ++layer ) for( unsigned layer = 0; layer < m_layerSet.size(); ++layer )
{ {
int tmp; int tmp;
wxString key = wxString::Format( OPTKEY_LAYERBASE, layer ); wxString key = wxString::Format( OPTKEY_LAYERBASE, layer );
@ -58,7 +58,7 @@ void BOARD_PRINTOUT_SETTINGS::Save( wxConfigBase* aConfig )
{ {
PRINTOUT_SETTINGS::Save( aConfig ); PRINTOUT_SETTINGS::Save( aConfig );
for( unsigned layer = 0; layer < m_layerSet.count(); ++layer ) for( unsigned layer = 0; layer < m_layerSet.size(); ++layer )
{ {
wxString key = wxString::Format( OPTKEY_LAYERBASE, layer ); wxString key = wxString::Format( OPTKEY_LAYERBASE, layer );
aConfig->Write( key, m_layerSet.test( layer ) ); aConfig->Write( key, m_layerSet.test( layer ) );

View File

@ -116,9 +116,8 @@ private:
DIALOG_PRINT_GERBVIEW::DIALOG_PRINT_GERBVIEW( GERBVIEW_FRAME* aParent, BOARD_PRINTOUT_SETTINGS* aSettings ) : DIALOG_PRINT_GERBVIEW::DIALOG_PRINT_GERBVIEW( GERBVIEW_FRAME* aParent, BOARD_PRINTOUT_SETTINGS* aSettings ) :
DIALOG_PRINT_GENERIC( aParent, aSettings ) DIALOG_PRINT_GENERIC( aParent, aSettings ), m_parent( aParent )
{ {
m_parent = aParent;
m_config = Kiface().KifaceSettings(); m_config = Kiface().KifaceSettings();
// Line width settings range // Line width settings range
@ -135,9 +134,6 @@ bool DIALOG_PRINT_GERBVIEW::TransferDataToWindow()
if( !DIALOG_PRINT_GENERIC::TransferDataToWindow() ) if( !DIALOG_PRINT_GENERIC::TransferDataToWindow() )
return false; return false;
if( m_config )
settings()->Load( m_config );
GERBER_FILE_IMAGE_LIST* images = m_parent->GetGerberLayout()->GetImagesList(); GERBER_FILE_IMAGE_LIST* images = m_parent->GetGerberLayout()->GetImagesList();
int itemIdx = 0; int itemIdx = 0;
@ -159,9 +155,15 @@ bool DIALOG_PRINT_GERBVIEW::TransferDataToWindow()
continue; continue;
wxFileName filename( gbrImage->m_FileName ); wxFileName filename( gbrImage->m_FileName );
m_layerLists[listIdx]->Append( filename.GetFullName() ); wxCheckListBox* listBox = m_layerLists[listIdx];
listBox->Append( filename.GetFullName() );
if( settings()->m_layerSet.test(ii) )
listBox->Check( ii, true );
wxASSERT( m_layerToItemMap.count( ii ) == 0 ); wxASSERT( m_layerToItemMap.count( ii ) == 0 );
m_layerToItemMap[ii] = itemIdx; m_layerToItemMap[ii] = itemIdx;
++itemIdx; ++itemIdx;
} }

View File

@ -120,9 +120,6 @@ bool DIALOG_PRINT_PCBNEW::TransferDataToWindow()
if( !DIALOG_PRINT_GENERIC::TransferDataToWindow() ) if( !DIALOG_PRINT_GENERIC::TransferDataToWindow() )
return false; return false;
if( m_config )
settings()->Load( m_config );
BOARD* board = m_parent->GetBoard(); BOARD* board = m_parent->GetBoard();
// Create layer list // Create layer list