Separate sheet reloads (MODEL_RELOAD) and schematic reloads (SUPERMODEL_RELOAD).
Fixes https://gitlab.com/kicad/code/kicad/issues/14523
This commit is contained in:
parent
6059e895d7
commit
66f48d56ae
|
@ -132,7 +132,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
|||
{
|
||||
ClearUndoRedoList();
|
||||
SetScreen( nullptr );
|
||||
m_toolManager->GetTool<EE_INSPECTION_TOOL>()->Reset( TOOL_BASE::MODEL_RELOAD );
|
||||
m_toolManager->GetTool<EE_INSPECTION_TOOL>()->Reset( TOOL_BASE::SUPERMODEL_RELOAD );
|
||||
CreateScreens();
|
||||
}
|
||||
|
||||
|
|
|
@ -71,6 +71,19 @@ bool EE_INSPECTION_TOOL::Init()
|
|||
}
|
||||
|
||||
|
||||
void EE_INSPECTION_TOOL::Reset( RESET_REASON aReason )
|
||||
{
|
||||
EE_TOOL_BASE::Reset( aReason );
|
||||
|
||||
if( aReason == SUPERMODEL_RELOAD )
|
||||
{
|
||||
wxCommandEvent* evt = new wxCommandEvent( EDA_EVT_CLOSE_ERC_DIALOG, wxID_ANY );
|
||||
|
||||
wxQueueEvent( m_frame, evt );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int EE_INSPECTION_TOOL::RunERC( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
ShowERCDialog();
|
||||
|
|
|
@ -45,6 +45,8 @@ public:
|
|||
/// @copydoc TOOL_INTERACTIVE::Init()
|
||||
bool Init() override;
|
||||
|
||||
void Reset( RESET_REASON aReason ) override;
|
||||
|
||||
int RunERC( const TOOL_EVENT& aEvent );
|
||||
void ShowERCDialog();
|
||||
|
||||
|
|
|
@ -305,7 +305,7 @@ void EE_SELECTION_TOOL::Reset( RESET_REASON aReason )
|
|||
m_selection.Clear();
|
||||
}
|
||||
|
||||
if( aReason == TOOL_BASE::MODEL_RELOAD )
|
||||
if( aReason == TOOL_BASE::MODEL_RELOAD || aReason == TOOL_BASE::SUPERMODEL_RELOAD )
|
||||
{
|
||||
getView()->GetPainter()->GetSettings()->SetHighlight( false );
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
/// @copydoc TOOL_INTERACTIVE::Reset()
|
||||
void Reset( RESET_REASON aReason ) override
|
||||
{
|
||||
if( aReason == MODEL_RELOAD )
|
||||
if( aReason == MODEL_RELOAD || aReason == SUPERMODEL_RELOAD )
|
||||
{
|
||||
// Init variables used by every drawing tool
|
||||
m_frame = getEditFrame<T>();
|
||||
|
|
|
@ -77,7 +77,8 @@ public:
|
|||
enum RESET_REASON
|
||||
{
|
||||
RUN, ///< Tool is invoked after being inactive
|
||||
MODEL_RELOAD, ///< Model changes (required full reload)
|
||||
MODEL_RELOAD, ///< Model changes (the sheet for a schematic)
|
||||
SUPERMODEL_RELOAD, ///< For schematics, the entire schematic changed, not just the sheet
|
||||
GAL_SWITCH, ///< Rendering engine changes
|
||||
REDRAW ///< Full drawing refresh
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue