Rename pad copy actions in the pad tool

Import becomes apply and export becomes copy.

The term "push" to apply settings globally has not been renamed.

Swap the order of the copy and apply in the context menu.
This commit is contained in:
Nick Østergaard 2017-02-03 19:56:56 +01:00 committed by Maciej Suminski
parent 8f5c3c9e4e
commit 45a8c2e27f
9 changed files with 65 additions and 67 deletions

View File

@ -99,8 +99,8 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_SELECT_CU_LAYER_AND_PLACE_BLIND_BURIED_VIA:
case ID_POPUP_PCB_PLACE_MICROVIA:
case ID_POPUP_PCB_SWITCH_TRACK_POSTURE:
case ID_POPUP_PCB_IMPORT_PAD_SETTINGS:
case ID_POPUP_PCB_EXPORT_PAD_SETTINGS:
case ID_POPUP_PCB_APPLY_PAD_SETTINGS:
case ID_POPUP_PCB_COPY_PAD_SETTINGS:
case ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS:
case ID_POPUP_PCB_STOP_CURRENT_EDGE_ZONE:
case ID_POPUP_PCB_DELETE_ZONE_LAST_CREATED_CORNER:
@ -938,7 +938,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
m_canvas->MoveCursorToCrossHair();
break;
case ID_POPUP_PCB_IMPORT_PAD_SETTINGS:
case ID_POPUP_PCB_APPLY_PAD_SETTINGS:
m_canvas->MoveCursorToCrossHair();
SaveCopyInUndoList( GetCurItem()->GetParent(), UR_CHANGED );
Import_Pad_Settings( (D_PAD*) GetCurItem(), true );
@ -949,7 +949,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
DlgGlobalChange_PadSettings( (D_PAD*) GetCurItem(), true );
break;
case ID_POPUP_PCB_EXPORT_PAD_SETTINGS:
case ID_POPUP_PCB_COPY_PAD_SETTINGS:
m_canvas->MoveCursorToCrossHair();
Export_Pad_Settings( (D_PAD*) GetCurItem() );
break;

View File

@ -217,8 +217,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE:
case ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE:
case ID_POPUP_PCB_EDIT_TEXTMODULE:
case ID_POPUP_PCB_IMPORT_PAD_SETTINGS:
case ID_POPUP_PCB_EXPORT_PAD_SETTINGS:
case ID_POPUP_PCB_APPLY_PAD_SETTINGS:
case ID_POPUP_PCB_COPY_PAD_SETTINGS:
case ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS:
case ID_POPUP_PCB_STOP_CURRENT_DRAWING:
case ID_POPUP_MODEDIT_EDIT_BODY_ITEM:
@ -649,7 +649,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
createArray();
break;
case ID_POPUP_PCB_IMPORT_PAD_SETTINGS:
case ID_POPUP_PCB_APPLY_PAD_SETTINGS:
SaveCopyInUndoList( GetBoard()->m_Modules, UR_CHANGED );
m_canvas->MoveCursorToCrossHair();
Import_Pad_Settings( (D_PAD*) GetScreen()->GetCurItem(), true );
@ -662,7 +662,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
m_canvas->MoveCursorToCrossHair();
break;
case ID_POPUP_PCB_EXPORT_PAD_SETTINGS:
case ID_POPUP_PCB_COPY_PAD_SETTINGS:
m_canvas->MoveCursorToCrossHair();
Export_Pad_Settings( (D_PAD*) GetScreen()->GetCurItem() );
break;

View File

