← Back to team overview

kicad-developers team mailing list archive

[PATCH] libedit: add hotkey for Load Component

 

Hi,

This patch adds a hotkey (default: Ctrl+L) to libedit for Load
Component. Just another simple workflow-quickener when doing a lot of
library edits. I'll push this one in a day too.

-- 
Chris
>From c45f9c2b740ca5e7a7ac264d50a7d59d57794f3b Mon Sep 17 00:00:00 2001
From: Chris Pavlina <pavlina.chris@xxxxxxxxx>
Date: Mon, 30 Jan 2017 17:30:05 -0500
Subject: [PATCH] libedit: add hotkey for Load Component

---
 eeschema/hotkeys.cpp | 8 +++++++-
 eeschema/hotkeys.h   | 3 ++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp
index 43773b555..5deff742e 100644
--- a/eeschema/hotkeys.cpp
+++ b/eeschema/hotkeys.cpp
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
  * Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@xxxxxxxxxxx>
- * Copyright (C) 2004-2016 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 2004-2017 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
@@ -211,6 +211,7 @@ static EDA_HOTKEY HkFindNextDrcMarker( _HKI( "Find Next DRC Marker" ), HK_FIND_N
 static EDA_HOTKEY HkZoomSelection( _HKI( "Zoom to Selection" ), HK_ZOOM_SELECTION, '@', ID_ZOOM_SELECTION );
 
 // Special keys for library editor:
+static EDA_HOTKEY HkLoadPart( _HKI( "Load Component" ), HK_LIBEDIT_LOAD_PART, 'L' + GR_KB_CTRL );
 static EDA_HOTKEY HkCreatePin( _HKI( "Create Pin" ), HK_LIBEDIT_CREATE_PIN, 'P' );
 static EDA_HOTKEY HkInsertPin( _HKI( "Repeat Pin" ), HK_REPEAT_LAST, WXK_INSERT );
 static EDA_HOTKEY HkMoveLibItem( _HKI( "Move Library Item" ), HK_LIBEDIT_MOVE_GRAPHIC_ITEM, 'M' );
@@ -314,6 +315,7 @@ static EDA_HOTKEY* schematic_Hotkey_List[] =
 static EDA_HOTKEY* libEdit_Hotkey_List[] =
 {
     &HkSaveLib,
+    &HkLoadPart,
     &HkCreatePin,
     &HkInsertPin,
     &HkMoveLibItem,
@@ -752,6 +754,10 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
         }
         break;
 
+    case HK_LIBEDIT_LOAD_PART:
+        LoadOneLibraryPart( cmd );
+        break;
+
     case HK_LIBEDIT_CREATE_PIN:
         if( ! itemInEdit )
         {
diff --git a/eeschema/hotkeys.h b/eeschema/hotkeys.h
index 926288cbe..92211d3c7 100644
--- a/eeschema/hotkeys.h
+++ b/eeschema/hotkeys.h
@@ -2,7 +2,7 @@
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
  * Copyright (C) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr
- * Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors.
+ * Copyright (C) 2014-2017 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
@@ -43,6 +43,7 @@ enum hotkey_id_commnand {
     HK_LIBEDIT_MOVE_GRAPHIC_ITEM,
     HK_MOVEBLOCK_TO_DRAGBLOCK,
     HK_SAVE_BLOCK,
+    HK_LIBEDIT_LOAD_PART,
     HK_LIBEDIT_CREATE_PIN,
     HK_DELETE_PIN,
     HK_ROTATE,
-- 
2.11.0