Naming clarity. No functional changes.

This commit is contained in:
Jeff Young 2023-06-05 10:32:11 +01:00
parent f3d3ade1dc
commit 29aabcf77e
4 changed files with 15 additions and 13 deletions

View File

@ -196,9 +196,10 @@ public:
/**
* Delete all and reinitialize the current board.
*
* @param aQuery = true to prompt user for confirmation, false to initialize silently
* @param doAskAboutUnsavedChanges = true to prompt user for confirmation if existing board
* contains unsaved changes, false to re-initialize silently
*/
bool Clear_Pcb( bool aQuery );
bool Clear_Pcb( bool doAskAboutUnsavedChanges );
/// Return the LIB_ID of the part or library selected in the footprint tree.
LIB_ID GetTreeFPID() const;

View File

@ -39,12 +39,12 @@
#include <widgets/appearance_controls.h>
bool PCB_EDIT_FRAME::Clear_Pcb( bool aQuery, bool aFinal )
bool PCB_EDIT_FRAME::Clear_Pcb( bool doAskAboutUnsavedChanges, bool aFinal )
{
if( GetBoard() == nullptr )
return false;
if( aQuery && !GetBoard()->IsEmpty() )
if( doAskAboutUnsavedChanges && !GetBoard()->IsEmpty() )
{
if( !IsOK( this, _( "Current Board will be lost and this operation cannot be undone. "
"Continue?" ) ) )
@ -93,14 +93,14 @@ bool PCB_EDIT_FRAME::Clear_Pcb( bool aQuery, bool aFinal )
}
bool FOOTPRINT_EDIT_FRAME::Clear_Pcb( bool aQuery )
bool FOOTPRINT_EDIT_FRAME::Clear_Pcb( bool doAskAboutUnsavedChanges )
{
if( GetBoard() == nullptr )
return false;
bool is_last_fp_from_brd = IsCurrentFPFromBoard();
if( aQuery && IsContentModified() )
if( doAskAboutUnsavedChanges && IsContentModified() )
{
wxSafeYield( this, true ); // Allow frame to come to front before showing warning.

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 CERN
* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
@ -189,9 +189,9 @@ void PCB_BASE_EDIT_FRAME::ActivateGalCanvas()
void PCB_BASE_EDIT_FRAME::SetBoard( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
{
bool new_board = ( aBoard != m_pcb );
bool is_new_board = ( aBoard != m_pcb );
if( new_board )
if( is_new_board )
{
if( m_toolManager )
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
@ -204,7 +204,7 @@ void PCB_BASE_EDIT_FRAME::SetBoard( BOARD* aBoard, PROGRESS_REPORTER* aReporter
GetCanvas()->GetGAL()->SetGridOrigin( VECTOR2D( aBoard->GetDesignSettings().GetGridOrigin() ) );
if( new_board )
if( is_new_board )
{
BOARD_DESIGN_SETTINGS& bds = aBoard->GetDesignSettings();
bds.m_DRCEngine = std::make_shared<DRC_ENGINE>( aBoard, &bds );
@ -219,7 +219,7 @@ void PCB_BASE_EDIT_FRAME::SetBoard( BOARD* aBoard, PROGRESS_REPORTER* aReporter
m_toolManager->SetEnvironment( aBoard, GetCanvas()->GetView(),
GetCanvas()->GetViewControls(), config(), this );
if( new_board )
if( is_new_board )
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
}
}

View File

@ -411,10 +411,11 @@ public:
/**
* Delete all and reinitialize the current board.
*
* @param aQuery true to prompt user for confirmation, false to initialize silently.
* @param doAskAboutUnsavedChanges true to prompt user if existing board contains unsaved
* changes, false to re-initialize silently.
* @param aFinal if true, we are clearing the board to exit, so don't run more events.
*/
bool Clear_Pcb( bool aQuery, bool aFinal = false );
bool Clear_Pcb( bool doAskAboutUnsavedChanges, bool aFinal = false );
///< @copydoc PCB_BASE_FRAME::SetBoard()
void SetBoard( BOARD* aBoard, PROGRESS_REPORTER* aReporter = nullptr ) override