Fix bug: pcbnew: in Plot dialog, layer list gets duplicate after calling the drill dialog.
Fixes: lp:1703355 https://bugs.launchpad.net/kicad/+bug/1703355
This commit is contained in:
parent
a3fc0ef658
commit
2a301d5883
|
@ -46,14 +46,14 @@ DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* aParent ) :
|
|||
{
|
||||
m_config = Kiface().KifaceSettings();
|
||||
m_plotOpts = aParent->GetPlotSettings();
|
||||
Init_Dialog();
|
||||
init_Dialog();
|
||||
|
||||
GetSizer()->Fit( this );
|
||||
GetSizer()->SetSizeHints( this );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_PLOT::Init_Dialog()
|
||||
void DIALOG_PLOT::init_Dialog()
|
||||
{
|
||||
wxString msg;
|
||||
wxFileName fileName;
|
||||
|
@ -117,8 +117,6 @@ void DIALOG_PLOT::Init_Dialog()
|
|||
// Set units for PS global width correction.
|
||||
AddUnitSymbol( *m_textPSFineAdjustWidth, g_UserUnit );
|
||||
|
||||
m_useAuxOriginCheckBox->SetValue( m_plotOpts.GetUseAuxOrigin() );
|
||||
|
||||
// Test for a reasonable scale value. Set to 1 if problem
|
||||
if( m_XScaleAdjust < PLOT_MIN_SCALE || m_YScaleAdjust < PLOT_MIN_SCALE
|
||||
|| m_XScaleAdjust > PLOT_MAX_SCALE || m_YScaleAdjust > PLOT_MAX_SCALE )
|
||||
|
@ -206,8 +204,9 @@ void DIALOG_PLOT::Init_Dialog()
|
|||
// Put vias on mask layer
|
||||
m_plotNoViaOnMaskOpt->SetValue( m_plotOpts.GetPlotViaOnMaskLayer() );
|
||||
|
||||
// Output directory
|
||||
m_outputDirectoryName->SetValue( m_plotOpts.GetOutputDirectory() );
|
||||
// Initialize a few other parameters, which can also be modified
|
||||
// from the drill dialog
|
||||
reInitDialog();
|
||||
|
||||
// Update options values:
|
||||
wxCommandEvent cmd_event;
|
||||
|
@ -216,6 +215,18 @@ void DIALOG_PLOT::Init_Dialog()
|
|||
}
|
||||
|
||||
|
||||
void DIALOG_PLOT::reInitDialog()
|
||||
{
|
||||
// after calling drill dialog, some parameters can be modified.
|
||||
// update them
|
||||
|
||||
// Output directory
|
||||
m_outputDirectoryName->SetValue( m_plotOpts.GetOutputDirectory() );
|
||||
|
||||
// Origin of coordinates:
|
||||
m_useAuxOriginCheckBox->SetValue( m_plotOpts.GetUseAuxOrigin() );
|
||||
}
|
||||
|
||||
void DIALOG_PLOT::OnQuit( wxCommandEvent& event )
|
||||
{
|
||||
Close( true ); // true is to force the frame to close
|
||||
|
@ -297,7 +308,7 @@ void DIALOG_PLOT::CreateDrillFile( wxCommandEvent& event )
|
|||
|
||||
// a few plot settings can be modified: take them in account
|
||||
m_plotOpts = m_parent->GetPlotSettings();
|
||||
Init_Dialog();
|
||||
reInitDialog();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -58,7 +58,6 @@ private:
|
|||
PCB_PLOT_PARAMS m_plotOpts;
|
||||
|
||||
// Event called functions
|
||||
void Init_Dialog();
|
||||
void Plot( wxCommandEvent& event ) override;
|
||||
void OnQuit( wxCommandEvent& event ) override;
|
||||
void OnClose( wxCloseEvent& event ) override;
|
||||
|
@ -73,6 +72,8 @@ private:
|
|||
void onRunDRC( wxCommandEvent& event ) override;
|
||||
|
||||
// other functions
|
||||
void init_Dialog(); // main initialization
|
||||
void reInitDialog(); // initialization after calling drill dialog
|
||||
void applyPlotSettings();
|
||||
PlotFormat getPlotFormat();
|
||||
|
||||
|
|
|
@ -113,6 +113,7 @@ bool DIALOG_SET_GRID::TransferDataFromWindow()
|
|||
}
|
||||
|
||||
wxPoint gridOrigin;
|
||||
|
||||
if( !getGridOrigin( gridOrigin ) )
|
||||
{
|
||||
wxMessageBox( wxString::Format( _( "Incorrect grid origin "
|
||||
|
|
Loading…
Reference in New Issue