Commit 64e38bd7 authored by Dick Hollenbeck's avatar Dick Hollenbeck

KICAD_MANAGER_FRAME::SetProjectFileName() uses PROJECT::SetProjectFullName()

and forces absolute path.
parent 281ce25d
...@@ -127,16 +127,19 @@ wxConfigBase* KICAD_MANAGER_FRAME::config() ...@@ -127,16 +127,19 @@ wxConfigBase* KICAD_MANAGER_FRAME::config()
void KICAD_MANAGER_FRAME::SetProjectFileName( const wxString& aFullProjectProFileName ) void KICAD_MANAGER_FRAME::SetProjectFileName( const wxString& aFullProjectProFileName )
{ {
m_project_file_name = aFullProjectProFileName; // ensure file name is absolute:
wxFileName fn( aFullProjectProFileName );
wxASSERT( wxFileName( m_project_file_name ).IsAbsolute() || if( !fn.IsAbsolute() )
wxFileName( m_project_file_name ).GetName() == NAMELESS_PROJECT wxT( ".pro" ) ); fn.MakeAbsolute();
Prj().SetProjectFullName( fn.GetFullPath() );
} }
const wxString KICAD_MANAGER_FRAME::GetProjectFileName() const wxString KICAD_MANAGER_FRAME::GetProjectFileName()
{ {
return m_project_file_name; return Prj().GetProjectFullName();
} }
...@@ -287,7 +290,7 @@ void KICAD_MANAGER_FRAME::RunEeschema( const wxString& aProjectSchematicFileName ...@@ -287,7 +290,7 @@ void KICAD_MANAGER_FRAME::RunEeschema( const wxString& aProjectSchematicFileName
void KICAD_MANAGER_FRAME::OnRunEeschema( wxCommandEvent& event ) void KICAD_MANAGER_FRAME::OnRunEeschema( wxCommandEvent& event )
{ {
wxFileName fn( m_project_file_name ); wxFileName fn( GetProjectFileName() );
fn.SetExt( SchematicFileExtension ); fn.SetExt( SchematicFileExtension );
...@@ -339,7 +342,7 @@ void KICAD_MANAGER_FRAME::OnRunPageLayoutEditor( wxCommandEvent& event ) ...@@ -339,7 +342,7 @@ void KICAD_MANAGER_FRAME::OnRunPageLayoutEditor( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnRunCvpcb( wxCommandEvent& event ) void KICAD_MANAGER_FRAME::OnRunCvpcb( wxCommandEvent& event )
{ {
wxFileName fn( m_project_file_name ); wxFileName fn( GetProjectFileName() );
fn.SetExt( NetlistFileExtension ); fn.SetExt( NetlistFileExtension );
......
...@@ -182,8 +182,6 @@ void KICAD_MANAGER_FRAME::OnLoadProject( wxCommandEvent& event ) ...@@ -182,8 +182,6 @@ void KICAD_MANAGER_FRAME::OnLoadProject( wxCommandEvent& event )
{ {
wxString title; wxString title;
// this is still a pr, will work on it tomorrow.
ClearMsg(); ClearMsg();
if( event.GetId() != wxID_ANY ) if( event.GetId() != wxID_ANY )
...@@ -210,8 +208,13 @@ void KICAD_MANAGER_FRAME::OnLoadProject( wxCommandEvent& event ) ...@@ -210,8 +208,13 @@ void KICAD_MANAGER_FRAME::OnLoadProject( wxCommandEvent& event )
if( dlg.ShowModal() == wxID_CANCEL ) if( dlg.ShowModal() == wxID_CANCEL )
return; return;
DBG( printf( "%s: wxFileDialog::GetPath=%s\n", __func__, TO_UTF8( dlg.GetPath() ) );)
wxFileName pro( dlg.GetPath() ); wxFileName pro( dlg.GetPath() );
if( !pro.IsAbsolute() )
pro.MakeAbsolute();
pro.SetExt( ProjectFileExtension ); pro.SetExt( ProjectFileExtension );
if( newProject ) if( newProject )
......
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