diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 7eea92d19c..b9138493f9 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1117,6 +1117,10 @@ void SCH_EDIT_FRAME::OnClearFileHistory( wxCommandEvent& aEvent ) void SCH_EDIT_FRAME::NewProject() { + // Only standalone mode can directly load a new document + if( !Kiface().IsSingle() ) + return; + wxString pro_dir = m_mruPath; wxFileDialog dlg( this, _( "New Schematic" ), pro_dir, wxEmptyString, @@ -1147,6 +1151,10 @@ void SCH_EDIT_FRAME::NewProject() void SCH_EDIT_FRAME::LoadProject() { + // Only standalone mode can directly load a new document + if( !Kiface().IsSingle() ) + return; + wxString pro_dir = m_mruPath; wxString wildcards = AllSchematicFilesWildcard() + wxS( "|" ) + KiCadSchematicFileWildcard() diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 80ba36ec2d..3f42bbe171 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -315,6 +315,10 @@ bool PCB_EDIT_FRAME::Files_io_from_id( int id ) { case ID_LOAD_FILE: { + // Only standalone mode can directly load a new document + if( !Kiface().IsSingle() ) + return false; + int open_ctl = 0; wxString fileName = Prj().AbsolutePath( GetBoard()->GetFileName() ); @@ -324,6 +328,10 @@ bool PCB_EDIT_FRAME::Files_io_from_id( int id ) case ID_IMPORT_NON_KICAD_BOARD: { + // Only standalone mode can directly load a new document + if( !Kiface().IsSingle() ) + return false; + int open_ctl = 1; wxString fileName; // = Prj().AbsolutePath( GetBoard()->GetFileName() ); @@ -382,6 +390,10 @@ bool PCB_EDIT_FRAME::Files_io_from_id( int id ) case ID_NEW_BOARD: { + // Only standalone mode can directly load a new document + if( !Kiface().IsSingle() ) + return false; + if( IsContentModified() ) { wxFileName fileName = GetBoard()->GetFileName();