From 5d2500d7db3e4e2bc1a86fd9fef2ea43348bbbb5 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 10 Jun 2015 18:21:35 +0200 Subject: [PATCH] Eeschema: fix Bug #1463158 (When a schematic hierarchy is being edited, Eeschema saves sub-sheets in the new project, when the user open a new project, and save the current editon). This was due to the fact the project name was changed before the user was prompted to save the design. A very minor other fix. --- eeschema/sch_marker.cpp | 5 ----- eeschema/sch_marker.h | 2 -- kicad/files-io.cpp | 11 ++++++++++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/eeschema/sch_marker.cpp b/eeschema/sch_marker.cpp index 3057e06e13..bbe0abbca4 100644 --- a/eeschema/sch_marker.cpp +++ b/eeschema/sch_marker.cpp @@ -69,11 +69,6 @@ SCH_MARKER::SCH_MARKER( const wxPoint& pos, const wxString& text ) : } -SCH_MARKER::~SCH_MARKER() -{ -} - - EDA_ITEM* SCH_MARKER::Clone() const { return new SCH_MARKER( *this ); diff --git a/eeschema/sch_marker.h b/eeschema/sch_marker.h index 0df849423d..813ff51615 100644 --- a/eeschema/sch_marker.h +++ b/eeschema/sch_marker.h @@ -60,8 +60,6 @@ public: // Do not create a copy constructor. The one generated by the compiler is adequate. - ~SCH_MARKER(); - wxString GetClass() const { return wxT( "SCH_MARKER" ); diff --git a/kicad/files-io.cpp b/kicad/files-io.cpp index dd5484d8ab..d9f1b12dca 100644 --- a/kicad/files-io.cpp +++ b/kicad/files-io.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -52,9 +53,17 @@ void KICAD_MANAGER_FRAME::OnFileHistory( wxCommandEvent& event ) if( fn.size() ) { - wxCommandEvent cmd( 0, wxID_ANY ); + // Any open KIFACE's must be closed before changing the project. + // We never want a KIWAY_PLAYER open on a KIWAY that isn't in the same project, + // and then break one project. + // Remember when saving files, the full path is build from the current project path + // User is prompted here to close those KIWAY_PLAYERs: + if( !Kiway.PlayersClose( false ) ) + return; + // We can now set the new project filename and load this project SetProjectFileName( fn ); + wxCommandEvent cmd( 0, wxID_ANY ); OnLoadProject( cmd ); } }