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 @@
/////////////////////////////////////////////////////////////////////////////
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "confirm.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "pcbnew_config.h"
#include "dialog_netlist.h"
......@@ -24,6 +26,7 @@ void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC, const wxPoint& pos )
* name if no last file read is not set.
*/
wxFileName fn = GetLastNetListRead();
wxString lastNetlistName = GetLastNetListRead();
if( !fn.FileExists() )
{
......@@ -31,9 +34,21 @@ void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC, const wxPoint& pos )
fn.SetExt( NetExtBuffer );
}
DIALOG_NETLIST frame( this, DC, fn.GetFullPath() );
DIALOG_NETLIST frame( this, DC, lastNetlistName );
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 )
}
}
if( !GetScreen()->GetFileName().IsEmpty() )
{
wxFileName fn = GetScreen()->GetFileName();
fn.SetExt( ProjectFileExtension );
wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters() );
}
SaveSettings();
// 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()
120, 0, 0xFFFF ) );
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "MSegLar" ), &g_ModuleSegmentWidth,
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 ) );
return m_projectFileParams;
}
......
......@@ -19,7 +19,6 @@
#include "dialog_plot_base.h"
#include "pcb_plot_params.h"
/* Keywords to r/w options in m_Config */
#define CONFIG_XFINESCALE_ADJ wxT( "PlotXFineScaleAdj" )
#define CONFIG_YFINESCALE_ADJ wxT( "PlotYFineScaleAdj" )
......@@ -57,10 +56,10 @@ class DIALOG_PLOT : public DIALOG_PLOT_BASE
private:
PCB_EDIT_FRAME* m_Parent;
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_YScaleAdjust;
static wxPoint prevPosition; // Dialog position & size
static wxPoint prevPosition; // Dialog position & size
static wxSize prevSize;
public:
DIALOG_PLOT( PCB_EDIT_FRAME* parent );
......@@ -235,6 +234,7 @@ void DIALOG_PLOT::OnClose( wxCloseEvent& event )
prevPosition = GetPosition();
prevSize = GetSize();
applyPlotSettings();
EndModal( 0 );
}
......@@ -260,7 +260,7 @@ void DIALOG_PLOT::OnSetScaleOpt( wxCommandEvent& event )
void DIALOG_PLOT::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )
{
// 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() );
wxString path;
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