← Back to team overview

kicad-developers team mailing list archive

[PATCH] eeschema: make footprint preview optional

 

Hi,

I've attached a patch to make the footprint preview and selection
functionality in eeschema optional, to address primarily performance
concerns some users have, and also to address the handful of planned
features still unimplemented. It's a runtime option, default OFF, so
users can easily enable it if they like. I should have time after the
release to work more on polishing it and then we can take the option
back out.

-- 
Chris
>From b1716e1f0fe8fa516503cf2f6758447234f7e1be Mon Sep 17 00:00:00 2001
From: Chris Pavlina <pavlina.chris@xxxxxxxxx>
Date: Tue, 2 Jan 2018 19:52:35 -0700
Subject: [PATCH] eeschema: make footprint preview optional

The footprint preview and selection has been problematic for some users;
I'd rather option it out for 5.0 and work on polishing it for 6.0.
---
 eeschema/dialogs/dialog_choose_component.cpp       | 44 +++++++----
 eeschema/dialogs/dialog_choose_component.h         |  9 ++-
 .../dialogs/dialog_edit_component_in_schematic.cpp |  4 +-
 eeschema/dialogs/dialog_edit_components_libid.cpp  |  4 +-
 eeschema/dialogs/dialog_eeschema_options.h         | 14 +++-
 eeschema/dialogs/dialog_eeschema_options_base.cpp  |  5 +-
 eeschema/dialogs/dialog_eeschema_options_base.fbp  | 88 ++++++++++++++++++++++
 eeschema/dialogs/dialog_eeschema_options_base.h    |  3 +-
 eeschema/eeschema_config.cpp                       |  7 +-
 eeschema/getpart.cpp                               | 10 ++-
 eeschema/sch_base_frame.h                          |  9 ++-
 eeschema/schframe.h                                |  3 +-
 eeschema/viewlibs.cpp                              |  4 +-
 13 files changed, 167 insertions(+), 37 deletions(-)

diff --git a/eeschema/dialogs/dialog_choose_component.cpp b/eeschema/dialogs/dialog_choose_component.cpp
index 2218e7b9f..2f2f0ce76 100644
--- a/eeschema/dialogs/dialog_choose_component.cpp
+++ b/eeschema/dialogs/dialog_choose_component.cpp
@@ -2,8 +2,7 @@
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
  * Copyright (C) 2014 Henner Zeller <h.zeller@xxxxxxx>
- * Copyright (C) 2017 Chris Pavlina <pavlina.chris@xxxxxxxxx>
- * Copyright (C) 2016-2017 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 2016-2018 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
@@ -50,12 +49,16 @@ FOOTPRINT_ASYNC_LOADER          DIALOG_CHOOSE_COMPONENT::m_fp_loader;
 std::unique_ptr<FOOTPRINT_LIST> DIALOG_CHOOSE_COMPONENT::m_fp_list;
 
 DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT( SCH_BASE_FRAME* aParent, const wxString& aTitle,
-        CMP_TREE_MODEL_ADAPTER::PTR& aAdapter, int aDeMorganConvert, bool aAllowFieldEdits )
+        CMP_TREE_MODEL_ADAPTER::PTR& aAdapter, int aDeMorganConvert, bool aAllowFieldEdits,
+        bool aShowFootprints )
         : DIALOG_SHIM( aParent, wxID_ANY, aTitle, wxDefaultPosition, wxSize( 800, 650 ),
                   wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ),
+          m_fp_sel_ctrl( nullptr ),
+          m_fp_view_ctrl( nullptr ),
           m_parent( aParent ),
           m_deMorganConvert( aDeMorganConvert >= 0 ? aDeMorganConvert : 0 ),
           m_allow_field_edits( aAllowFieldEdits ),
+          m_show_footprints( aShowFootprints ),
           m_external_browser_requested( false )
 {
     wxBusyCursor busy_while_loading;
@@ -117,21 +120,25 @@ wxPanel* DIALOG_CHOOSE_COMPONENT::ConstructRightPanel( wxWindow* aParent )
             wxFULL_REPAINT_ON_RESIZE | wxSUNKEN_BORDER | wxTAB_TRAVERSAL );
     m_sch_view_ctrl->SetLayoutDirection( wxLayout_LeftToRight );
 