@ -310,10 +310,10 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
msg = AddHotkeyName( _("Edit Pad" ), g_Module_Editor_Hokeys_Descr, HK_EDIT_ITEM );
AddMenuItem( PopMenu, ID_POPUP_PCB_EDIT_PAD, msg, KiBitmap( options_pad_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_PCB_IMPORT_PAD_SETTINGS,
_( "New Pad Settings" ), KiBitmap( options_new_pad_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_PCB_EXPORT_PAD_SETTINGS,
_( "Export Pad Settings" ), KiBitmap( export_options_pad_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_PCB_COPY_PAD_SETTINGS,
_( "Copy Pad Settings" ), KiBitmap( copy_pad_settings_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_PCB_APPLY_PAD_SETTINGS,
_( "Apply Pad Settings" ), KiBitmap( apply_pad_settings_xpm ) );
msg = AddHotkeyName( _("Delete Pad" ), g_Module_Editor_Hokeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_PCB_DELETE_PAD, msg, KiBitmap( delete_pad_xpm ) );
@ -331,7 +331,7 @@ bool FOOTPRINT_EDIT_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMen
{
PopMenu->AppendSeparator();
AddMenuItem( PopMenu, ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS,
_( "Global Pad Settings" ), KiBitmap( global_options_pad_xpm ) );
_( "Push Pad Settings" ), KiBitmap( global_options_pad_xpm ) );
}
break;

View File

@ -940,17 +940,16 @@ void PCB_EDIT_FRAME::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu )
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_EDIT_PAD, msg, KiBitmap( options_pad_xpm ) );
sub_menu_Pad->AppendSeparator();
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_IMPORT_PAD_SETTINGS,
_( "Copy Current Settings to this Pad" ),
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_COPY_PAD_SETTINGS,
_( "Copy Pad Settings" ),
wxEmptyString,
KiBitmap( options_new_pad_xpm ) );
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_EXPORT_PAD_SETTINGS,
_( "Copy this Pad Settings to Current Settings" ),
KiBitmap( copy_pad_settings_xpm ) );
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_APPLY_PAD_SETTINGS,
_( "Apply Pad Settings" ),
wxEmptyString,
KiBitmap( export_options_pad_xpm ) );
KiBitmap( apply_pad_settings_xpm ) );
AddMenuItem( sub_menu_Pad, ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS,
_( "Edit All Pads" ),
_( "Push Pad Settings" ),
_( "Copy this pad's settings to all pads in this footprint (or similar footprints)" ),
KiBitmap( global_options_pad_xpm ) );
sub_menu_Pad->AppendSeparator();

View File

@ -146,8 +146,8 @@ enum pcbnew_ids
ID_POPUP_PCB_PLACE_MICROVIA,
ID_POPUP_PCB_SWITCH_TRACK_POSTURE,
ID_POPUP_PCB_IMPORT_PAD_SETTINGS,
ID_POPUP_PCB_EXPORT_PAD_SETTINGS,
ID_POPUP_PCB_APPLY_PAD_SETTINGS,
ID_POPUP_PCB_COPY_PAD_SETTINGS,
ID_POPUP_PCB_EDIT_TRACKSEG,
ID_POPUP_PCB_EDIT_TRACK_MNU,

View File

