← Back to team overview

kicad-developers team mailing list archive

eeschema add/insert lib dialog.

 

--Boundary-01=_ElJ/HnqgVEZCJry Content-Type: text/plain;
charset="utf-8"
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=
t's=20
still fully applicable.

Having being able finally to have a debian package for kicad using cmake=
=20
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 =
has=20
been certainly numerous these last months, I simply hadn't the time yet. Bu=
t=20
what I saw is that when I go into the lib selection dialog in eeschema and =
I=20
don't choose a lib file living in the kicad library path, this library can'=
t=20
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 =
in=20
the default kicad library path.

The problem seems to be that the path of the file is not taken into accou=
nt=20
anymore. Going back into svn history, I see that the relevant change happen=
ed=20
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=
=20
the commit message or changelog, but it looks like as the EDA_FileSelector=
=20
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=
n=20
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=
e.

Regards,
--=20
Ra=C3=BAl S=C3=A1nchez Siles
AvanteGPS
--=20
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=
=20
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=
f=20
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;
charset="utf-8";
name="eeschema_lib_dialog.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="eeschema_lib_dialog.diff"

Index: dialog_eeschema_config.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=2D-- dialog_eeschema_config.cpp	(revisi=C3=B3n: 445)
+++ dialog_eeschema_config.cpp	(revisi=C3=B3n: 636)
@@ -364,31 +364,38 @@
}
=20
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	TRUE
=2D	);
+=09
+	wxFileDialog FilesDialog(this, _("Library files:"), g_RealLibDirBuffer,
+	wxEmptyString, Mask,
+	wxFD_DEFAULT_STYLE | wxFD_MULTIPLE);
=20
=2D	if ( FullLibName.IsEmpty() ) return;
+	FilesDialog.ShowModal();
+	wxArrayString Filenames;
+	FilesDialog.GetFilenames(Filenames);
+=09
+	for ( unsigned jj =3D 0; jj < Filenames.GetCount(); jj ++ )
+	{
+	FullLibName =3D Filenames[jj];
+	ShortLibName =3D MakeReducedFileName(FullLibName,g_RealLibDirBuffer,g_Li=
bExtBuffer);
+	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);
+	}
=20
=2D	ShortLibName =3D MakeReducedFileName(FullLibName,g_RealLibDirBuffer,g_L=
ibExtBuffer);
=2D
=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=
use");
+	DisplayError(this, msg);
+	}
}
=20
=2D	else DisplayError(this, _("Library already in use"));
=2D
}
=20
=20
 --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