-    if( m_allow_field_edits )
-        m_fp_sel_ctrl = new FOOTPRINT_SELECT_WIDGET( panel, m_fp_loader, m_fp_list, true );
-    else
-        m_fp_sel_ctrl = nullptr;
-
-    m_fp_view_ctrl = new FOOTPRINT_PREVIEW_WIDGET( panel, Kiway() );
+    if( m_show_footprints )
+    {
+        if( m_allow_field_edits )
+            m_fp_sel_ctrl = new FOOTPRINT_SELECT_WIDGET( panel, m_fp_loader, m_fp_list, true );
 
+        m_fp_view_ctrl = new FOOTPRINT_PREVIEW_WIDGET( panel, Kiway() );
 
-    sizer->Add( m_sch_view_ctrl, 1, wxEXPAND | wxALL, 5 );
 
-    if( m_fp_sel_ctrl )
-        sizer->Add( m_fp_sel_ctrl, 0, wxEXPAND | wxALL, 5 );
+        sizer->Add( m_sch_view_ctrl, 1, wxEXPAND | wxALL, 5 );
 
-    sizer->Add( m_fp_view_ctrl, 1, wxEXPAND | wxALL, 5 );
+        if( m_fp_sel_ctrl )
+            sizer->Add( m_fp_sel_ctrl, 0, wxEXPAND | wxALL, 5 );
 
+        sizer->Add( m_fp_view_ctrl, 1, wxEXPAND | wxALL, 5 );
+    }
+    else
+    {
+        sizer->Add( m_sch_view_ctrl, 1, wxEXPAND | wxALL, 5 );
+    }
 
     panel->SetSizer( sizer );
     panel->Layout();
