35wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER>
40 return wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER>( adapter );
67#define PROGRESS_INTERVAL_MILLIS 120
70 std::function<
void(
int,
int,
const wxString& )> aProgressCallback )
80 const wxString&
name = it->get()->m_Name;
82 if( wxGetUTCTimeMillis() > nextUpdate )
84 aProgressCallback( i, max,
name );
95 ||
name == aForceRefresh )
118 if( wxGetUTCTimeMillis() > nextUpdate )
120 aProgressCallback( i++, max, libName );
170 auto aliasIt = std::find_if( aliases.begin(), aliases.end(),
173 return a->GetName() == (*nodeIt)->m_LibId.GetLibItemName();
176 if( aliasIt != aliases.end() )
181 aliases.erase( aliasIt );
201LIB_TREE_NODE::PTR_VECTOR::iterator
212 unsigned int aCol )
const
216 aVariant = wxEmptyString;
238 aVariant = aVariant.GetString() +
" *";
243 aVariant = aVariant.GetString() +
" *";
260 aVariant =
_(
"(failed to load)" ) + wxS(
" " ) + aVariant.GetString();
271 aVariant = node->
m_Fields.at( key );
272 else if( key == wxT(
"Description" ) )
275 aVariant = wxEmptyString;
283 wxDataViewItemAttr& aAttr )
const
289 wxCHECK( node,
false );
294 aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
316 aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
318 aAttr.SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
319 aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT ) );
337 aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
339 aAttr.SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
340 aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT ) );
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Symbol library management helper that is specific to the symbol library editor frame.
Define a library symbol object.
LIB_ID GetLibId() const override
wxString GetDescription() override
const wxString & GetDescr() const
Return the description of the library referenced by this row.
LIB_TREE_NODE_ROOT m_tree
LIB_TREE_NODE_LIB & DoAddLibraryNode(const wxString &aNodeName, const wxString &aDesc, bool pinned)
static LIB_TREE_NODE * ToNode(wxDataViewItem aItem)
Convert wxDataViewItem -> #SYM_TREE_NODE.
static const wxString GetPinningSymbol()
@ NAME_COL
Library or library item name column.
std::map< unsigned, wxString > m_colIdxMap
virtual int GetLibrariesCount() const
Return the number of libraries loaded in the tree.
LIB_TREE_NODE_LIB_ID & AddItem(LIB_TREE_ITEM *aItem)
Construct a new alias node, add it to this library, and return it.
Model class in the component selector Model-View-Adapter (mediated MVC) architecture.
std::map< wxString, wxString > m_Fields
List of weighted search terms.
void AssignIntrinsicRanks(bool presorted=false)
Store intrinsic ranks on all children of this node.
The backing store for a PROJECT, in JSON format.
virtual PROJECT_FILE & GetProjectFile() const
Handle actions for the various symbol editor and viewers.
The symbol library editor main window.
LIB_SYMBOL * GetCurSymbol() const
Return the current symbol being edited or NULL if none selected.
LIB_SYMBOL_LIBRARY_MANAGER & GetLibManager()
Class to handle modifications to the symbol libraries.
bool LibraryExists(const wxString &aLibrary, bool aCheckEnabled=false) const
Return true if library exists.
bool IsLibraryModified(const wxString &aLibrary) const
Return true if library has unsaved modifications.
wxArrayString GetLibraryNames() const
Return the array of library names.
bool IsSymbolModified(const wxString &aAlias, const wxString &aLibrary) const
Return true if symbol has unsaved modifications.
bool IsLibraryLoaded(const wxString &aLibrary) const
Return true if the library was successfully loaded.
int GetLibraryHash(const wxString &aLibrary) const
Return a library hash value to determine if it has changed.
SYMBOL_LIB_TABLE_ROW * GetLibrary(const wxString &aLibrary) const
Find a single library within the (aggregate) library table.
std::list< LIB_SYMBOL * > GetAliases(const wxString &aLibrary) const
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
LIB_TREE_NODE::PTR_VECTOR::iterator deleteLibrary(LIB_TREE_NODE::PTR_VECTOR::iterator &aLibNodeIt)
SYMBOL_LIBRARY_MANAGER * m_libMgr
Hashes to decide whether a library needs an update.
void GetValue(wxVariant &aVariant, wxDataViewItem const &aItem, unsigned int aCol) const override
SYMBOL_EDIT_FRAME * m_frame
bool GetAttr(wxDataViewItem const &aItem, unsigned int aCol, wxDataViewItemAttr &aAttr) const override
static wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > Create(SYMBOL_EDIT_FRAME *aParent, SYMBOL_LIBRARY_MANAGER *aLibs)
int GetLibrariesCount() const override
Return the number of libraries loaded in the tree.
void Sync(const wxString &aForceRefresh, std::function< void(int, int, const wxString &)> aProgressCallback)
TOOL_INTERACTIVE * GetContextMenuTool() override
bool IsContainer(const wxDataViewItem &aItem) const override
void updateLibrary(LIB_TREE_NODE_LIB &aLibNode)
std::map< wxString, int > m_libHashes
SYMBOL_LIBRARY_MANAGER hash value returned in the last synchronization.
SYMBOL_TREE_SYNCHRONIZING_ADAPTER(SYMBOL_EDIT_FRAME *aParent, SYMBOL_LIBRARY_MANAGER *aLibMgr)
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
wxString UnescapeString(const wxString &aSource)
std::vector< wxString > pinned_symbol_libs
#define PROGRESS_INTERVAL_MILLIS