From 98330098ace74613f71326da4347c6a23bde414a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 10 Dec 2020 17:34:26 +0000 Subject: [PATCH] Yet another overhaul to locking. This unifies everything under a single architecture with a "don't show again" dialog. Since everything now goes through the same path it should be reasonably easy to make it do whatever we want in the future. Right now it presents 3 options: modify only unlocked items, override locks and modify all items, or cancel command. --- common/CMakeLists.txt | 2 + common/dialogs/dialog_locked_items_query.cpp | 77 +++ common/dialogs/dialog_locked_items_query.h | 44 ++ .../dialog_locked_items_query_base.cpp | 91 ++++ .../dialog_locked_items_query_base.fbp | 462 ++++++++++++++++++ .../dialogs/dialog_locked_items_query_base.h | 62 +++ pcbnew/tools/convert_tool.cpp | 6 +- pcbnew/tools/edit_tool.cpp | 94 +--- pcbnew/tools/edit_tool.h | 4 - pcbnew/tools/placement_tool.cpp | 168 +++++-- pcbnew/tools/position_relative_tool.cpp | 3 +- pcbnew/tools/selection_tool.cpp | 37 +- pcbnew/tools/selection_tool.h | 9 +- qa/qa_utils/mocks.cpp | 1 - 14 files changed, 904 insertions(+), 156 deletions(-) create mode 100644 common/dialogs/dialog_locked_items_query.cpp create mode 100644 common/dialogs/dialog_locked_items_query.h create mode 100644 common/dialogs/dialog_locked_items_query_base.cpp create mode 100644 common/dialogs/dialog_locked_items_query_base.fbp create mode 100644 common/dialogs/dialog_locked_items_query_base.h diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 3b012d78ee..ce90a52618 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -173,6 +173,8 @@ set( COMMON_DLG_SRCS dialogs/dialog_HTML_reporter_base.cpp dialogs/dialog_image_editor.cpp dialogs/dialog_image_editor_base.cpp + dialogs/dialog_locked_items_query.cpp + dialogs/dialog_locked_items_query_base.cpp dialogs/dialog_migrate_settings.cpp dialogs/dialog_migrate_settings_base.cpp dialogs/dialog_page_settings_base.cpp diff --git a/common/dialogs/dialog_locked_items_query.cpp b/common/dialogs/dialog_locked_items_query.cpp new file mode 100644 index 0000000000..a7aee38ca9 --- /dev/null +++ b/common/dialogs/dialog_locked_items_query.cpp @@ -0,0 +1,77 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +DIALOG_LOCKED_ITEMS_QUERY::DIALOG_LOCKED_ITEMS_QUERY( wxWindow* aParent, int aLockedItemCount ) : + DIALOG_LOCKED_ITEMS_QUERY_BASE( aParent ) +{ + m_icon->SetBitmap( KiBitmap( locked_xpm ) ); + + m_messageLine1->SetLabel( wxString::Format( m_messageLine1->GetLabel(), aLockedItemCount ) ); + + m_sdbSizerOK->SetDefault(); + + Layout(); + + // Now all widgets have the size fixed, call FinishDialogSettings + finishDialogSettings(); +} + + +void DIALOG_LOCKED_ITEMS_QUERY::onOverrideLocks( wxCommandEvent& event ) +{ + EndModal( wxID_APPLY ); +} + + +void DIALOG_LOCKED_ITEMS_QUERY::onOkClick( wxCommandEvent& event ) +{ + EndModal( wxID_OK ); +} + + +void DIALOG_LOCKED_ITEMS_QUERY::onCancelClick( wxCommandEvent& event ) +{ + EndModal( wxID_CANCEL ); +} + + +int DIALOG_LOCKED_ITEMS_QUERY::ShowModal() +{ + static int doNotShowValue = wxID_ANY; + + if( doNotShowValue != wxID_ANY ) + return doNotShowValue; + + int ret = DIALOG_SHIM::ShowModal(); + + // Has the user asked not to show the dialog again + if( m_doNotShowBtn->IsChecked() && ret != wxID_CANCEL ) + doNotShowValue = ret; + + return ret; +} + + diff --git a/common/dialogs/dialog_locked_items_query.h b/common/dialogs/dialog_locked_items_query.h new file mode 100644 index 0000000000..a8c895e323 --- /dev/null +++ b/common/dialogs/dialog_locked_items_query.h @@ -0,0 +1,44 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef DIALOG_LOCKED_ITEMS_QUERY_H +#define DIALOG_LOCKED_ITEMS_QUERY_H + +#include + + +class DIALOG_LOCKED_ITEMS_QUERY : public DIALOG_LOCKED_ITEMS_QUERY_BASE +{ +public: + /// This has no dependencies on calling wxFrame derivative, such as PCB_BASE_FRAME. + DIALOG_LOCKED_ITEMS_QUERY( wxWindow* aParent, int aLockedItemCount ); + + int ShowModal() override; + +private: + void onOverrideLocks( wxCommandEvent& event ) override; + void onCancelClick( wxCommandEvent& event ) override; + void onOkClick( wxCommandEvent& event ) override; +}; + +#endif // DIALOG_LOCKED_ITEMS_QUERY_H \ No newline at end of file diff --git a/common/dialogs/dialog_locked_items_query_base.cpp b/common/dialogs/dialog_locked_items_query_base.cpp new file mode 100644 index 0000000000..22b3813823 --- /dev/null +++ b/common/dialogs/dialog_locked_items_query_base.cpp @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Oct 26 2018) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_locked_items_query_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_LOCKED_ITEMS_QUERY_BASE::DIALOG_LOCKED_ITEMS_QUERY_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizerMain; + bSizerMain = new wxBoxSizer( wxVERTICAL ); + + wxFlexGridSizer* fgSizer4; + fgSizer4 = new wxFlexGridSizer( 0, 2, 10, 0 ); + fgSizer4->SetFlexibleDirection( wxBOTH ); + fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_icon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer4->Add( m_icon, 0, wxALL|wxALIGN_CENTER_VERTICAL, 10 ); + + wxBoxSizer* bSizer4; + bSizer4 = new wxBoxSizer( wxVERTICAL ); + + m_messageLine1 = new wxStaticText( this, wxID_ANY, _("The selection contains %d locked items."), wxDefaultPosition, wxDefaultSize, 0 ); + m_messageLine1->Wrap( -1 ); + bSizer4->Add( m_messageLine1, 0, wxALL, 5 ); + + m_messageLine2 = new wxStaticText( this, wxID_ANY, _("These items will be skipped unless you override the locks."), wxDefaultPosition, wxDefaultSize, 0 ); + m_messageLine2->Wrap( -1 ); + bSizer4->Add( m_messageLine2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + fgSizer4->Add( bSizer4, 1, wxEXPAND, 5 ); + + + fgSizer4->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_doNotShowBtn = new wxCheckBox( this, wxID_ANY, _("Do not show again."), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer4->Add( m_doNotShowBtn, 0, wxALL, 5 ); + + + bSizerMain->Add( fgSizer4, 1, wxEXPAND|wxALL, 5 ); + + wxBoxSizer* bButtonSizer; + bButtonSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_overrideBtn = new wxButton( this, wxID_ANY, _("Override Locks"), wxDefaultPosition, wxDefaultSize, 0 ); + bButtonSizer->Add( m_overrideBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + bButtonSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_sdbSizer = new wxStdDialogButtonSizer(); + m_sdbSizerOK = new wxButton( this, wxID_OK ); + m_sdbSizer->AddButton( m_sdbSizerOK ); + m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer->AddButton( m_sdbSizerCancel ); + m_sdbSizer->Realize(); + + bButtonSizer->Add( m_sdbSizer, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerMain->Add( bButtonSizer, 0, wxEXPAND|wxTOP|wxLEFT, 10 ); + + + this->SetSizer( bSizerMain ); + this->Layout(); + bSizerMain->Fit( this ); + + // Connect Events + this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::OnInitDlg ) ); + m_overrideBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOverrideLocks ), NULL, this ); + m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onCancelClick ), NULL, this ); + m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOkClick ), NULL, this ); +} + +DIALOG_LOCKED_ITEMS_QUERY_BASE::~DIALOG_LOCKED_ITEMS_QUERY_BASE() +{ + // Disconnect Events + this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::OnInitDlg ) ); + m_overrideBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOverrideLocks ), NULL, this ); + m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onCancelClick ), NULL, this ); + m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOkClick ), NULL, this ); + +} diff --git a/common/dialogs/dialog_locked_items_query_base.fbp b/common/dialogs/dialog_locked_items_query_base.fbp new file mode 100644 index 0000000000..03d704dcc7 --- /dev/null +++ b/common/dialogs/dialog_locked_items_query_base.fbp @@ -0,0 +1,462 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + dialog_locked_items_query_base + 1000 + none + + 1 + dialog_locked_items_query + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DIALOG_LOCKED_ITEMS_QUERY_BASE + + -1,-1 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + Locked Items + + + + + OnInitDlg + + + bSizerMain + wxVERTICAL + none + + 5 + wxEXPAND|wxALL + 1 + + 2 + wxBOTH + + + 0 + + fgSizer4 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + 10 + + 10 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_icon + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + + + + + 5 + wxEXPAND + 1 + + + bSizer4 + wxVERTICAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + The selection contains %d locked items. + 0 + + 0 + + + 0 + + 1 + m_messageLine1 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + These items will be skipped unless you override the locks. + 0 + + 0 + + + 0 + + 1 + m_messageLine2 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Do not show again. + + 0 + + + 0 + + 1 + m_doNotShowBtn + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + 10 + wxEXPAND|wxTOP|wxLEFT + 0 + + + bButtonSizer + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Override Locks + + 0 + + 0 + + + 0 + + 1 + m_overrideBtn + 1 + + + protected + 1 + + + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onOverrideLocks + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer + protected + onCancelClick + onOkClick + + + + + + + + diff --git a/common/dialogs/dialog_locked_items_query_base.h b/common/dialogs/dialog_locked_items_query_base.h new file mode 100644 index 0000000000..8efe844d39 --- /dev/null +++ b/common/dialogs/dialog_locked_items_query_base.h @@ -0,0 +1,62 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Oct 26 2018) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include +#include +#include +#include "dialog_shim.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_LOCKED_ITEMS_QUERY_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_LOCKED_ITEMS_QUERY_BASE : public DIALOG_SHIM +{ + private: + + protected: + wxStaticBitmap* m_icon; + wxStaticText* m_messageLine1; + wxStaticText* m_messageLine2; + wxCheckBox* m_doNotShowBtn; + wxButton* m_overrideBtn; + wxStdDialogButtonSizer* m_sdbSizer; + wxButton* m_sdbSizerOK; + wxButton* m_sdbSizerCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); } + virtual void onOverrideLocks( wxCommandEvent& event ) { event.Skip(); } + virtual void onCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void onOkClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DIALOG_LOCKED_ITEMS_QUERY_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Locked Items"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_LOCKED_ITEMS_QUERY_BASE(); + +}; + diff --git a/pcbnew/tools/convert_tool.cpp b/pcbnew/tools/convert_tool.cpp index 2feddf17ab..76d522b540 100644 --- a/pcbnew/tools/convert_tool.cpp +++ b/pcbnew/tools/convert_tool.cpp @@ -395,8 +395,7 @@ int CONVERT_TOOL::PolyToLines( const TOOL_EVENT& aEvent ) } } }, - nullptr, - true /* confirm if contains locked items */ ); + true /* prompt user regarding locked items */ ); if( selection.Empty() ) return 0; @@ -572,8 +571,7 @@ int CONVERT_TOOL::SegmentToArc( const TOOL_EVENT& aEvent ) } } }, - nullptr, - true /* confirm if contains locked items */ ); + true /* prompt user regarding locked items */ ); EDA_ITEM* source = selection.Front(); VECTOR2I start, end, mid; diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 4640c25fc4..dafca15697 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -124,9 +124,7 @@ void EditToolSelectionFilter( GENERAL_COLLECTOR& aCollector, int aFlags, EDIT_TOOL::EDIT_TOOL() : PCB_TOOL_BASE( "pcbnew.InteractiveEdit" ), m_selectionTool( NULL ), - m_dragging( false ), - m_dismissInfobarOnNextSel( false ), - m_forceDeleteLockedItems( false ) + m_dragging( false ) { } @@ -306,8 +304,7 @@ int EDIT_TOOL::Drag( const TOOL_EVENT& aEvent ) { EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED_PADS, sTool ); }, - nullptr, - true /* confirm if contains locked items */ ); + true /* prompt user regarding locked items */ ); if( selection.Empty() ) return 0; @@ -372,8 +369,7 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference ) { EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED_PADS, sTool ); }, - nullptr, - true /* confirm if contains locked items */ ); + true /* prompt user regarding locked items */ ); if( selection.Empty() ) return 0; @@ -628,7 +624,6 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference ) } while( ( evt = Wait() ) ); // Assignment (instead of equality test) is intentional - m_forceDeleteLockedItems = false; controls->ForceCursorPosition( false ); controls->ShowCursor( false ); controls->SetAutoPan( false ); @@ -664,8 +659,7 @@ int EDIT_TOOL::ChangeTrackWidth( const TOOL_EVENT& aEvent ) { EditToolSelectionFilter( aCollector, EXCLUDE_TRANSIENTS, sTool ); }, - nullptr, - true /* confirm if contains locked items */ ); + true /* prompt user regarding locked items */ ); for( EDA_ITEM* item : selection ) { @@ -730,8 +724,7 @@ int EDIT_TOOL::FilletTracks( const TOOL_EVENT& aEvent ) EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED_PADS | EXCLUDE_TRANSIENTS, sTool ); }, - nullptr, - !m_dragging /* confirm if contains locked items */ ); + !m_dragging /* prompt user regarding locked items */ ); if( selection.Size() < 2 ) { @@ -981,8 +974,7 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED_PADS | EXCLUDE_TRANSIENTS, sTool ); }, - nullptr, - !m_dragging /* confirm if contains locked items */ ); + !m_dragging /* prompt user regarding locked items */ ); if( selection.Empty() ) return 0; @@ -1084,8 +1076,7 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED_PADS | EXCLUDE_TRANSIENTS, sTool ); }, - nullptr, - !m_dragging /* confirm if contains locked items */ ); + !m_dragging /* prompt user regarding locked items */ ); if( selection.Empty() ) return 0; @@ -1184,8 +1175,7 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent ) EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED_PADS | EXCLUDE_TRANSIENTS, sTool ); }, - nullptr, - !m_dragging /* confirm if contains locked items */ ); + !m_dragging /* prompt user regarding locked items */ ); if( selection.Empty() ) return 0; @@ -1258,7 +1248,9 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent ) bool isCut = aEvent.Parameter() == PCB_ACTIONS::REMOVE_FLAGS::CUT; bool isAlt = aEvent.Parameter() == PCB_ACTIONS::REMOVE_FLAGS::ALT; - // If we are in a "Cut" operation, then the copied selection exists already + // If we are in a "Cut" operation, then the copied selection exists already and we want to + // delete exactly that; no more, no fewer. Any filtering for locked items must be done in + // the copyToClipboard() routine. if( isCut ) { selectionCopy = m_selectionTool->GetSelection(); @@ -1270,7 +1262,8 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent ) { EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED_PADS | EXCLUDE_TRANSIENTS, sTool ); - } ); + }, + true /* prompt user regarding locked items */ ); } bool isHover = selectionCopy.IsHover(); @@ -1286,21 +1279,6 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent ) if( selectionCopy.Empty() ) return 0; - // N.B. Setting the CUT flag prevents lock filtering as we only want to delete the items that - // were copied to the clipboard, no more, no fewer. Any filtering for locked items will be - // done in the copyToClipboard() routine - if( !m_forceDeleteLockedItems && !isCut ) - { - // Second RequestSelection removes locked items but keeps a copy of their pointers - selectionCopy = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) - { - EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED, sTool ); - }, - &lockedItems ); - } - - // As we are about to remove items, they have to be removed from the selection first m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); @@ -1451,34 +1429,6 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent ) else m_commit->Push( _( "Delete" ) ); - if( !m_forceDeleteLockedItems && !lockedItems.empty() ) - { - m_toolMgr->RunAction( PCB_ACTIONS::selectItems, true, &lockedItems ); - - WX_INFOBAR* infobar = frame()->GetInfoBar(); - wxString msg = _( "Locked items in the selection were not deleted." ); - wxString link = _( "Delete locked items" ); - - wxHyperlinkCtrl* button = new wxHyperlinkCtrl( infobar, wxID_ANY, link, wxEmptyString ); - button->Bind( wxEVT_COMMAND_HYPERLINK, std::function( - [&]( wxHyperlinkEvent& aEvent ) - { - m_forceDeleteLockedItems = true; - { - m_toolMgr->RunAction( ACTIONS::doDelete, true ); - } - m_forceDeleteLockedItems = false; - - frame()->GetInfoBar()->Dismiss(); - m_dismissInfobarOnNextSel = false; - } ) ); - - infobar->RemoveAllButtons(); - infobar->AddButton( button ); - infobar->ShowMessageFor( msg, 4000, wxICON_INFORMATION ); - m_dismissInfobarOnNextSel = true; - } - return 0; } @@ -1497,8 +1447,7 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent ) EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED_PADS | EXCLUDE_TRANSIENTS, sTool ); }, - nullptr, - true /* confirm if contains locked items */ ); + true /* prompt user regarding locked items */ ); if( selection.Empty() ) return 0; @@ -1938,18 +1887,6 @@ int EDIT_TOOL::cutToClipboard( const TOOL_EVENT& aEvent ) } -int EDIT_TOOL::onSelectionEvent( const TOOL_EVENT& aEvent ) -{ - if( m_dismissInfobarOnNextSel ) - { - frame()->GetInfoBar()->Dismiss(); - m_dismissInfobarOnNextSel = false; - } - - return 0; -} - - void EDIT_TOOL::setTransitions() { Go( &EDIT_TOOL::GetAndPlace, PCB_ACTIONS::getAndPlace.MakeEvent() ); @@ -1974,9 +1911,6 @@ void EDIT_TOOL::setTransitions() Go( &EDIT_TOOL::copyToClipboard, ACTIONS::copy.MakeEvent() ); Go( &EDIT_TOOL::copyToClipboard, PCB_ACTIONS::copyWithReference.MakeEvent() ); Go( &EDIT_TOOL::cutToClipboard, ACTIONS::cut.MakeEvent() ); - - Go( &EDIT_TOOL::onSelectionEvent, EVENTS::SelectedEvent ); - Go( &EDIT_TOOL::onSelectionEvent, EVENTS::UnselectedEvent ); } diff --git a/pcbnew/tools/edit_tool.h b/pcbnew/tools/edit_tool.h index 2ee509f165..27bd1e40a1 100644 --- a/pcbnew/tools/edit_tool.h +++ b/pcbnew/tools/edit_tool.h @@ -203,14 +203,10 @@ private: bool pickReferencePoint( const wxString& aTooltip, const wxString& aSuccessMessage, const wxString& aCanceledMessage, VECTOR2I& aReferencePoint ); - int onSelectionEvent( const TOOL_EVENT& aEvent ); - private: SELECTION_TOOL* m_selectionTool; // Selection tool used for obtaining selected items bool m_dragging; // Indicates objects are being dragged right now - bool m_dismissInfobarOnNextSel; - bool m_forceDeleteLockedItems; // Delete even locked items if set VECTOR2I m_cursor; // Last cursor position (needed for getModificationPoint() // to avoid changes of edit reference point). diff --git a/pcbnew/tools/placement_tool.cpp b/pcbnew/tools/placement_tool.cpp index e25e6b42ae..a59766d629 100644 --- a/pcbnew/tools/placement_tool.cpp +++ b/pcbnew/tools/placement_tool.cpp @@ -142,23 +142,28 @@ template< typename T > size_t ALIGN_DISTRIBUTE_TOOL::GetSelections( ALIGNMENT_RECTS& aItems, ALIGNMENT_RECTS& aLocked, T aCompare ) { - PCBNEW_SELECTION& selection = m_selectionTool->RequestSelection( []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) { EditToolSelectionFilter( aCollector, EXCLUDE_TRANSIENTS, sTool ); } ); - if( selection.Size() <= 1 ) - return 0; - std::vector lockedItems; + + for( EDA_ITEM* item : selection ) + { + BOARD_ITEM* boardItem = static_cast( item ); + + if( boardItem->IsLocked() ) + lockedItems.push_back( boardItem ); + } + selection = m_selectionTool->RequestSelection( []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) { EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED, sTool ); }, - &lockedItems ); + true /* prompt user regarding locked items */ ); aItems = GetBoundingBoxes( selection ); aLocked = GetBoundingBoxes( lockedItems ); @@ -174,17 +179,25 @@ int ALIGN_DISTRIBUTE_TOOL::AlignTop( const TOOL_EVENT& aEvent ) ALIGNMENT_RECTS itemsToAlign; ALIGNMENT_RECTS locked_items; - if( !GetSelections( itemsToAlign, locked_items, []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) - { return ( left.second.GetTop() < right.second.GetTop() ); } ) ) + if( !GetSelections( itemsToAlign, locked_items, + []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + { + return ( left.second.GetTop() < right.second.GetTop() ); + } ) ) + { return 0; + } BOARD_COMMIT commit( m_frame ); commit.StageItems( m_selectionTool->GetSelection(), CHT_MODIFY ); - auto targetTop = selectTarget( itemsToAlign, locked_items, []( const ALIGNMENT_RECT& aVal ) - { return aVal.second.GetTop(); } ); + int targetTop = selectTarget( itemsToAlign, locked_items, + []( const ALIGNMENT_RECT& aVal ) + { + return aVal.second.GetTop(); + } ); // Move the selected items - for( auto& i : itemsToAlign ) + for( std::pair& i : itemsToAlign ) { int difference = targetTop - i.second.GetTop(); BOARD_ITEM* item = i.first; @@ -207,17 +220,25 @@ int ALIGN_DISTRIBUTE_TOOL::AlignBottom( const TOOL_EVENT& aEvent ) ALIGNMENT_RECTS itemsToAlign; ALIGNMENT_RECTS locked_items; - if( !GetSelections( itemsToAlign, locked_items, []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) - { return ( left.second.GetBottom() < right.second.GetBottom() ); } ) ) + if( !GetSelections( itemsToAlign, locked_items, + []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + { + return ( left.second.GetBottom() < right.second.GetBottom() ); + } ) ) + { return 0; + } BOARD_COMMIT commit( m_frame ); commit.StageItems( m_selectionTool->GetSelection(), CHT_MODIFY ); - auto targetBottom = selectTarget( itemsToAlign, locked_items, []( const ALIGNMENT_RECT& aVal ) - { return aVal.second.GetBottom(); } ); + auto targetBottom = selectTarget( itemsToAlign, locked_items, + []( const ALIGNMENT_RECT& aVal ) + { + return aVal.second.GetBottom(); + } ); // Move the selected items - for( auto& i : itemsToAlign ) + for( std::pair& i : itemsToAlign ) { int difference = targetBottom - i.second.GetBottom(); BOARD_ITEM* item = i.first; @@ -255,17 +276,25 @@ int ALIGN_DISTRIBUTE_TOOL::doAlignLeft() ALIGNMENT_RECTS itemsToAlign; ALIGNMENT_RECTS locked_items; - if( !GetSelections( itemsToAlign, locked_items, []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) - { return ( left.second.GetLeft() < right.second.GetLeft() ); } ) ) + if( !GetSelections( itemsToAlign, locked_items, + []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + { + return ( left.second.GetLeft() < right.second.GetLeft() ); + } ) ) + { return 0; + } BOARD_COMMIT commit( m_frame ); commit.StageItems( m_selectionTool->GetSelection(), CHT_MODIFY ); - auto targetLeft = selectTarget( itemsToAlign, locked_items, []( const ALIGNMENT_RECT& aVal ) - { return aVal.second.GetLeft(); } ); + auto targetLeft = selectTarget( itemsToAlign, locked_items, + []( const ALIGNMENT_RECT& aVal ) + { + return aVal.second.GetLeft(); + } ); // Move the selected items - for( auto& i : itemsToAlign ) + for( std::pair& i : itemsToAlign ) { int difference = targetLeft - i.second.GetLeft(); BOARD_ITEM* item = i.first; @@ -303,17 +332,25 @@ int ALIGN_DISTRIBUTE_TOOL::doAlignRight() ALIGNMENT_RECTS itemsToAlign; ALIGNMENT_RECTS locked_items; - if( !GetSelections( itemsToAlign, locked_items, []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) - { return ( left.second.GetRight() < right.second.GetRight() ); } ) ) + if( !GetSelections( itemsToAlign, locked_items, + []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + { + return ( left.second.GetRight() < right.second.GetRight() ); + } ) ) + { return 0; + } BOARD_COMMIT commit( m_frame ); commit.StageItems( m_selectionTool->GetSelection(), CHT_MODIFY ); - auto targetRight = selectTarget( itemsToAlign, locked_items, []( const ALIGNMENT_RECT& aVal ) - { return aVal.second.GetRight(); } ); + auto targetRight = selectTarget( itemsToAlign, locked_items, + []( const ALIGNMENT_RECT& aVal ) + { + return aVal.second.GetRight(); + } ); // Move the selected items - for( auto& i : itemsToAlign ) + for( std::pair& i : itemsToAlign ) { int difference = targetRight - i.second.GetRight(); BOARD_ITEM* item = i.first; @@ -336,17 +373,25 @@ int ALIGN_DISTRIBUTE_TOOL::AlignCenterX( const TOOL_EVENT& aEvent ) ALIGNMENT_RECTS itemsToAlign; ALIGNMENT_RECTS locked_items; - if( !GetSelections( itemsToAlign, locked_items, []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) - { return ( left.second.GetCenter().x < right.second.GetCenter().x ); } ) ) + if( !GetSelections( itemsToAlign, locked_items, + []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + { + return ( left.second.GetCenter().x < right.second.GetCenter().x ); + } ) ) + { return 0; + } BOARD_COMMIT commit( m_frame ); commit.StageItems( m_selectionTool->GetSelection(), CHT_MODIFY ); - auto targetX = selectTarget( itemsToAlign, locked_items, []( const ALIGNMENT_RECT& aVal ) - { return aVal.second.GetCenter().x; } ); + auto targetX = selectTarget( itemsToAlign, locked_items, + []( const ALIGNMENT_RECT& aVal ) + { + return aVal.second.GetCenter().x; + } ); // Move the selected items - for( auto& i : itemsToAlign ) + for( std::pair& i : itemsToAlign ) { int difference = targetX - i.second.GetCenter().x; BOARD_ITEM* item = i.first; @@ -369,17 +414,25 @@ int ALIGN_DISTRIBUTE_TOOL::AlignCenterY( const TOOL_EVENT& aEvent ) ALIGNMENT_RECTS itemsToAlign; ALIGNMENT_RECTS locked_items; - if( !GetSelections( itemsToAlign, locked_items, []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) - { return ( left.second.GetCenter().y < right.second.GetCenter().y ); } ) ) + if( !GetSelections( itemsToAlign, locked_items, + []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + { + return ( left.second.GetCenter().y < right.second.GetCenter().y ); + } ) ) + { return 0; + } BOARD_COMMIT commit( m_frame ); commit.StageItems( m_selectionTool->GetSelection(), CHT_MODIFY ); - auto targetY = selectTarget( itemsToAlign, locked_items, []( const ALIGNMENT_RECT& aVal ) - { return aVal.second.GetCenter().y; } ); + auto targetY = selectTarget( itemsToAlign, locked_items, + []( const ALIGNMENT_RECT& aVal ) + { + return aVal.second.GetCenter().y; + } ); // Move the selected items - for( auto& i : itemsToAlign ) + for( std::pair& i : itemsToAlign ) { int difference = targetY - i.second.GetCenter().y; BOARD_ITEM* item = i.first; @@ -404,8 +457,7 @@ int ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally( const TOOL_EVENT& aEvent ) { EditToolSelectionFilter( aCollector, EXCLUDE_TRANSIENTS, sTool ); }, - nullptr, - true /* confirm if contains locked items */ ); + true /* prompt user regarding locked items */ ); if( selection.Size() <= 1 ) return 0; @@ -418,7 +470,9 @@ int ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally( const TOOL_EVENT& aEvent ) // find the last item by reverse sorting std::sort( itemsToDistribute.begin(), itemsToDistribute.end(), [] ( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) - { return ( left.second.GetRight() > right.second.GetRight() ); } ); + { + return ( left.second.GetRight() > right.second.GetRight() ); + } ); const auto lastItem = itemsToDistribute.begin()->first; const auto maxRight = itemsToDistribute.begin()->second.GetRight(); @@ -426,12 +480,14 @@ int ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally( const TOOL_EVENT& aEvent ) // sort to get starting order std::sort( itemsToDistribute.begin(), itemsToDistribute.end(), [] ( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) - { return ( left.second.GetX() < right.second.GetX() ); } ); + { + return ( left.second.GetX() < right.second.GetX() ); + } ); const auto minX = itemsToDistribute.begin()->second.GetX(); auto totalGap = maxRight - minX; int totalWidth = 0; - for( auto& i : itemsToDistribute ) + for( std::pair& i : itemsToDistribute ) { totalWidth += i.second.GetWidth(); } @@ -454,12 +510,13 @@ int ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally( const TOOL_EVENT& aEvent ) void ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally( ALIGNMENT_RECTS& itemsToDistribute, - const BOARD_ITEM* lastItem, int totalGap ) const + const BOARD_ITEM* lastItem, + int totalGap ) const { const auto itemGap = totalGap / ( itemsToDistribute.size() - 1 ); auto targetX = itemsToDistribute.begin()->second.GetX(); - for( auto& i : itemsToDistribute ) + for( std::pair& i : itemsToDistribute ) { BOARD_ITEM* item = i.first; @@ -482,13 +539,15 @@ void ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally( ALIGNMENT_RECTS &it { std::sort( itemsToDistribute.begin(), itemsToDistribute.end(), [] ( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) - { return ( left.second.GetCenter().x < right.second.GetCenter().x ); } ); + { + return ( left.second.GetCenter().x < right.second.GetCenter().x ); + } ); const auto totalGap = ( itemsToDistribute.end()-1 )->second.GetCenter().x - itemsToDistribute.begin()->second.GetCenter().x; const auto itemGap = totalGap / ( itemsToDistribute.size() - 1 ); auto targetX = itemsToDistribute.begin()->second.GetCenter().x; - for( auto& i : itemsToDistribute ) + for( std::pair& i : itemsToDistribute ) { BOARD_ITEM* item = i.first; @@ -510,8 +569,7 @@ int ALIGN_DISTRIBUTE_TOOL::DistributeVertically( const TOOL_EVENT& aEvent ) { EditToolSelectionFilter( aCollector, EXCLUDE_TRANSIENTS, sTool ); }, - nullptr, - true /* confirm if contains locked items */ ); + true /* prompt user regarding locked items */ ); if( selection.Size() <= 1 ) return 0; @@ -524,20 +582,24 @@ int ALIGN_DISTRIBUTE_TOOL::DistributeVertically( const TOOL_EVENT& aEvent ) // find the last item by reverse sorting std::sort( itemsToDistribute.begin(), itemsToDistribute.end(), [] ( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) - { return ( left.second.GetBottom() > right.second.GetBottom() ); } ); + { + return ( left.second.GetBottom() > right.second.GetBottom() ); + } ); const auto maxBottom = itemsToDistribute.begin()->second.GetBottom(); const auto lastItem = itemsToDistribute.begin()->first; // sort to get starting order std::sort( itemsToDistribute.begin(), itemsToDistribute.end(), [] ( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) - { return ( left.second.GetCenter().y < right.second.GetCenter().y ); } ); + { + return ( left.second.GetCenter().y < right.second.GetCenter().y ); + } ); auto minY = itemsToDistribute.begin()->second.GetY(); auto totalGap = maxBottom - minY; int totalHeight = 0; - for( auto& i : itemsToDistribute ) + for( std::pair& i : itemsToDistribute ) { totalHeight += i.second.GetHeight(); } @@ -565,7 +627,7 @@ void ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically( ALIGNMENT_RECTS& itemsTo const auto itemGap = totalGap / ( itemsToDistribute.size() - 1 ); auto targetY = itemsToDistribute.begin()->second.GetY(); - for( auto& i : itemsToDistribute ) + for( std::pair& i : itemsToDistribute ) { BOARD_ITEM* item = i.first; @@ -588,13 +650,15 @@ void ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically( ALIGNMENT_RECTS& item { std::sort( itemsToDistribute.begin(), itemsToDistribute.end(), [] ( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) - { return ( left.second.GetCenter().y < right.second.GetCenter().y ); } ); + { + return ( left.second.GetCenter().y < right.second.GetCenter().y ); + } ); const auto totalGap = ( itemsToDistribute.end()-1 )->second.GetCenter().y - itemsToDistribute.begin()->second.GetCenter().y; const auto itemGap = totalGap / ( itemsToDistribute.size() - 1 ); auto targetY = itemsToDistribute.begin()->second.GetCenter().y; - for( auto& i : itemsToDistribute ) + for( std::pair& i : itemsToDistribute ) { BOARD_ITEM* item = i.first; diff --git a/pcbnew/tools/position_relative_tool.cpp b/pcbnew/tools/position_relative_tool.cpp index 4016ce35d9..5fed5caa5f 100644 --- a/pcbnew/tools/position_relative_tool.cpp +++ b/pcbnew/tools/position_relative_tool.cpp @@ -71,8 +71,7 @@ int POSITION_RELATIVE_TOOL::PositionRelative( const TOOL_EVENT& aEvent ) { EditToolSelectionFilter( aCollector, EXCLUDE_TRANSIENTS, sTool ); }, - nullptr, - true /* confirm if contains locked items */ ); + true /* prompt user regarding locked items */ ); if( selection.Empty() ) return 0; diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 5fd4c2f26e..784c8373a7 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -40,6 +40,7 @@ using namespace std::placeholders; #include #include #include +#include #include #include #include @@ -461,7 +462,6 @@ PCBNEW_SELECTION& SELECTION_TOOL::GetSelection() PCBNEW_SELECTION& SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aClientFilter, - std::vector* aFiltered, bool aConfirmLockedItems ) { bool selectionEmpty = m_selection.Empty(); @@ -475,14 +475,36 @@ PCBNEW_SELECTION& SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aCli if( aConfirmLockedItems ) { - // Check if the selection contains locked items + std::vector lockedItems; + for( EDA_ITEM* item : m_selection ) { - if( static_cast( item )->IsLocked() ) - { - if( !IsOK( m_frame, _( "Selection contains locked items. Continue anyway?" ) ) ) - ClearSelection(); + BOARD_ITEM* boardItem = static_cast( item ); + if( boardItem->IsLocked() ) + lockedItems.push_back( boardItem ); + } + + if( !lockedItems.empty() ) + { + DIALOG_LOCKED_ITEMS_QUERY dlg( frame(), lockedItems.size() ); + + switch( dlg.ShowModal() ) + { + case wxID_OK: + // remove locked items from selection + for( BOARD_ITEM* item : lockedItems ) + unselect( item ); + + break; + + case wxID_CANCEL: + // cancel operation + ClearSelection(); + break; + + case wxID_APPLY: + // continue with operation with current selection break; } } @@ -523,9 +545,6 @@ PCBNEW_SELECTION& SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aCli if( disposition == BEFORE ) { - if( aFiltered ) - aFiltered->push_back( item ); - unhighlight( item, SELECTED, &m_selection ); } } diff --git a/pcbnew/tools/selection_tool.h b/pcbnew/tools/selection_tool.h index 1977aebb28..12f76f9221 100644 --- a/pcbnew/tools/selection_tool.h +++ b/pcbnew/tools/selection_tool.h @@ -90,13 +90,14 @@ public: /** * Function RequestSelection() * - * Returns the current selection set, filtered according to aFlags - * and aClientFilter. + * Returns the current selection set, filtered according to aFlags and aClientFilter. * If the set is empty, performs the legacy-style hover selection. - * @param aFiltered is an optional vector, that is filled with items removed by the filter + * + * @param aConfirmLockedItems if true the user will be prompted if they want to drop locked + * items from the selection or override the locks */ PCBNEW_SELECTION& RequestSelection( CLIENT_SELECTION_FILTER aClientFilter, - std::vector* aFiltered = nullptr, bool aConfirmLockedItems = false ); + bool aConfirmLockedItems = false ); ///> Select a single item under cursor event handler. int CursorSelection( const TOOL_EVENT& aEvent ); diff --git a/qa/qa_utils/mocks.cpp b/qa/qa_utils/mocks.cpp index e3de9904a7..efec67cc8c 100644 --- a/qa/qa_utils/mocks.cpp +++ b/qa/qa_utils/mocks.cpp @@ -526,7 +526,6 @@ PCBNEW_SELECTION& SELECTION_TOOL::GetSelection() PCBNEW_SELECTION& SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aClientFilter, - std::vector* aFiltered, bool aConfirmLockedItems ) {