Browse Source

Separate sheet reloads (MODEL_RELOAD) and schematic reloads (SUPERMODEL_RELOAD).

Fixes https://gitlab.com/kicad/code/kicad/issues/14523
newinvert
Jeff Young 3 years ago
parent
commit
66f48d56ae
  1. 2
      eeschema/files-io.cpp
  2. 13
      eeschema/tools/ee_inspection_tool.cpp
  3. 2
      eeschema/tools/ee_inspection_tool.h
  4. 2
      eeschema/tools/ee_selection_tool.cpp
  5. 2
      eeschema/tools/ee_tool_base.h
  6. 3
      include/tool/tool_base.h

2
eeschema/files-io.cpp

@ -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();
}

13
eeschema/tools/ee_inspection_tool.cpp

@ -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();

2
eeschema/tools/ee_inspection_tool.h

@ -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();

2
eeschema/tools/ee_selection_tool.cpp

@ -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 );

2
eeschema/tools/ee_tool_base.h

@ -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>();

3
include/tool/tool_base.h

@ -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…
Cancel
Save