@ -469,23 +469,23 @@ TOOL_ACTION COMMON_ACTIONS::moduleTextOutlines( "pcbnew.ModuleEditor.textOutline
"", "" );
// Pad tools
TOOL_ACTION COMMON_ACTIONS::exportPadSettings(
"pcbnew.PadTool.ExportPadSettings",
TOOL_ACTION COMMON_ACTIONS::copyPadSettings(
"pcbnew.PadTool.CopyPadSettings",
AS_GLOBAL, 0,
_( "Export Pad Settings" ), _( "Copy current pad's settings to the board design settings" ),
export_options_pad_xpm );
_( "Copy Pad Settings" ), _( "Copy current pad's settings to the board design settings" ),
copy_pad_settings_xpm );
TOOL_ACTION COMMON_ACTIONS::importPadSettings(
"pcbnew.PadTool.ImportPadSettings",
TOOL_ACTION COMMON_ACTIONS::applyPadSettings(
"pcbnew.PadTool.ApplyPadSettings",
AS_GLOBAL, 0,
_( "Import Pad Settings" ), _( "Copy the board design settings pad properties to the current pad" ),
options_new_pad_xpm );
_( "Apply Pad Settings" ), _( "Copy the board design settings pad properties to the current pad" ),
apply_pad_settings_xpm );
TOOL_ACTION COMMON_ACTIONS::pushPadSettings(
"pcbnew.PadTool.PushPadSettings",
AS_GLOBAL, 0,
_( "Push Pad Settings" ), _( "Copy the current pad settings to other pads" ),
global_options_pad_xpm );
push_pad_settings_xpm );
// Cursor control
TOOL_ACTION COMMON_ACTIONS::cursorUp( "pcbnew.Control.cursorUp",

View File

@ -280,10 +280,10 @@ public:
// Pad tools
/// Copy the selected pad's settings to the board design settings
static TOOL_ACTION exportPadSettings;
static TOOL_ACTION copyPadSettings;
/// Copy the pad settings in the board design settings to the selected pad
static TOOL_ACTION importPadSettings;
static TOOL_ACTION applyPadSettings;
/// Copy the current pad's settings to other pads in the module or on the board
static TOOL_ACTION pushPadSettings;

View File

@ -49,8 +49,8 @@ public:
SetIcon( pad_xpm );
SetTitle( _( "Pads" ) );
Add( COMMON_ACTIONS::importPadSettings );
Add( COMMON_ACTIONS::exportPadSettings );
Add( COMMON_ACTIONS::copyPadSettings );
Add( COMMON_ACTIONS::applyPadSettings );
Add( COMMON_ACTIONS::pushPadSettings );
}
@ -74,15 +74,15 @@ private:
&& SELECTION_CONDITIONS::OnlyType( PCB_PAD_T );
auto emptySel = SELECTION_CONDITIONS::Count( 0 );
// Import pads enabled when any pads selected (it applies to each one
// Apply pads enabled when any pads selected (it applies to each one
// individually)
const bool canImport = ( anyPadSel )( selection );
Enable( getMenuId( COMMON_ACTIONS::importPadSettings ), canImport );
Enable( getMenuId( COMMON_ACTIONS::applyPadSettings ), canImport );
// Export pads item enabled only when there is a single pad selected
// (otherwise how would we know which one to export?)
// Copy pads item enabled only when there is a single pad selected
// (otherwise how would we know which one to copy?)
const bool canExport = ( singlePadSel )( selection );
Enable( getMenuId( COMMON_ACTIONS::exportPadSettings ), canExport );
Enable( getMenuId( COMMON_ACTIONS::copyPadSettings ), canExport );
// Push pads available when nothing selected, or a single pad
const bool canPush = ( singlePadSel || emptySel ) ( selection );
@ -133,12 +133,12 @@ bool PAD_TOOL::Init()
/**
* Function doExportPadSettings
* Function doCopyPadSettings
*
* Export a given pad to the destination pad. Normally, the destination
* Copy a given pad setting to the destination pad. Normally, the destination
* would be a board reference settings master pad.
*/
static void doExportPadSettings( const D_PAD& aSrc, D_PAD& aDest )
static void doCopyPadSettings( const D_PAD& aSrc, D_PAD& aDest )
{
// Copy all settings. Some of them are not used, but they break anything
aDest = aSrc;
@ -151,13 +151,13 @@ static void doExportPadSettings( const D_PAD& aSrc, D_PAD& aDest )
/**
* Function doImportPadSettings
* Function doApplyPadSettings
*
* Import pad settings from a "reference" source to a destination.
* Apply pad settings from a "reference" source to a destination.
* Often, the reference source will be a board reference settings
* master pad.
*/
static void doImportPadSettings( const D_PAD& aSrc, D_PAD& aDest )
static void doApplyPadSettings( const D_PAD& aSrc, D_PAD& aDest )
{
const auto& destParent = *aDest.GetParent();
@ -202,7 +202,7 @@ static void doImportPadSettings( const D_PAD& aSrc, D_PAD& aDest )
}
int PAD_TOOL::importPadSettings( const TOOL_EVENT& aEvent )
int PAD_TOOL::applyPadSettings( const TOOL_EVENT& aEvent )
{
auto& selTool = *m_toolMgr->GetTool<SELECTION_TOOL>();
const auto& selection = selTool.GetSelection();
@ -222,11 +222,11 @@ int PAD_TOOL::importPadSettings( const TOOL_EVENT& aEvent )
auto& destPad = static_cast<D_PAD&>( *item );
doImportPadSettings( masterPad, destPad );
doApplyPadSettings( masterPad, destPad );
}
}
commit.Push( _( "Import Pad Settings" ) );
commit.Push( _( "Apply Pad Settings" ) );
m_toolMgr->RunAction( COMMON_ACTIONS::editModifiedSelection, true );
frame.Refresh();
@ -235,7 +235,7 @@ int PAD_TOOL::importPadSettings( const TOOL_EVENT& aEvent )
}
int PAD_TOOL::exportPadSettings( const TOOL_EVENT& aEvent )
int PAD_TOOL::copyPadSettings( const TOOL_EVENT& aEvent )
{
auto& selTool = *m_toolMgr->GetTool<SELECTION_TOOL>();
const auto& selection = selTool.GetSelection();
@ -244,7 +244,7 @@ int PAD_TOOL::exportPadSettings( const TOOL_EVENT& aEvent )
D_PAD& masterPad = frame.GetDesignSettings().m_Pad_Master;
// can only export from a single pad
// can only copy from a single pad
if( selection.Size() == 1 )
{
auto item = selection[0];
@ -253,7 +253,7 @@ int PAD_TOOL::exportPadSettings( const TOOL_EVENT& aEvent )
{
const auto& selPad = static_cast<const D_PAD&>( *item );
doExportPadSettings( selPad, masterPad );
doCopyPadSettings( selPad, masterPad );
}
}
@ -271,8 +271,8 @@ static void globalChangePadSettings( BOARD& board,
{
const MODULE* moduleRef = aSrcPad.GetParent();
// if there is no module, we can't make the comparisons to see which
// pads to aply the src pad settings to
// If there is no module, we can't make the comparisons to see which
// pads to apply the source pad settings to
if( moduleRef == nullptr )
{
wxLogDebug( "globalChangePadSettings() Error: NULL module" );
@ -308,8 +308,8 @@ static void globalChangePadSettings( BOARD& board,
commit.Modify( pad );
// copy source pad settings to this pad
doImportPadSettings( aSrcPad, *pad );
// Apply source pad settings to this pad
doApplyPadSettings( aSrcPad, *pad );
}
}
}
@ -342,7 +342,7 @@ int PAD_TOOL::pushPadSettings( const TOOL_EVENT& aEvent )
else
{
// multiple selected what to do?
// maybe master->selection? same as import multiple?
// maybe master->selection? same as apply multiple?
}
// no valid selection, nothing to do
@ -380,7 +380,7 @@ int PAD_TOOL::pushPadSettings( const TOOL_EVENT& aEvent )
DIALOG_GLOBAL_PADS_EDITION::m_Pad_Orient_Filter,
DIALOG_GLOBAL_PADS_EDITION::m_Pad_Layer_Filter );
commit.Push( _( "Import Pad Settings" ) );
commit.Push( _( "Apply Pad Settings" ) );
m_toolMgr->RunAction( COMMON_ACTIONS::editModifiedSelection, true );
frame.Refresh();
@ -388,10 +388,9 @@ int PAD_TOOL::pushPadSettings( const TOOL_EVENT& aEvent )
return 0;
}
void PAD_TOOL::SetTransitions()
{
Go( &PAD_TOOL::importPadSettings, COMMON_ACTIONS::importPadSettings.MakeEvent() );
Go( &PAD_TOOL::exportPadSettings, COMMON_ACTIONS::exportPadSettings.MakeEvent() );
Go( &PAD_TOOL::pushPadSettings, COMMON_ACTIONS::pushPadSettings.MakeEvent() );
Go( &PAD_TOOL::applyPadSettings, COMMON_ACTIONS::applyPadSettings.MakeEvent() );
Go( &PAD_TOOL::copyPadSettings, COMMON_ACTIONS::copyPadSettings.MakeEvent() );
Go( &PAD_TOOL::pushPadSettings, COMMON_ACTIONS::pushPadSettings.MakeEvent() );
}

View File

@ -50,11 +50,11 @@ public:
void SetTransitions() override;
private:
///> Import pad settings from board design settings to a pad
int importPadSettings( const TOOL_EVENT& aEvent );
///> Apply pad settings from board design settings to a pad
int applyPadSettings( const TOOL_EVENT& aEvent );
///> Export pad settings from a pad to the board design settings
int exportPadSettings( const TOOL_EVENT& aEvent );
///> Copy pad settings from a pad to the board design settings
int copyPadSettings( const TOOL_EVENT& aEvent );
///> Push pad settings from a pad to other pads on board or module
int pushPadSettings( const TOOL_EVENT& aEvent );