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

and forces absolute path.
This commit is contained in:
Dick Hollenbeck 2014-07-28 09:06:08 -05:00
parent 281ce25dd2
commit 64e38bd741
2 changed files with 14 additions and 8 deletions

View File

@ -127,16 +127,19 @@ wxConfigBase* KICAD_MANAGER_FRAME::config()
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() ||
wxFileName( m_project_file_name ).GetName() == NAMELESS_PROJECT wxT( ".pro" ) );
if( !fn.IsAbsolute() )
fn.MakeAbsolute();
Prj().SetProjectFullName( fn.GetFullPath() );
}
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
void KICAD_MANAGER_FRAME::OnRunEeschema( wxCommandEvent& event )
{
wxFileName fn( m_project_file_name );
wxFileName fn( GetProjectFileName() );
fn.SetExt( SchematicFileExtension );
@ -339,7 +342,7 @@ void KICAD_MANAGER_FRAME::OnRunPageLayoutEditor( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnRunCvpcb( wxCommandEvent& event )
{
wxFileName fn( m_project_file_name );
wxFileName fn( GetProjectFileName() );
fn.SetExt( NetlistFileExtension );

View File

@ -182,8 +182,6 @@ void KICAD_MANAGER_FRAME::OnLoadProject( wxCommandEvent& event )
{
wxString title;
// this is still a pr, will work on it tomorrow.
ClearMsg();
if( event.GetId() != wxID_ANY )
@ -210,8 +208,13 @@ void KICAD_MANAGER_FRAME::OnLoadProject( wxCommandEvent& event )
if( dlg.ShowModal() == wxID_CANCEL )
return;
DBG( printf( "%s: wxFileDialog::GetPath=%s\n", __func__, TO_UTF8( dlg.GetPath() ) );)
wxFileName pro( dlg.GetPath() );
if( !pro.IsAbsolute() )
pro.MakeAbsolute();
pro.SetExt( ProjectFileExtension );
if( newProject )