Commit 7cf34678 authored by Dick Hollenbeck's avatar Dick Hollenbeck

Show the "Description" field from fp-lib-table in pcbnew's module editor 'set...

Show the "Description" field from fp-lib-table in pcbnew's module editor 'set current library' dialog.
parent 25bfd822
...@@ -6,8 +6,6 @@ cmake_minimum_required( VERSION 2.8.4 FATAL_ERROR ) ...@@ -6,8 +6,6 @@ cmake_minimum_required( VERSION 2.8.4 FATAL_ERROR )
# Path to local CMake modules. # Path to local CMake modules.
set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules ) set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules )
message( STATUS "CMAKE_CXX_FLAGS_DEBUG:${CMAKE_CXX_FLAGS_DEBUG}" )
# #
# KiCad build options should be added below. # KiCad build options should be added below.
# #
......
...@@ -159,7 +159,7 @@ set(COMMON_SRCS ...@@ -159,7 +159,7 @@ set(COMMON_SRCS
math/math_util.cpp math/math_util.cpp
system/fcontext.s system/fcontext.s
tool/tool_base.cpp tool/tool_base.cpp
tool/tool_manager.cpp tool/tool_manager.cpp
tool/tool_dispatcher.cpp tool/tool_dispatcher.cpp
...@@ -231,7 +231,7 @@ set(PCB_COMMON_SRCS ...@@ -231,7 +231,7 @@ set(PCB_COMMON_SRCS
) )
set(PCB_COMMON_SRCS set(PCB_COMMON_SRCS
${PCB_COMMON_SRCS} ${PCB_COMMON_SRCS}
../pcbnew/pcb_painter.cpp ../pcbnew/pcb_painter.cpp
) )
......
...@@ -81,7 +81,7 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl ...@@ -81,7 +81,7 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl
m_filterBox->SetFocus(); m_filterBox->SetFocus();
Layout(); Fit();
} }
......
...@@ -139,6 +139,17 @@ bool FP_LIB_TABLE::IsFootprintLibWritable( const wxString& aNickname ) ...@@ -139,6 +139,17 @@ bool FP_LIB_TABLE::IsFootprintLibWritable( const wxString& aNickname )
} }
const wxString& FP_LIB_TABLE::GetDescription( const wxString& aNickname )
{
// use no exception form of find row:
const ROW* row = findRow( aNickname );
if( row )
return row->description;
else
return wxEmptyString;
}
void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR ) void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR )
{ {
/* /*
......
...@@ -462,6 +462,12 @@ public: ...@@ -462,6 +462,12 @@ public:
//-----</PLUGIN API SUBSET, REBASED ON aNickname>--------------------------- //-----</PLUGIN API SUBSET, REBASED ON aNickname>---------------------------
/**
* Function GetDescription
* returns the library desicription from @a aNickname, or an empty string
* if aNickname does not exist.
*/
const wxString& GetDescription( const wxString& aNickname );
/** /**
* Function InsertRow * Function InsertRow
...@@ -604,10 +610,10 @@ protected: ...@@ -604,10 +610,10 @@ protected:
/** /**
* Function findRow * Function findRow
* returns a ROW if aNickName is found in this table or in any chained * returns a ROW if aNickname is found in this table or in any chained
* fallBack table fragment, else NULL. * fallBack table fragment, else NULL.
*/ */
ROW* findRow( const wxString& aNickName ) const; ROW* findRow( const wxString& aNickname ) const;
void reindex() void reindex()
{ {
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
#define FMT_LIBRARY _( "Library" ) // window title #define FMT_LIBRARY _( "Library" ) // window title
#define FMT_MOD_EXISTS _( "Module %s already exists in library <%s>" ) #define FMT_MOD_EXISTS _( "Module %s already exists in library <%s>" )
#define FMT_NO_REF_ABORTED _( "No reference, aborted" ) #define FMT_NO_REF_ABORTED _( "No reference, aborted" )
#define FMT_SELECT_LIB _( "Select Active Library:" ) #define FMT_SELECT_LIB _( "Select Active Library" )
static const wxString ModExportFileWildcard( _( "KiCad foot print export files (*.emp)|*.emp" ) ); static const wxString ModExportFileWildcard( _( "KiCad foot print export files (*.emp)|*.emp" ) );
...@@ -800,19 +800,21 @@ void FOOTPRINT_EDIT_FRAME::Select_Active_Library() ...@@ -800,19 +800,21 @@ void FOOTPRINT_EDIT_FRAME::Select_Active_Library()
void FOOTPRINT_EDIT_FRAME::Select_Active_Library() void FOOTPRINT_EDIT_FRAME::Select_Active_Library()
{ {
if( m_footprintLibTable->IsEmpty() )
return;
wxArrayString headers; wxArrayString headers;
headers.Add( _( "Library" ) );
headers.Add( _( "Nickname" ) );
headers.Add( _( "Description" ) );
std::vector< wxArrayString > itemsToDisplay; std::vector< wxArrayString > itemsToDisplay;
std::vector< wxString > libNames = m_footprintLibTable->GetLogicalLibs(); std::vector< wxString > nicknames = m_footprintLibTable->GetLogicalLibs();
for( unsigned i = 0; i < libNames.size(); i++ ) for( unsigned i = 0; i < nicknames.size(); i++ )
{ {
wxArrayString item; wxArrayString item;
item.Add( libNames[i] );
item.Add( nicknames[i] );
item.Add( m_footprintLibTable->GetDescription( nicknames[i] ) );
itemsToDisplay.push_back( item ); itemsToDisplay.push_back( item );
} }
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <wx/wx.h> #include <wx/wx.h>
#include <pcb_plot_params.h> #include <pcb_plot_params.h>
#include <pcb_plot_params_lexer.h>
#include <layers_id_colors_and_visibility.h> #include <layers_id_colors_and_visibility.h>
#include <plot_common.h> #include <plot_common.h>
#include <macros.h> #include <macros.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment