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

Pcbnew: fix a minor issue: *.pro file updated by Pcbnew only on demand.

parent 03d85728
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#include "fctsys.h" #include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h" #include "common.h"
#include "confirm.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "pcbnew_config.h"
#include "dialog_netlist.h" #include "dialog_netlist.h"
...@@ -24,6 +26,7 @@ void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC, const wxPoint& pos ) ...@@ -24,6 +26,7 @@ void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC, const wxPoint& pos )
* name if no last file read is not set. * name if no last file read is not set.
*/ */
wxFileName fn = GetLastNetListRead(); wxFileName fn = GetLastNetListRead();
wxString lastNetlistName = GetLastNetListRead();
if( !fn.FileExists() ) if( !fn.FileExists() )
{ {
...@@ -31,9 +34,21 @@ void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC, const wxPoint& pos ) ...@@ -31,9 +34,21 @@ void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC, const wxPoint& pos )
fn.SetExt( NetExtBuffer ); fn.SetExt( NetExtBuffer );
} }
DIALOG_NETLIST frame( this, DC, fn.GetFullPath() ); DIALOG_NETLIST frame( this, DC, lastNetlistName );
frame.ShowModal(); frame.ShowModal();
// Save project settings if needed.
// Project settings are saved in the corresponding <board name>.pro file
if( lastNetlistName != GetLastNetListRead() &&
!GetScreen()->GetFileName().IsEmpty() &&
IsOK(NULL, _("Project config has changed. Save it ?") ) )
{
wxFileName fn = GetScreen()->GetFileName();
fn.SetExt( ProjectFileExtension );
wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP,
GetProjectFileParameters() );
}
} }
......
...@@ -467,13 +467,6 @@ void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event ) ...@@ -467,13 +467,6 @@ void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
} }
} }
if( !GetScreen()->GetFileName().IsEmpty() )
{
wxFileName fn = GetScreen()->GetFileName();
fn.SetExt( ProjectFileExtension );
wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters() );
}
SaveSettings(); SaveSettings();
// do not show the window because ScreenPcb will be deleted and we do not // do not show the window because ScreenPcb will be deleted and we do not
......
...@@ -231,7 +231,7 @@ PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetProjectFileParameters() ...@@ -231,7 +231,7 @@ PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetProjectFileParameters()
120, 0, 0xFFFF ) ); 120, 0, 0xFFFF ) );
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "MSegLar" ), &g_ModuleSegmentWidth, m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "MSegLar" ), &g_ModuleSegmentWidth,
120, 0, 0xFFFF ) ); 120, 0, 0xFFFF ) );
m_projectFileParams.push_back( new PARAM_CFG_WXSTRING( wxT( "LastNetListRead" ), m_projectFileParams.push_back( new PARAM_CFG_FILENAME( wxT( "LastNetListRead" ),
&m_lastNetListRead ) ); &m_lastNetListRead ) );
return m_projectFileParams; return m_projectFileParams;
} }
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "dialog_plot_base.h" #include "dialog_plot_base.h"
#include "pcb_plot_params.h" #include "pcb_plot_params.h"
/* Keywords to r/w options in m_Config */ /* Keywords to r/w options in m_Config */
#define CONFIG_XFINESCALE_ADJ wxT( "PlotXFineScaleAdj" ) #define CONFIG_XFINESCALE_ADJ wxT( "PlotXFineScaleAdj" )
#define CONFIG_YFINESCALE_ADJ wxT( "PlotYFineScaleAdj" ) #define CONFIG_YFINESCALE_ADJ wxT( "PlotYFineScaleAdj" )
...@@ -57,10 +56,10 @@ class DIALOG_PLOT : public DIALOG_PLOT_BASE ...@@ -57,10 +56,10 @@ class DIALOG_PLOT : public DIALOG_PLOT_BASE
private: private:
PCB_EDIT_FRAME* m_Parent; PCB_EDIT_FRAME* m_Parent;
wxConfig* m_Config; wxConfig* m_Config;
std::vector<int> layerList; // List to hold CheckListBox layer numbers std::vector<int> layerList; // List to hold CheckListBox layer numbers
double m_XScaleAdjust; double m_XScaleAdjust;
double m_YScaleAdjust; double m_YScaleAdjust;
static wxPoint prevPosition; // Dialog position & size static wxPoint prevPosition; // Dialog position & size
static wxSize prevSize; static wxSize prevSize;
public: public:
DIALOG_PLOT( PCB_EDIT_FRAME* parent ); DIALOG_PLOT( PCB_EDIT_FRAME* parent );
...@@ -235,6 +234,7 @@ void DIALOG_PLOT::OnClose( wxCloseEvent& event ) ...@@ -235,6 +234,7 @@ void DIALOG_PLOT::OnClose( wxCloseEvent& event )
prevPosition = GetPosition(); prevPosition = GetPosition();
prevSize = GetSize(); prevSize = GetSize();
applyPlotSettings(); applyPlotSettings();
EndModal( 0 ); EndModal( 0 );
} }
...@@ -260,7 +260,7 @@ void DIALOG_PLOT::OnSetScaleOpt( wxCommandEvent& event ) ...@@ -260,7 +260,7 @@ void DIALOG_PLOT::OnSetScaleOpt( wxCommandEvent& event )
void DIALOG_PLOT::OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) void DIALOG_PLOT::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )
{ {
// Build the absolute path of current output plot directory // Build the absolute path of current output plot directory
// to preselect it when opening the Di Dialog. // to preselect it when opening the dialog.
wxFileName fn( m_outputDirectoryName->GetValue() ); wxFileName fn( m_outputDirectoryName->GetValue() );
wxString path; wxString path;
if( fn.IsRelative() ) if( fn.IsRelative() )
......
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