diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index 5d756b3775..5a1eb1ca23 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -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(); } diff --git a/pcbnew/dialogs/dialog_plot.h b/pcbnew/dialogs/dialog_plot.h index 81aee9069b..ec0a902e90 100644 --- a/pcbnew/dialogs/dialog_plot.h +++ b/pcbnew/dialogs/dialog_plot.h @@ -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(); diff --git a/pcbnew/dialogs/dialog_set_grid.cpp b/pcbnew/dialogs/dialog_set_grid.cpp index e7ec2fc9b3..026adeff46 100644 --- a/pcbnew/dialogs/dialog_set_grid.cpp +++ b/pcbnew/dialogs/dialog_set_grid.cpp @@ -113,6 +113,7 @@ bool DIALOG_SET_GRID::TransferDataFromWindow() } wxPoint gridOrigin; + if( !getGridOrigin( gridOrigin ) ) { wxMessageBox( wxString::Format( _( "Incorrect grid origin "