OSX: file opening sanity checks

This commit is contained in:
emmedics4 2010-02-21 20:23:16 +00:00
parent b5bef0f23b
commit e5db75a290
4 changed files with 19 additions and 1 deletions

View File

@ -42,6 +42,9 @@ void WinEDA_App::MacOpenFile(const wxString &fileName) {
wxFileName filename = fileName;
wxString oldPath;
WinEDA_CvpcbFrame * frame = ((WinEDA_CvpcbFrame*)GetTopWindow());
if(!filename.FileExists())
return;
if( frame->m_NetlistFileName.DirExists() )
oldPath = frame->m_NetlistFileName.GetPath();

View File

@ -104,7 +104,12 @@ IMPLEMENT_APP( WinEDA_App )
* http://wiki.wxwidgets.org/WxMac-specific_topics
*/
void WinEDA_App::MacOpenFile(const wxString &fileName) {
wxFileName filename = fileName;
WinEDA_SchematicFrame * frame = ((WinEDA_SchematicFrame*) GetTopWindow());
if(!filename.FileExists())
return;
frame->LoadOneEEProject( fileName, false );
}

View File

@ -62,7 +62,12 @@ IMPLEMENT_APP( WinEDA_App )
* http://wiki.wxwidgets.org/WxMac-specific_topics
*/
void WinEDA_App::MacOpenFile(const wxString &fileName) {
wxFileName filename = fileName;
WinEDA_GerberFrame * frame = ((WinEDA_GerberFrame*)GetTopWindow());
if(!filename.FileExists())
return;
frame->LoadOneGerberFile( fileName, FALSE );
}

View File

@ -75,7 +75,12 @@ IMPLEMENT_APP( WinEDA_App )
* http://wiki.wxwidgets.org/WxMac-specific_topics
*/
void WinEDA_App::MacOpenFile(const wxString &fileName) {
WinEDA_PcbFrame * frame = ((WinEDA_PcbFrame*) GetTopWindow());;
wxFileName filename = fileName;
WinEDA_PcbFrame * frame = ((WinEDA_PcbFrame*) GetTopWindow());
if(!filename.FileExists())
return;
frame->LoadOnePcbFile( fileName, FALSE );
}