From df8dc01e8d9c9ae29d0e9f02fdd758c6d3a2ab7f Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 13 Nov 2017 22:12:49 +0100 Subject: [PATCH] Library Manager & Editor: comments --- eeschema/lib_manager.h | 1 + eeschema/libeditframe.h | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/eeschema/lib_manager.h b/eeschema/lib_manager.h index 39f4f67858..55b63c514e 100644 --- a/eeschema/lib_manager.h +++ b/eeschema/lib_manager.h @@ -96,6 +96,7 @@ public: /** * Updates the part buffer with a new version of the part. + * The library buffer creates a copy of the part. * It is required to save the library to use the updated part in the schematic editor. */ bool UpdatePart( LIB_PART* aPart, const wxString& aLibrary, wxString aOldName = wxEmptyString ); diff --git a/eeschema/libeditframe.h b/eeschema/libeditframe.h index a92a2a81d9..dc5e68c5fe 100644 --- a/eeschema/libeditframe.h +++ b/eeschema/libeditframe.h @@ -691,35 +691,43 @@ public: */ SYMBOL_LIB_TABLE* SelectSymLibTable(); +private: ///> Helper screen used when no part is loaded SCH_SCREEN* m_dummyScreen; ///> Creates a backup copy of a file with requested extension bool backupFile( const wxFileName& aOriginalFile, const wxString& aBackupExt ); - // TODO - // TODO move to tree pane? + ///> Returns currently edited part. LIB_PART* getTargetPart() const; + ///> Returns either the part selected in the component tree, if context menu is active + ///> or the currently modified part. LIB_ID getTargetLibId() const; + ///> Returns either the library selected in the component tree, if context menu is active + ///> or the library that is currently modified. + wxString getTargetLib() const; + ///> Returns true when the operation has succeded (all requested libraries have been saved or ///> none was selected and confirmed by OK). bool saveAllLibraries(); - wxString getTargetLib() const; - + ///> Creates or adds an existing library to the symbol library table. bool addLibraryFile( bool aCreateNew ); + ///> Displays a file browser dialog to select a library file. wxFileName getLibraryFileName( bool aExisting ); + ///> Stores the currently modified part in the library manager buffer. void storeCurrentPart(); + ///> Returns true if currently modified part has the same LIB_ID. bool isCurrentPart( const LIB_ID& aLibId ) const; + ///> Restores the empty editor screen, without any part or library selected. void emptyScreen(); -private: ///> Renames LIB_PART aliases to avoid conflicts before adding a component to a library void fixDuplicateAliases( LIB_PART* aPart, const wxString& aLibrary );