@@ -143,7 +150,7 @@ wxPanel* DIALOG_CHOOSE_COMPONENT::ConstructRightPanel( wxWindow* aParent )
 
 void DIALOG_CHOOSE_COMPONENT::OnInitDialog( wxInitDialogEvent& aEvent )
 {
-    if( m_fp_view_ctrl->IsInitialized() )
+    if( m_fp_view_ctrl && m_fp_view_ctrl->IsInitialized() )
     {
         // This hides the GAL panel and shows the status label
         m_fp_view_ctrl->SetStatusText( wxEmptyString );
@@ -190,7 +197,7 @@ void DIALOG_CHOOSE_COMPONENT::OnSchViewDClick( wxMouseEvent& aEvent )
 
 void DIALOG_CHOOSE_COMPONENT::ShowFootprintFor( LIB_ID const& aLibId )
 {
-    if( !m_fp_view_ctrl->IsInitialized() )
+    if( !m_fp_view_ctrl || !m_fp_view_ctrl->IsInitialized() )
         return;
 
     LIB_ALIAS* alias = nullptr;
@@ -222,6 +229,11 @@ void DIALOG_CHOOSE_COMPONENT::ShowFootprintFor( LIB_ID const& aLibId )
 
 void DIALOG_CHOOSE_COMPONENT::ShowFootprint( wxString const& aName )
 {
+    if( !m_fp_view_ctrl )
+    {
+        return;
+    }
+
     if( aName == wxEmptyString )
     {
         m_fp_view_ctrl->SetStatusText( _( "No footprint specified" ) );
@@ -379,7 +391,7 @@ void DIALOG_CHOOSE_COMPONENT::OnComponentPreselected( wxCommandEvent& aEvent )
     }
     else
     {
-        if( m_fp_view_ctrl->IsInitialized() )
+        if( m_fp_view_ctrl && m_fp_view_ctrl->IsInitialized() )
             m_fp_view_ctrl->SetStatusText( wxEmptyString );
 
         PopulateFootprintSelector( id );
diff --git a/eeschema/dialogs/dialog_choose_component.h b/eeschema/dialogs/dialog_choose_component.h
index 94bb15f9a..9819dceab 100644
--- a/eeschema/dialogs/dialog_choose_component.h
+++ b/eeschema/dialogs/dialog_choose_component.h
@@ -2,8 +2,7 @@
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
  * Copyright (C) 2014 Henner Zeller <h.zeller@xxxxxxx>
- * Copyright (C) 2017 Chris Pavlina <pavlina.chris@xxxxxxxxx>
- * Copyright (C) 2014-2017 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 2014-2018 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
@@ -100,9 +99,12 @@ public:
      *                          (TODO: should happen in dialog)
      * @param aAllowFieldEdits  if false, all functions that allow the user to edit
      *      fields (currently just footprint selection) will not be available.
+     * @param aShowFootprints   if false, all footprint preview and selection features
+     *      are disabled. This forces aAllowFieldEdits false too.
      */
     DIALOG_CHOOSE_COMPONENT( SCH_BASE_FRAME* aParent, const wxString& aTitle,
-            CMP_TREE_MODEL_ADAPTER::PTR& aAdapter, int aDeMorganConvert, bool aAllowFieldEdits );
+            CMP_TREE_MODEL_ADAPTER::PTR& aAdapter, int aDeMorganConvert, bool aAllowFieldEdits,
+            bool aShowFootprints );
 
     ~DIALOG_CHOOSE_COMPONENT();
 
@@ -195,6 +197,7 @@ protected:
     SCH_BASE_FRAME*             m_parent;
     int                         m_deMorganConvert;
     bool                        m_allow_field_edits;
+    bool                        m_show_footprints;
     bool                        m_external_browser_requested;
     wxString                    m_fp_override;
 
diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp
index d6a3065b0..e8d1d9d64 100644
--- a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp
+++ b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp
@@ -1,7 +1,7 @@
 /*
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
- * Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 2004-2018 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
@@ -287,7 +287,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnSelectChipName( wxCommandEvent& event
 {
     SCH_BASE_FRAME::HISTORY_LIST dummy;
 
-    auto sel = GetParent()->SelectComponentFromLibrary( NULL, dummy, true, 0, 0 );
+    auto sel = GetParent()->SelectComponentFromLibrary( NULL, dummy, true, 0, 0, false );
 
     if( !sel.LibId.IsValid() )
         return;
diff --git a/eeschema/dialogs/dialog_edit_components_libid.cpp b/eeschema/dialogs/dialog_edit_components_libid.cpp
index 71989c40c..fd9064513 100644
--- a/eeschema/dialogs/dialog_edit_components_libid.cpp
+++ b/eeschema/dialogs/dialog_edit_components_libid.cpp
@@ -2,7 +2,7 @@
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
  * Copyright 2017 Jean-Pierre Charras, jp.charras@xxxxxxxxxx
- * Copyright 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright 1992-2018 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
@@ -511,7 +511,7 @@ bool DIALOG_EDIT_COMPONENTS_LIBID::setLibIdByBrowser( int aRow )
     // Use dialog symbol selector to choose a symbol
     SCH_BASE_FRAME::HISTORY_LIST dummy;
     SCH_BASE_FRAME::COMPONENT_SELECTION sel =
-                m_parent->SelectComponentFromLibrary( NULL, dummy, true, 0, 0 );
+                m_parent->SelectComponentFromLibrary( NULL, dummy, true, 0, 0, false );
 #else
     // Use library viewer to choose a symbol
     LIB_ID aPreselectedLibid;
diff --git a/eeschema/dialogs/dialog_eeschema_options.h b/eeschema/dialogs/dialog_eeschema_options.h
index 1304383cb..6206dffcc 100644
--- a/eeschema/dialogs/dialog_eeschema_options.h
+++ b/eeschema/dialogs/dialog_eeschema_options.h
@@ -2,7 +2,7 @@
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
  * Copyright (C) 2009 Wayne Stambaugh <stambaughw@xxxxxxxxxxx>
- * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 1992-2018 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
@@ -336,6 +336,18 @@ public:
      */
     bool GetShowPageLimits( void ) { return m_checkPageLimits->GetValue(); }
 
+    /**
+     * Function
+     * Set the FootprintPreview setting in the dialog.
+     */
+    void SetFootprintPreview( bool show ) { m_footprintPreview->SetValue( show ); }
+
+    /**
+     * Function
+     * Return the current FootprintPreview setting from the dialog
+     */
+    bool GetFootprintPreview( void ) { return m_footprintPreview->GetValue(); }
+
     /**
      * Function
      * Set the AutoplaceFields setting in the dialog
diff --git a/eeschema/dialogs/dialog_eeschema_options_base.cpp b/eeschema/dialogs/dialog_eeschema_options_base.cpp
index 905ec93c8..ecc576994 100644
--- a/eeschema/dialogs/dialog_eeschema_options_base.cpp
+++ b/eeschema/dialogs/dialog_eeschema_options_base.cpp
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Nov 22 2017)
+// C++ code generated with wxFormBuilder (version Jan  2 2018)
 // http://www.wxformbuilder.org/
 //
 // PLEASE DO *NOT* EDIT THIS FILE!
@@ -109,6 +109,9 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx
 	m_checkPageLimits->SetValue(true); 
 	bSizer92->Add( m_checkPageLimits, 0, wxEXPAND|wxLEFT|wxTOP|wxRIGHT, 3 );
 	
+	m_footprintPreview = new wxCheckBox( m_panel5, wxID_ANY, _("Footprint previews in symbol chooser (experimental)"), wxDefaultPosition, wxDefaultSize, 0 );
+	bSizer92->Add( m_footprintPreview, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 3 );
+	
 	
 	bSizer82->Add( bSizer92, 0, wxALL|wxEXPAND, 5 );
 	
diff --git a/eeschema/dialogs/dialog_eeschema_options_base.fbp b/eeschema/dialogs/dialog_eeschema_options_base.fbp
index 704678939..ecbbd827e 100644
--- a/eeschema/dialogs/dialog_eeschema_options_base.fbp
+++ b/eeschema/dialogs/dialog_eeschema_options_base.fbp
@@ -1670,6 +1670,94 @@
                                                             <event name="OnUpdateUI"></event>
                                                         </object>
                                                     </object>
+                                                    <object class="sizeritem" expanded="1">
+                                                        <property name="border">3</property>
+                                                        <property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
+                                                        <property name="proportion">0</property>
+                                                        <object class="wxCheckBox" expanded="1">
+                                                            <property name="BottomDockable">1</property>
+                                                            <property name="LeftDockable">1</property>
+                                                            <property name="RightDockable">1</property>
+                                                            <property name="TopDockable">1</property>
+                                                            <property name="aui_layer"></property>
+                                                            <property name="aui_name"></property>
+                                                            <property name="aui_position"></property>
+                                                            <property name="aui_row"></property>
+                                                            <property name="best_size"></property>
+                                                            <property name="bg"></property>
+                                                            <property name="caption"></property>
+                                                            <property name="caption_visible">1</property>
+                                                            <property name="center_pane">0</property>
+                                                            <property name="checked">0</property>
+                                                            <property name="close_button">1</property>
+                                                            <property name="context_help"></property>
+                                                            <property name="context_menu">1</property>
+                                                            <property name="default_pane">0</property>
+                                                            <property name="dock">Dock</property>
+                                                            <property name="dock_fixed">0</property>
+                                                            <property name="docking">Left</property>
+                                                            <property name="enabled">1</property>
+                                                            <property name="fg"></property>
+                                                            <property name="floatable">1</property>
+                                                            <property name="font"></property>
+                                                            <property name="gripper">0</property>
+                                                            <property name="hidden">0</property>
+                                                            <property name="id">wxID_ANY</property>
+                                                            <property name="label">Footprint previews in symbol chooser (experimental)</property>
+                                                            <property name="max_size"></property>
+                                                            <property name="maximize_button">0</property>
+                                                            <property name="maximum_size"></property>
+                                                            <property name="min_size"></property>
+                                                            <property name="minimize_button">0</property>
+                                                            <property name="minimum_size"></property>
+                                                            <property name="moveable">1</property>
+                                                            <property name="name">m_footprintPreview</property>
+                                                            <property name="pane_border">1</property>
+                                                            <property name="pane_position"></property>
+                                                            <property name="pane_size"></property>
+                                                            <property name="permission">protected</property>
+                                                            <property name="pin_button">1</property>
+                                                            <property name="pos"></property>
+                                                            <property name="resize">Resizable</property>
+                                                            <property name="show">1</property>
+                                                            <property name="size"></property>
+                                                            <property name="style"></property>
+                                                            <property name="subclass">; forward_declare</property>
+                                                            <property name="toolbar_pane">0</property>
+                                                            <property name="tooltip"></property>
+                                                            <property name="validator_data_type"></property>
+                                                            <property name="validator_style">wxFILTER_NONE</property>
+                                                            <property name="validator_type">wxDefaultValidator</property>
+                                                            <property name="validator_variable"></property>
+                                                            <property name="window_extra_style"></property>
+                                                            <property name="window_name"></property>
+                                                            <property name="window_style"></property>
+                                                            <event name="OnChar"></event>
+                                                            <event name="OnCheckBox"></event>
+                                                            <event name="OnEnterWindow"></event>
+                                                            <event name="OnEraseBackground"></event>
+                                                            <event name="OnKeyDown"></event>
+                                                            <event name="OnKeyUp"></event>
+                                                            <event name="OnKillFocus"></event>
+                                                            <event name="OnLeaveWindow"></event>
+                                                            <event name="OnLeftDClick"></event>
+                                                            <event name="OnLeftDown"></event>
+                                                            <event name="OnLeftUp"></event>
+                                                            <event name="OnMiddleDClick"></event>
+                                                            <event name="OnMiddleDown"></event>
+                                                            <event name="OnMiddleUp"></event>
+                                                            <event name="OnMotion"></event>
+                                                            <event name="OnMouseEvents"></event>
+                                                            <event name="OnMouseWheel"></event>
+                                                            <event name="OnPaint"></event>
+                                                            <event name="OnRightDClick"></event>
+                                                            <event name="OnRightDown"></event>
+                                                            <event name="OnRightUp"></event>
+                                                            <event name="OnSetFocus"></event>
+                                                            <event name="OnSize"></event>
+                                                            <event name="OnUpdateUI"></event>
+                                                        </object>
+                                                    </object>
                                                 </object>
                                             </object>
                                         </object>
diff --git a/eeschema/dialogs/dialog_eeschema_options_base.h b/eeschema/dialogs/dialog_eeschema_options_base.h
index d8d6da01a..04e8691a1 100644
--- a/eeschema/dialogs/dialog_eeschema_options_base.h
+++ b/eeschema/dialogs/dialog_eeschema_options_base.h
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Nov 22 2017)
+// C++ code generated with wxFormBuilder (version Jan  2 2018)
 // http://www.wxformbuilder.org/
 //
 // PLEASE DO *NOT* EDIT THIS FILE!
@@ -76,6 +76,7 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
 		wxCheckBox* m_checkHVOrientation;
 		wxCheckBox* m_checkShowHiddenPins;
 		wxCheckBox* m_checkPageLimits;
+		wxCheckBox* m_footprintPreview;
 		wxPanel* m_panel3;
 		wxStaticText* m_staticText2;
 		wxChoice* m_choiceUnits;
diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp
index 7e4a1c0c3..be2de0c73 100644
--- a/eeschema/eeschema_config.cpp
+++ b/eeschema/eeschema_config.cpp
@@ -1,7 +1,7 @@
 /*
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
- * Copyright (C) 2014-2017 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 2014-2018 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
@@ -250,6 +250,7 @@ void SCH_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event )
     dlg.SetEnableAutoPan( m_canvas->GetEnableAutoPan() );
     dlg.SetEnableHVBusOrientation( GetForceHVLines() );
     dlg.SetShowPageLimits( m_showPageLimits );
+    dlg.SetFootprintPreview( m_footprintPreview );
     dlg.SetAutoplaceFields( m_autoplaceFields );
     dlg.SetAutoplaceJustify( m_autoplaceJustify );
     dlg.SetAutoplaceAlign( m_autoplaceAlign );
@@ -302,6 +303,7 @@ void SCH_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event )
     m_autoplaceFields = dlg.GetAutoplaceFields();
     m_autoplaceJustify = dlg.GetAutoplaceJustify();
     m_autoplaceAlign = dlg.GetAutoplaceAlign();
+    m_footprintPreview = dlg.GetFootprintPreview();
 
     // Delete all template fieldnames and then restore them using the template field data from
     // the options dialog
@@ -428,6 +430,7 @@ const wxChar RescueNeverShowEntry[] =               wxT( "RescueNeverShow" );
 const wxChar AutoplaceFieldsEntry[] =               wxT( "AutoplaceFields" );
 const wxChar AutoplaceJustifyEntry[] =              wxT( "AutoplaceJustify" );
 const wxChar AutoplaceAlignEntry[] =                wxT( "AutoplaceAlign" );
+static const wxChar FootprintPreviewEntry[] =       wxT( "FootprintPreview" );
 static const wxChar DefaultBusWidthEntry[] =        wxT( "DefaultBusWidth" );
 static const wxChar DefaultDrawLineWidthEntry[] =   wxT( "DefaultDrawLineWidth" );
 static const wxChar ShowHiddenPinsEntry[] =         wxT( "ShowHiddenPins" );
@@ -521,6 +524,7 @@ void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
     aCfg->Read( AutoplaceFieldsEntry, &m_autoplaceFields, true );
     aCfg->Read( AutoplaceJustifyEntry, &m_autoplaceJustify, true );
     aCfg->Read( AutoplaceAlignEntry, &m_autoplaceAlign, false );
+    aCfg->Read( FootprintPreviewEntry, &m_footprintPreview, false );
 
     // Load print preview window session settings.
     aCfg->Read( PreviewFramePositionXEntry, &tmp, -1 );
@@ -614,6 +618,7 @@ void SCH_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
     aCfg->Write( AutoplaceFieldsEntry, m_autoplaceFields );
     aCfg->Write( AutoplaceJustifyEntry, m_autoplaceJustify );
     aCfg->Write( AutoplaceAlignEntry, m_autoplaceAlign );
+    aCfg->Write( FootprintPreviewEntry, m_footprintPreview );
 
     // Save print preview window session settings.
     aCfg->Write( PreviewFramePositionXEntry, m_previewPosition.x );
diff --git a/eeschema/getpart.cpp b/eeschema/getpart.cpp
index fc490109a..b25b62edd 100644
--- a/eeschema/getpart.cpp
+++ b/eeschema/getpart.cpp
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
  * Copyright (C) 2008 Wayne Stambaugh <stambaughw@xxxxxxxxx>
- * Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 2004-2018 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
@@ -105,8 +105,9 @@ SCH_BASE_FRAME::COMPONENT_SELECTION SCH_BASE_FRAME::SelectComponentFromLibrary(
         bool                                aUseLibBrowser,
         int                                 aUnit,
         int                                 aConvert,
+        bool                                aShowFootprints,
         const LIB_ID*                       aHighlight,
-        bool                                aAllowFields )
+        bool                                aAllowFields)
 {
     wxString          dialogTitle;
     SYMBOL_LIB_TABLE* libs = Prj().SchSymbolLibTable();
@@ -159,7 +160,7 @@ SCH_BASE_FRAME::COMPONENT_SELECTION SCH_BASE_FRAME::SelectComponentFromLibrary(
         adapter->SetPreselectNode( *aHighlight, /* aUnit */ 0 );
 
     dialogTitle.Printf( _( "Choose Symbol (%d items loaded)" ), adapter->GetComponentsCount() );
-    DIALOG_CHOOSE_COMPONENT dlg( this, dialogTitle, adapter, aConvert, aAllowFields );
+    DIALOG_CHOOSE_COMPONENT dlg( this, dialogTitle, adapter, aConvert, aAllowFields, aShowFootprints );
 
     if( dlg.ShowQuasiModal() == wxID_CANCEL )
         return COMPONENT_SELECTION();
@@ -212,7 +213,8 @@ SCH_COMPONENT* SCH_EDIT_FRAME::Load_Component( wxDC*                          aD
     SetRepeatItem( NULL );
     m_canvas->SetIgnoreMouseEvents( true );
 
-    auto sel = SelectComponentFromLibrary( aFilter, aHistoryList, aUseLibBrowser, 1, 1 );
+    auto sel = SelectComponentFromLibrary( aFilter, aHistoryList, aUseLibBrowser, 1, 1,
+                                           m_footprintPreview );
 
     if( !sel.LibId.IsValid() )
     {
diff --git a/eeschema/sch_base_frame.h b/eeschema/sch_base_frame.h
index aeebb7a2e..47b0472f3 100644
--- a/eeschema/sch_base_frame.h
+++ b/eeschema/sch_base_frame.h
@@ -1,10 +1,8 @@
-#ifndef SCH_BASE_FRAME_H_
-#define SCH_BASE_FRAME_H_
 /*
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
  * Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <dick@xxxxxxxxxxx>
- * Copyright (C) 2015-2017 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 2015-2018 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
@@ -24,6 +22,9 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
  */
 
+#ifndef SCH_BASE_FRAME_H_
+#define SCH_BASE_FRAME_H_
+
 #include <lib_id.h>
 #include <draw_frame.h>
 
@@ -188,6 +189,7 @@ public:
      * @param aConvert           preselected De Morgan shape
      * @param aHighlight         name of component to highlight in the list.
      *                           highlights none if there isn't one by that name
+     * @param aShowFootprints    whether to show footprints in the dialog
      * @param aAllowFields       whether to allow field editing in the dialog
      *
      * @return the selected component
@@ -198,6 +200,7 @@ public:
             bool                                aUseLibBrowser,
             int                                 aUnit,
             int                                 aConvert,
+            bool                                aShowFootprints,
             const LIB_ID*                       aHighlight = nullptr,
             bool                                aAllowFields = true );
 
diff --git a/eeschema/schframe.h b/eeschema/schframe.h
index e727e6cee..78410407b 100644
--- a/eeschema/schframe.h
+++ b/eeschema/schframe.h
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 2015 Jean-Pierre Charras, jp.charras wanadoo.fr
  * Copyright (C) 2008 Wayne Stambaugh <stambaughw@xxxxxxxxx>
- * Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 2004-2018 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
@@ -155,6 +155,7 @@ private:
     bool                    m_autoplaceFields;    ///< automatically place component fields
     bool                    m_autoplaceJustify;   ///< allow autoplace to change justification
     bool                    m_autoplaceAlign;     ///< align autoplaced fields to the grid
+    bool                    m_footprintPreview;   ///< whether to show footprint previews
 
     /// An index to the last find item in the found items list #m_foundItems.
     int         m_foundItemIndex;
diff --git a/eeschema/viewlibs.cpp b/eeschema/viewlibs.cpp
index 3d1de7c53..58367d51a 100644
--- a/eeschema/viewlibs.cpp
+++ b/eeschema/viewlibs.cpp
@@ -2,7 +2,7 @@
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
  * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
- * Copyright (C) 2015-2017 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 2015-2018 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
@@ -58,7 +58,7 @@ void LIB_VIEW_FRAME::OnSelectSymbol( wxCommandEvent& aEvent )
 
     dialogTitle.Printf( _( "Choose Component (%d items loaded)" ),
                         adapter->GetComponentsCount() );
-    DIALOG_CHOOSE_COMPONENT dlg( this, dialogTitle, adapter, m_convert, false );
+    DIALOG_CHOOSE_COMPONENT dlg( this, dialogTitle, adapter, m_convert, false, false );
 
     if( dlg.ShowQuasiModal() == wxID_CANCEL )
         return;
-- 
2.15.1


Follow ups