Commit 951e759f authored by dickelbeck's avatar dickelbeck

dodge some debug asserts in wxFileDialog which happen if the filename has a path

parent a248ead3
...@@ -51,16 +51,21 @@ using namespace DSN; ...@@ -51,16 +51,21 @@ using namespace DSN;
void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event ) void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event )
{ {
wxString fullFileName = GetScreen()->m_FileName; wxString fullFileName = GetScreen()->m_FileName;
wxString std_ext = wxT( ".dsn" ); wxString path;
wxString mask = wxT( "*" ) + std_ext; wxString name;
wxString ext;
ChangeFileNameExt( fullFileName, std_ext ); wxString dsn_ext = wxT( ".dsn" );
wxString mask = wxT( "*" ) + dsn_ext;
wxFileName::SplitPath( fullFileName, &path, &name, &ext );
name += dsn_ext;
fullFileName = EDA_FileSelector( _( "Specctra DSN file:" ), fullFileName = EDA_FileSelector( _( "Specctra DSN file:" ),
wxEmptyString, /* Chemin par defaut */ path,
fullFileName, /* nom fichier par defaut */ name, // name.ext without path!
std_ext, /* extension par defaut */ dsn_ext,
mask, /* Masque d'affichage */ mask,
this, this,
wxFD_SAVE, wxFD_SAVE,
FALSE FALSE
......
...@@ -60,22 +60,27 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event ) ...@@ -60,22 +60,27 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
} }
*/ */
wxString fullFileName = GetScreen()->m_FileName;
wxString path;
wxString name;
wxString ext;
wxString sessionExt( wxT( ".ses" ) ); wxString sessionExt( wxT( ".ses" ) );
wxString fileName = GetScreen()->m_FileName;
wxString mask = wxT( "*" ) + sessionExt; wxString mask = wxT( "*" ) + sessionExt;
ChangeFileNameExt( fileName, sessionExt ); wxFileName::SplitPath( fullFileName, &path, &name, &ext );
name += sessionExt;
fileName = EDA_FileSelector( _( "Merge Specctra Session file:" ), fullFileName = EDA_FileSelector( _( "Merge Specctra Session file:" ),
wxEmptyString, path,
fileName, name, // name.ext without path!
sessionExt, sessionExt,
mask, mask,
this, this,
wxFD_OPEN, wxFD_OPEN,
FALSE ); FALSE );
if( fileName == wxEmptyString ) if( fullFileName == wxEmptyString )
return; return;
SPECCTRA_DB db; SPECCTRA_DB db;
...@@ -84,7 +89,7 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event ) ...@@ -84,7 +89,7 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
try try
{ {
db.LoadSESSION( fileName ); db.LoadSESSION( fullFileName );
db.FromSESSION( m_Pcb ); db.FromSESSION( m_Pcb );
} }
catch( IOError ioe ) catch( IOError ioe )
......
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