Fix bug saving last netlist filepath.

Fixes: lp:1845883
* https://bugs.launchpad.net/kicad/+bug/1845883
This commit is contained in:
Jeff Young 2019-10-01 17:42:38 +01:00
parent 49dbc37277
commit 2679e80469
2 changed files with 8 additions and 4 deletions

View File

@ -60,15 +60,16 @@ void PCB_EDIT_FRAME::InstallNetlistFrame()
} }
DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, const wxString & aNetlistFullFilename ) DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxString& aNetlistFullFilename )
: DIALOG_NETLIST_BASE( aParent ), : DIALOG_NETLIST_BASE( aParent ),
m_parent( aParent ), m_parent( aParent ),
m_netlistPath( aNetlistFullFilename ),
m_initialized( false ), m_initialized( false ),
m_runDragCommand( false ) m_runDragCommand( false )
{ {
m_config = Kiface().KifaceSettings(); m_config = Kiface().KifaceSettings();
m_NetlistFilenameCtrl->SetValue( aNetlistFullFilename ); m_NetlistFilenameCtrl->SetValue( m_netlistPath );
m_browseButton->SetBitmap( KiBitmap( folder_xpm ) ); m_browseButton->SetBitmap( KiBitmap( folder_xpm ) );
m_cbUpdateFootprints->SetValue( m_config->Read( NETLIST_UPDATEFOOTPRINTS_KEY, 0l ) ); m_cbUpdateFootprints->SetValue( m_config->Read( NETLIST_UPDATEFOOTPRINTS_KEY, 0l ) );
@ -201,17 +202,19 @@ void DIALOG_NETLIST::onFilenameChanged()
if( m_initialized ) if( m_initialized )
{ {
wxFileName fn = m_NetlistFilenameCtrl->GetValue(); wxFileName fn = m_NetlistFilenameCtrl->GetValue();
if( fn.IsOk() ) if( fn.IsOk() )
{ {
if( fn.FileExists() ) if( fn.FileExists() )
{ {
m_netlistPath = m_NetlistFilenameCtrl->GetValue();
loadNetlist( true ); loadNetlist( true );
} }
else else
{ {
m_MessageWindow->Clear(); m_MessageWindow->Clear();
REPORTER& reporter = m_MessageWindow->Reporter(); REPORTER& reporter = m_MessageWindow->Reporter();
reporter.Report( _("The netlist file does not exist."), REPORTER::RPT_ERROR ); reporter.Report( _( "The netlist file does not exist." ), REPORTER::RPT_ERROR );
} }
} }
} }

View File

@ -39,12 +39,13 @@ class DIALOG_NETLIST : public DIALOG_NETLIST_BASE
{ {
private: private:
PCB_EDIT_FRAME* m_parent; PCB_EDIT_FRAME* m_parent;
wxString& m_netlistPath;
wxConfigBase* m_config; wxConfigBase* m_config;
bool m_initialized; bool m_initialized;
bool m_runDragCommand; bool m_runDragCommand;
public: public:
DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, const wxString & aNetlistFullFilename ); DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxString& aNetlistFullFilename );
~DIALOG_NETLIST(); ~DIALOG_NETLIST();
private: private: