From 3815087b2975f8fb48ca32a37b3f62f0ba64dd1a Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sun, 21 Apr 2013 20:31:09 -0400 Subject: [PATCH] changed implementation of MacOpenFile to make it open files when they are double clicked in Finder. --- kicad/kicad.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp index f78126d13a..adc08bfab9 100644 --- a/kicad/kicad.cpp +++ b/kicad/kicad.cpp @@ -56,21 +56,17 @@ void EDA_APP::MacOpenFile( const wxString &fileName ) frame->m_ProjectFileName = fn; - if( m_fileHistory.GetCount() ) + if( !frame->m_ProjectFileName.FileExists() ) { - frame->m_ProjectFileName = m_fileHistory.GetHistoryFile( 0 ); - - if( !frame->m_ProjectFileName.FileExists() ) - { - m_fileHistory.RemoveFileFromHistory( 0 ); - } - else - { - wxCommandEvent cmd( 0, wxID_FILE1 ); - frame->OnFileHistory( cmd ); - } + m_fileHistory.RemoveFileFromHistory( 0 ); + return; } + wxCommandEvent loadEvent; + loadEvent.SetId(wxID_ANY); + + frame->OnLoadProject(loadEvent); + wxString title = GetTitle() + wxT( " " ) + GetBuildVersion() + wxT( " " ) + frame->m_ProjectFileName.GetFullPath();