*) Add PLUGIN::FootprintLibOptions( PROPERTIES* ), and extend DIALOG_FP_PLUGIN_OPTIONS to use it.

*) Move button handlers to LEFT MOUSE CLICK from COMMAND events, so wxGrid focus is not lost.
*) Sketch out the concept of COW support for the GITHUB_PLUGIN in its @todo.
This commit is contained in:
Dick Hollenbeck
2013-11-11 18:17:27 -06:00
parent 1f1a88534e
commit 76fed4f995
12 changed files with 362 additions and 149 deletions
+21
View File
@@ -35,6 +35,9 @@
from RAM as needed. Therefore the PLUGIN is read only for accessing
remote pretty libraries. If you want to support writing to the repo, then you
could use the above API.
@todo: Derive this PLUGIN from KICAD_PLUGIN so we can use its FootprintSave().
*/
#ifdef WIN32
@@ -50,6 +53,7 @@
#include <wx/zipstrm.h>
#include <wx/mstream.h>
#include <wx/uri.h>
//#include <wx/strconv.h>
#include <fctsys.h>
// Under Windows Mingw/msys, avhttp.hpp should be included after fctsys.h
@@ -173,6 +177,23 @@ bool GITHUB_PLUGIN::IsFootprintLibWritable( const wxString& aLibraryPath )
}
void GITHUB_PLUGIN::FootprintLibOptions( PROPERTIES* aListToAppendTo ) const
{
// inherit options supported by all PLUGINs.
PLUGIN::FootprintLibOptions( aListToAppendTo );
(*aListToAppendTo)["allow_pretty_writing_to_this_dir"] = wxString(
_( "Set this property to a directory where footprints are written to.\n"
"The directory should have a 'pretty' extension"
)).utf8_str();
(*aListToAppendTo)["cache_github_zip_in_this_dir"] = wxString(
_( "Set this property to a directory where the github *.zip file will be cached.\n"
"This should speed up subsequent visits to this library."
)).utf8_str();
}
void GITHUB_PLUGIN::cacheLib( const wxString& aLibraryPath ) throw( IO_ERROR )
{
if( !m_cache || m_lib_path != aLibraryPath )