On 3/4/2014 1:44 PM, Nick Østergaard wrote: > I would like to get some answers to Cirilo's quesitons. I have > successfully been using the attached patch, just to make the kicad app > render the icons and open correctly for all gerber files in the tree. > > Nick > > > 2014-01-11 3:53 GMT+01:00 Cirilo Bernardo <[email protected] > <mailto:[email protected]>>: > > I've been looking into the issue of the main kicad GUI not > associating GB?, GT? files with Gerbview and I have a few > observations and questions: > > 1. the string GerberFileExtension is currently defined in > common/wildcards_and_files_ext.cpp but it is only used in the kicad > main app. > > 2. likewise, GerberFileWildCard is defined in the same file and only > used in the main app. > > 3. in > kicad/tree_project_frame.{cpp,h}, TREE_PROJECT_FRAME::GetFileWildcard does > not appear to be used anywhere in the KiCad tree. > > > My questions: > > 1. Current definition of GerberFileExtension is: > > const wxString GerberFileExtension( wxT( "pho" ) ); > > If I change it to this line: > > const wxString GerberFileExtension( wxT( > ".((gbr|(gb|gt)[alops])|pho)" ) ); > > then the kicad main app correctly associates the various gerber file > extensions with gerbview. > Is is a good idea to make this change? After all, only > TREE_PROJECT_FRAME in kicad/ makes use of it.
Cirilo, Nice job on the wildcard filter patch. It works as expected. I will commit it as soon as I can. > > 1b. The leading '.' in the string is essential since the string is > used to form a regexp by adding it to a regexp string beginning with > "^.*\" In fact, I wonder if the regexp part (line 497 of > tree_project_frame.cpp): > > reg.Compile( wxString::FromAscii( "^.*\\" ) + ext + > wxString::FromAscii( "$" ), wxRE_ICASE ); > > should actually be: > > reg.Compile( wxString::FromAscii( "^.*\\." ) + ext + > wxString::FromAscii( "$" ), wxRE_ICASE ); > > This way we are assured that there is a '.' before the extension. > Any comments? Doesn't work (at least on windows). I just tried it. > > > 2. Since no other app makes use > of GerberFileExtension/GerberFileWildCard, should we simply move > these definitions to tree_project_frame.cpp ? No. Eventually there will be a single binary so it wont matter. > > > 3. Is TREE_PROJECT_FRAME::GetFileWildcard cruft which can be removed > or is it part of code in development? It's not used anywhere so unless someone else is planning on using it, I see no reason to keep it. Wayne > > Cheers, > Cirilo > > > _______________________________________________ > Mailing list: https://launchpad.net/~kicad-developers > Post to : [email protected] > <mailto:[email protected]> > Unsubscribe : https://launchpad.net/~kicad-developers > More help : https://help.launchpad.net/ListHelp > > > > > _______________________________________________ > Mailing list: https://launchpad.net/~kicad-developers > Post to : [email protected] > Unsubscribe : https://launchpad.net/~kicad-developers > More help : https://help.launchpad.net/ListHelp > _______________________________________________ Mailing list: https://launchpad.net/~kicad-developers Post to : [email protected] Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp

