Remove redundant information from import/export menu item labels

Saying "Import/Export" on the labels when the submenu has "Import"
or "Export" in it is redundant.

Note that we can't just update the action text with the new name,
because that is used in the hotkey list and would become too confusing
without the "Import"/"Export" text.
This commit is contained in:
Ian McInerney 2021-03-27 18:47:48 +00:00
parent 2467b7e6c5
commit 7bfa8575fa
8 changed files with 37 additions and 28 deletions

View File

@ -163,12 +163,16 @@ wxMenuItem* ACTION_MENU::Add( const wxString& aLabel, const wxString& aTooltip,
}
wxMenuItem* ACTION_MENU::Add( const TOOL_ACTION& aAction, bool aIsCheckmarkEntry )
wxMenuItem* ACTION_MENU::Add( const TOOL_ACTION& aAction, bool aIsCheckmarkEntry,
const wxString& aOverrideLabel )
{
/// ID numbers for tool actions are assigned above ACTION_BASE_UI_ID inside TOOL_EVENT
BITMAPS icon = aAction.GetIcon();
wxMenuItem* item = new wxMenuItem( this, aAction.GetUIId(), aAction.GetMenuItem(),
// Allow the label to be overriden at point of use
wxString menuLabel = aOverrideLabel.IsEmpty() ? aAction.GetMenuItem() : aOverrideLabel;
wxMenuItem* item = new wxMenuItem( this, aAction.GetUIId(), menuLabel,
aAction.GetDescription(),
aIsCheckmarkEntry ? wxITEM_CHECK : wxITEM_NORMAL );
if( !!icon )

View File

@ -98,12 +98,12 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
submenuImport->SetTool( selTool );
submenuImport->SetTitle( _( "Import" ) );
submenuImport->SetIcon( BITMAPS::import );
submenuImport->Add( _( "Import Non KiCad Schematic..." ),
submenuImport->Add( _( "Non-KiCad Schematic..." ),
_( "Replace current schematic sheet with one imported from another application" ),
ID_IMPORT_NON_KICAD_SCH,
BITMAPS::import_document );
submenuImport->Add( EE_ACTIONS::importFPAssignments );
submenuImport->Add( EE_ACTIONS::importFPAssignments, ACTION_MENU::NORMAL, _( "Footprint Assignments..." ) );
fileMenu->Add( submenuImport );
@ -112,8 +112,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
submenuExport->SetTool( selTool );
submenuExport->SetTitle( _( "Export" ) );
submenuExport->SetIcon( BITMAPS::export_file );
submenuExport->Add( EE_ACTIONS::drawSheetOnClipboard );
submenuExport->Add( EE_ACTIONS::exportNetlist );
submenuExport->Add( EE_ACTIONS::drawSheetOnClipboard, ACTION_MENU::NORMAL, _( "Drawing to Clipboard" ) );
submenuExport->Add( EE_ACTIONS::exportNetlist, ACTION_MENU::NORMAL, _( "Netlist..." ) );
fileMenu->Add( submenuExport );
fileMenu->AppendSeparator();

View File

@ -69,9 +69,9 @@ void SYMBOL_EDIT_FRAME::ReCreateMenuBar()
submenuExport->SetTool( selTool );
submenuExport->SetTitle( _( "Export" ) );
submenuExport->SetIcon( BITMAPS::export_file );
submenuExport->Add( EE_ACTIONS::exportSymbol );
submenuExport->Add( EE_ACTIONS::exportSymbolView );
submenuExport->Add( EE_ACTIONS::exportSymbolAsSVG );
submenuExport->Add( EE_ACTIONS::exportSymbol, ACTION_MENU::NORMAL, _( "Symbol..." ) );
submenuExport->Add( EE_ACTIONS::exportSymbolView, ACTION_MENU::NORMAL, _( "View as PNG..." ) );
submenuExport->Add( EE_ACTIONS::exportSymbolAsSVG, ACTION_MENU::NORMAL, _( "Symbol as SVG..." ) );
fileMenu->Add( submenuExport );
fileMenu->AppendSeparator();

View File

@ -90,8 +90,12 @@ public:
* After selecting the entry, a #TOOL_EVENT command containing name of the action is sent.
*
* @param aAction is the action to be added to menu entry.
* @param aIsCheckmarkEntry is true to indicate a check menu entry, false for normal menu entry
* @param aOverrideLabel is the label to show in the menu (overriding the action's menu text)
* when non-empty
*/
wxMenuItem* Add( const TOOL_ACTION& aAction, bool aIsCheckmarkEntry = false );
wxMenuItem* Add( const TOOL_ACTION& aAction, bool aIsCheckmarkEntry = false,
const wxString& aOverrideLabel = wxEmptyString );
/**
* Add an action menu as a submenu.
@ -174,6 +178,7 @@ public:
virtual bool PassHelpTextToHandler() { return false; }
static constexpr bool NORMAL = false;
static constexpr bool CHECK = true;
protected:

View File

@ -91,12 +91,12 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
importMenu->SetTitle( _( "Import Non-KiCad Project..." ) );
importMenu->SetIcon( BITMAPS::import_project );
importMenu->Add( _( "Import CADSTAR Project..." ),
importMenu->Add( _( "CADSTAR Project..." ),
_( "Import CADSTAR Archive Schematic and PCB (*.csa, *.cpa)" ),
ID_IMPORT_CADSTAR_ARCHIVE_PROJECT,
BITMAPS::import_project );
importMenu->Add( _( "Import EAGLE Project..." ),
importMenu->Add( _( "EAGLE Project..." ),
_( "Import EAGLE CAD XML schematic and board" ),
ID_IMPORT_EAGLE_PROJECT,
BITMAPS::import_project );

View File

@ -69,9 +69,9 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
submenuImport->SetTitle( _( "Import" ) );
submenuImport->SetIcon( BITMAPS::import );
submenuImport->Add( PCB_ACTIONS::importFootprint );
submenuImport->Add( _( "&Import Graphics..." ),
_( "Import 2D Drawing file to Footprint Editor on Drawings layer" ),
submenuImport->Add( PCB_ACTIONS::importFootprint, ACTION_MENU::NORMAL, _( "Footprint..." ) );
submenuImport->Add( _( "&Graphics..." ),
_( "Import 2D drawing file to current footprint" ),
ID_GEN_IMPORT_GRAPHICS_FILE,
BITMAPS::import_vector );
@ -81,8 +81,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
submenuExport->SetTitle( _( "Export" ) );
submenuExport->SetIcon( BITMAPS::export_file );
submenuExport->Add( PCB_ACTIONS::exportFootprint );
submenuExport->Add( _( "Export View as &PNG..." ),
submenuExport->Add( PCB_ACTIONS::exportFootprint, ACTION_MENU::NORMAL, _( "Footprint..." ) );
submenuExport->Add( _( "View as &PNG..." ),
_( "Create a PNG file from the current view" ),
ID_FPEDIT_SAVE_PNG,
BITMAPS::export_png );

View File

@ -107,8 +107,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
submenuImport->SetTitle( _( "Import" ) );
submenuImport->SetIcon( BITMAPS::import );
submenuImport->Add( PCB_ACTIONS::importNetlist );
submenuImport->Add( PCB_ACTIONS::importSpecctraSession );
submenuImport->Add( PCB_ACTIONS::importNetlist, ACTION_MENU::NORMAL, _( "Netlist..." ) );
submenuImport->Add( PCB_ACTIONS::importSpecctraSession, ACTION_MENU::NORMAL, _( "Specctra Session..." ) );
submenuImport->Add( _( "Graphics..." ), _( "Import 2D drawing file" ),
ID_GEN_IMPORT_GRAPHICS_FILE, BITMAPS::import_vector );
@ -128,7 +128,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
submenuExport->SetTitle( _( "Export" ) );
submenuExport->SetIcon( BITMAPS::export_file );
submenuExport->Add( PCB_ACTIONS::exportSpecctraDSN );
submenuExport->Add( PCB_ACTIONS::exportSpecctraDSN, ACTION_MENU::NORMAL, _( "Specctra DSN..." ) );
submenuExport->Add( _( "GenCAD..." ), _( "Export GenCAD board representation" ),
ID_GEN_EXPORT_FILE_GENCADFORMAT, BITMAPS::post_gencad );
submenuExport->Add( _( "VRML..." ), _( "Export VRML 3D board representation" ),
@ -146,12 +146,12 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
ID_GEN_EXPORT_FILE_HYPERLYNX, BITMAPS::export_step );
submenuExport->AppendSeparator();
submenuExport->Add( _( "Export Footprints to Library..." ),
submenuExport->Add( _( "Footprints to Library..." ),
_( "Add footprints used on board to an existing footprint library\n"
"(does not remove other footprints from this library)" ),
ID_MENU_EXPORT_FOOTPRINTS_TO_LIBRARY, BITMAPS::library_archive );
submenuExport->Add( _( "Export Footprints to New Library..." ),
submenuExport->Add( _( "Footprints to New Library..." ),
_( "Create a new footprint library containing the footprints used on board\n"
"(if the library already exists it will be replaced)" ),
ID_MENU_EXPORT_FOOTPRINTS_TO_NEW_LIBRARY, BITMAPS::library_archive_as );

View File

@ -384,12 +384,12 @@ TOOL_ACTION PCB_ACTIONS::pasteFootprint( "pcbnew.ModuleEditor.pasteFootprint",
TOOL_ACTION PCB_ACTIONS::importFootprint( "pcbnew.ModuleEditor.importFootprint",
AS_GLOBAL, 0, "",
_( "Import Footprint..." ), "",
_( "Import Footprint..." ), _( "Import footprint from file" ),
BITMAPS::import_module );
TOOL_ACTION PCB_ACTIONS::exportFootprint( "pcbnew.ModuleEditor.exportFootprint",
AS_GLOBAL, 0, "",
_( "Export Footprint..." ), "",
_( "Export Footprint..." ), _( "Export footprint to file" ),
BITMAPS::export_module );
TOOL_ACTION PCB_ACTIONS::footprintProperties( "pcbnew.ModuleEditor.footprintProperties",
@ -555,17 +555,17 @@ TOOL_ACTION PCB_ACTIONS::boardSetup( "pcbnew.EditorControl.boardSetup",
TOOL_ACTION PCB_ACTIONS::importNetlist( "pcbnew.EditorControl.importNetlist",
AS_GLOBAL, 0, "",
_( "Netlist..." ), _( "Read netlist and update board connectivity" ),
_( "Import Netlist..." ), _( "Read netlist and update board connectivity" ),
BITMAPS::netlist );
TOOL_ACTION PCB_ACTIONS::importSpecctraSession( "pcbnew.EditorControl.importSpecctraSession",
AS_GLOBAL, 0, "",
_( "Specctra Session..." ), _( "Import routed Specctra session (*.ses) file" ),
_( "Import Specctra Session..." ), _( "Import routed Specctra session (*.ses) file" ),
BITMAPS::import );
TOOL_ACTION PCB_ACTIONS::exportSpecctraDSN( "pcbnew.EditorControl.exportSpecctraDSN",
AS_GLOBAL, 0, "",
_( "Specctra DSN..." ), _( "Export Specctra DSN routing info" ),
_( "Export Specctra DSN..." ), _( "Export Specctra DSN routing info" ),
BITMAPS::export_dsn );
TOOL_ACTION PCB_ACTIONS::generateGerbers( "pcbnew.EditorControl.generateGerbers",