Collapse schematic/symbol graphics import to single action
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16463
This commit is contained in:
parent
5a5b7e0064
commit
4eaa0242ca
|
@ -113,7 +113,7 @@ void SCH_EDIT_FRAME::doReCreateMenuBar()
|
|||
|
||||
submenuImport->Add( EE_ACTIONS::importFPAssignments, ACTION_MENU::NORMAL,
|
||||
_( "Footprint Assignments..." ) );
|
||||
submenuImport->Add( EE_ACTIONS::schImportGraphics, ACTION_MENU::NORMAL, _( "Graphics..." ) );
|
||||
submenuImport->Add( EE_ACTIONS::importGraphics, ACTION_MENU::NORMAL, _( "Graphics..." ) );
|
||||
|
||||
fileMenu->Add( submenuImport );
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ void SYMBOL_EDIT_FRAME::doReCreateMenuBar()
|
|||
submenuImport->SetIcon( BITMAPS::import );
|
||||
|
||||
submenuImport->Add( EE_ACTIONS::importSymbol, ACTION_MENU::NORMAL, _( "Symbol..." ) );
|
||||
submenuImport->Add( EE_ACTIONS::symbolImportGraphics, ACTION_MENU::NORMAL, _( "Graphics..." ) );
|
||||
submenuImport->Add( EE_ACTIONS::importGraphics, ACTION_MENU::NORMAL, _( "Graphics..." ) );
|
||||
|
||||
fileMenu->Add( submenuImport );
|
||||
|
||||
|
|
|
@ -553,7 +553,7 @@ void SYMBOL_EDIT_FRAME::setupUIConditions()
|
|||
mgr->SetConditions( EE_ACTIONS::drawSymbolLines, EDIT_TOOL( EE_ACTIONS::drawSymbolLines ) );
|
||||
mgr->SetConditions( EE_ACTIONS::drawSymbolPolygon, EDIT_TOOL( EE_ACTIONS::drawSymbolPolygon ) );
|
||||
mgr->SetConditions( EE_ACTIONS::placeSymbolAnchor, EDIT_TOOL( EE_ACTIONS::placeSymbolAnchor ) );
|
||||
mgr->SetConditions( EE_ACTIONS::symbolImportGraphics, EDIT_TOOL( EE_ACTIONS::symbolImportGraphics ) );
|
||||
mgr->SetConditions( EE_ACTIONS::importGraphics, EDIT_TOOL( EE_ACTIONS::importGraphics ) );
|
||||
|
||||
#undef CHECK
|
||||
#undef ENABLE
|
||||
|
|
|
@ -369,16 +369,6 @@ TOOL_ACTION EE_ACTIONS::placeSymbolAnchor( TOOL_ACTION_ARGS()
|
|||
.Icon( BITMAPS::anchor )
|
||||
.Flags( AF_ACTIVATE ) );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::symbolImportGraphics( TOOL_ACTION_ARGS()
|
||||
.Name( "eeschema.SymbolDrawing.symbolImportGraphics" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.DefaultHotkey( MD_SHIFT + MD_CTRL + 'F' )
|
||||
.LegacyHotkeyName( "Place DXF" )
|
||||
.FriendlyName( _( "Import Graphics..." ) )
|
||||
.Tooltip( _( "Import 2D drawing file" ) )
|
||||
.Icon( BITMAPS::import_vector )
|
||||
.Flags( AF_ACTIVATE ) );
|
||||
|
||||
// SYMBOL_EDITOR_PIN_TOOL
|
||||
//
|
||||
TOOL_ACTION EE_ACTIONS::pushPinLength( TOOL_ACTION_ARGS()
|
||||
|
@ -572,15 +562,6 @@ TOOL_ACTION EE_ACTIONS::placeImage( TOOL_ACTION_ARGS()
|
|||
.Flags( AF_ACTIVATE )
|
||||
.Parameter<SCH_BITMAP*>( nullptr ) );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::schImportGraphics( TOOL_ACTION_ARGS()
|
||||
.Name( "eeschema.InteractiveDrawing.schImportGraphics" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.DefaultHotkey( MD_SHIFT + MD_CTRL + 'F' )
|
||||
.LegacyHotkeyName( "Place DXF" )
|
||||
.FriendlyName( _( "Import Graphics..." ) )
|
||||
.Tooltip( _( "Import 2D drawing file" ) )
|
||||
.Icon( BITMAPS::import_vector )
|
||||
.Flags( AF_ACTIVATE ) );
|
||||
|
||||
// SCH_EDIT_TOOL
|
||||
//
|
||||
|
@ -1032,6 +1013,16 @@ TOOL_ACTION EE_ACTIONS::drawSheetOnClipboard( TOOL_ACTION_ARGS()
|
|||
.Tooltip( _( "Export drawing of current sheet to clipboard" ) )
|
||||
.Icon( BITMAPS::copy ) );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::importGraphics( TOOL_ACTION_ARGS()
|
||||
.Name( "eeschema.EditorControl.importGraphics" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.DefaultHotkey( MD_SHIFT + MD_CTRL + 'F' )
|
||||
.LegacyHotkeyName( "Place DXF" )
|
||||
.FriendlyName( _( "Import Graphics..." ) )
|
||||
.Tooltip( _( "Import 2D drawing file" ) )
|
||||
.Icon( BITMAPS::import_vector )
|
||||
.Flags( AF_ACTIVATE ) );
|
||||
|
||||
TOOL_ACTION EE_ACTIONS::showPcbNew( TOOL_ACTION_ARGS()
|
||||
.Name( "eeschema.EditorControl.showPcbNew" )
|
||||
.Scope( AS_GLOBAL )
|
||||
|
|
|
@ -97,7 +97,6 @@ public:
|
|||
static TOOL_ACTION drawArc;
|
||||
static TOOL_ACTION drawLines;
|
||||
static TOOL_ACTION placeImage;
|
||||
static TOOL_ACTION schImportGraphics;
|
||||
static TOOL_ACTION undoLastSegment;
|
||||
static TOOL_ACTION switchSegmentPosture;
|
||||
|
||||
|
@ -108,7 +107,6 @@ public:
|
|||
static TOOL_ACTION drawSymbolLines;
|
||||
static TOOL_ACTION drawSymbolPolygon;
|
||||
static TOOL_ACTION placeSymbolAnchor;
|
||||
static TOOL_ACTION symbolImportGraphics;
|
||||
|
||||
// Interactive Editing
|
||||
static TOOL_ACTION alignToGrid;
|
||||
|
@ -242,6 +240,7 @@ public:
|
|||
static TOOL_ACTION showSymbolTree;
|
||||
static TOOL_ACTION hideSymbolTree;
|
||||
static TOOL_ACTION drawSheetOnClipboard;
|
||||
static TOOL_ACTION importGraphics;
|
||||
static TOOL_ACTION exportSymbolView;
|
||||
static TOOL_ACTION exportSymbolAsSVG;
|
||||
static TOOL_ACTION showPythonConsole;
|
||||
|
|
|
@ -758,7 +758,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
|
||||
int SCH_DRAWING_TOOLS::SchImportGraphics( const TOOL_EVENT& aEvent )
|
||||
int SCH_DRAWING_TOOLS::ImportGraphics( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( m_inDrawingTool )
|
||||
return 0;
|
||||
|
@ -2193,5 +2193,5 @@ void SCH_DRAWING_TOOLS::setTransitions()
|
|||
Go( &SCH_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawArc.MakeEvent() );
|
||||
Go( &SCH_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawTextBox.MakeEvent() );
|
||||
Go( &SCH_DRAWING_TOOLS::PlaceImage, EE_ACTIONS::placeImage.MakeEvent() );
|
||||
Go( &SCH_DRAWING_TOOLS::SchImportGraphics, EE_ACTIONS::schImportGraphics.MakeEvent() );
|
||||
Go( &SCH_DRAWING_TOOLS::ImportGraphics, EE_ACTIONS::importGraphics.MakeEvent() );
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
int DrawShape( const TOOL_EVENT& aEvent );
|
||||
int DrawSheet( const TOOL_EVENT& aEvent );
|
||||
int PlaceImage( const TOOL_EVENT& aEvent );
|
||||
int SchImportGraphics( const TOOL_EVENT& aEvent );
|
||||
int ImportGraphics( const TOOL_EVENT& aEvent );
|
||||
|
||||
private:
|
||||
SCH_LINE* findWire( const VECTOR2I& aPosition );
|
||||
|
|
|
@ -654,7 +654,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
|
||||
int SYMBOL_EDITOR_DRAWING_TOOLS::SymbolImportGraphics( const TOOL_EVENT& aEvent )
|
||||
int SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
LIB_SYMBOL* symbol = m_frame->GetCurSymbol();
|
||||
|
||||
|
@ -868,6 +868,6 @@ void SYMBOL_EDITOR_DRAWING_TOOLS::setTransitions()
|
|||
Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolPolygon.MakeEvent() );
|
||||
Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawSymbolTextBox, EE_ACTIONS::drawSymbolTextBox.MakeEvent() );
|
||||
Go( &SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor, EE_ACTIONS::placeSymbolAnchor.MakeEvent() );
|
||||
Go( &SYMBOL_EDITOR_DRAWING_TOOLS::SymbolImportGraphics, EE_ACTIONS::symbolImportGraphics.MakeEvent() );
|
||||
Go( &SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics, EE_ACTIONS::importGraphics.MakeEvent() );
|
||||
Go( &SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem, EE_ACTIONS::repeatDrawItem.MakeEvent() );
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
int DrawShape( const TOOL_EVENT& aEvent );
|
||||
int DrawSymbolTextBox( const TOOL_EVENT& aEvent );
|
||||
int PlaceAnchor( const TOOL_EVENT& aEvent );
|
||||
int SymbolImportGraphics( const TOOL_EVENT& aEvent );
|
||||
int ImportGraphics( const TOOL_EVENT& aEvent );
|
||||
|
||||
int RepeatDrawItem( const TOOL_EVENT& aEvent );
|
||||
|
||||
|
|
Loading…
Reference in New Issue