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