← Back to team overview

kicad-developers team mailing list archive

eeschema add/insert lib dialog.


--Boundary-01=_ElJ/HnqgVEZCJry Content-Type: text/plain;
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hello all:

I've tried sending this e-mail, but I was unable till now. BTW, I think i=
still fully applicable.

Having being able finally to have a debian package for kicad using cmake=
thanks to the effort of the Debian Kicad packagers, I've now entered into=20
real testing stage at last.

For the moment I haven't seen much of the new movements in the code that =
been certainly numerous these last months, I simply hadn't the time yet. Bu=
what I saw is that when I go into the lib selection dialog in eeschema and =
don't choose a lib file living in the kicad library path, this library can'=
be used beacuse the full path isn't used anymore, just the file name.

IMHO, the full patch should be keep (as it used to) when the file is not =
the default kicad library path.

The problem seems to be that the path of the file is not taken into accou=
anymore. Going back into svn history, I see that the relevant change happen=
at r636 by JP Charras, specifically with the patch I'm attaching, whose=20
revertion causes restablishment of the former behaviour which I=20
consider "working"

I couldn't find an explanation or the aim for doing this change on either=
the commit message or changelog, but it looks like as the EDA_FileSelector=
function were going to be deprecated. I can see some references to it in=20
other places and according to its name looks like a high-level function=20
(abstraction) that maybe should be continued used unless there's a change i=
the design concept.

I'm new to the development of this software, so maybe I've lost some=20
details. I would appreciate if someone could shed some light into this issu=

Ra=C3=BAl S=C3=A1nchez Siles
Ra=C3=BAl S=C3=A1nchez Siles
Barracuda Systems S.L.
C/ Luxemburgo, 4 - Local
Pozuelo de Alarc=C3=B3n
28224 Madrid
Tlf.: +34 91 351 11 20
Fax: +34 91 352 54 44

Nota: Si advierte una archivo adjunto con nombre de la forma=20
attxxxx.dat se trata de mi firma digital. Existen lectores=20
de correo electr=C3=B3nico capaces de interpretar esta informaci=C3=B3n.
Si el suyo no la entiende, no se preocupe, no es importante.

Este mensaje se dirige exclusivamente a su destinatario y puede contener=20
informaci=C3=B3n privilegiada o confidencial. Si no es vd. el destinatario=
indicado, queda notificado de que la utilizaci=C3=B3n, divulgaci=C3=B3n y/o=
copia sin=20
autorizaci=C3=B3n est=C3=A1 prohibida en virtud de la legislaci=C3=B3n vige=
nte. Si ha=20
recibido este mensaje por error, le rogamos que nos lo comunique=20
inmediatamente por esta misma v=C3=ADa y proceda a su destrucci=C3=B3n.

This message is intended exclusively for its addressee and may contain=20
information that is CONFIDENTIAL and protected by professional privilege. I=
you are not the intended recipient you are hereby notified that any=20
dissemination, copy or disclosure of this communication is strictly=20
prohibited by law. If this message has been received in error, please=20
immediately notify us via e-mail and delete it.
 --Boundary-01=_ElJ/HnqgVEZCJry Content-Type: text/x-diff;
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;

Index: dialog_eeschema_config.cpp
=2D-- dialog_eeschema_config.cpp	(revisi=C3=B3n: 445)
+++ dialog_eeschema_config.cpp	(revisi=C3=B3n: 636)
@@ -364,31 +364,38 @@
Mask =3D wxT("*") + g_LibExtBuffer;
=2D	FullLibName =3D EDA_FileSelector( _("Library files:"),
=2D	g_RealLibDirBuffer,	/* Chemin par defaut */
=2D	wxEmptyString,	/* nom fichier par defaut */
=2D	g_LibExtBuffer,	/* extension par defaut */
=2D	Mask,	/* Masque d'affichage */
=2D	this,
=2D	wxFD_OPEN,
=2D	);
+	wxFileDialog FilesDialog(this, _("Library files:"), g_RealLibDirBuffer,
+	wxEmptyString, Mask,
=2D	if ( FullLibName.IsEmpty() ) return;
+	FilesDialog.ShowModal();
+	wxArrayString Filenames;
+	FilesDialog.GetFilenames(Filenames);
+	for ( unsigned jj =3D 0; jj < Filenames.GetCount(); jj ++ )
+	{
+	FullLibName =3D Filenames[jj];
+	ShortLibName =3D MakeReducedFileName(FullLibName,g_RealLibDirBuffer,g_Li=
+	if ( ShortLibName.IsEmpty() )	//Just in case...
+	continue;
+	//Add or insert new library name
+	if (FindLibrary(ShortLibName) =3D=3D NULL)
+	{
+	m_LibListChanged =3D TRUE;
+	g_LibName_List.Insert(ShortLibName, ii);
+	m_ListLibr->Clear();
+	m_ListLibr->InsertItems(g_LibName_List, 0);
+	}
=2D	ShortLibName =3D MakeReducedFileName(FullLibName,g_RealLibDirBuffer,g_L=
=2D	//Add or insert new library name
=2D	if (FindLibrary(ShortLibName) =3D=3D NULL)
=2D	{
=2D	m_LibListChanged =3D TRUE;
=2D	g_LibName_List.Insert(ShortLibName, ii);
=2D	m_ListLibr->Clear();
=2D	m_ListLibr->InsertItems(g_LibName_List, 0);
+	else
+	{
+	wxString msg;
+	msg << wxT("<") << ShortLibName << wxT("> : ") << _("Library already in=
+	DisplayError(this, msg);
+	}
=2D	else DisplayError(this, _("Library already in use"));
 --Boundary-01=_ElJ/HnqgVEZCJry----nextPart1577666.i8hhCHHGqB Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

[Attachment content not displayed.] --nextPart1577666.i8hhCHHGqB-- 

Follow ups