← Back to team overview

kicad-developers team mailing list archive

Re: wxFileDialog issues

 

Wayne Stambaugh wrote:
On 5/11/2010 8:44 AM, Lorenzo Marcantonio wrote:
A minor nuisance... but I don't get why it does this on pcbnew:

- If at the beginning you do an 'Open board' you get the dialog with the
  'Printed circuit board file' wildcard active, and thats good.

- If there is a board loaded, doing an 'Open board' starts with no
  wildcard active and you must select it to show only the .brd files...

I presume this is because pcbnew does this:

        wxFileName fn = GetScreen()->m_FileName;

        wxFileDialog dlg( this, _( "Open Board File" ), wxEmptyString,
fn.GetFullName(),
                          PcbFileWildcard, wxFD_OPEN |
wxFD_FILE_MUST_EXIST );

... and the fnGetFullName() somewhat confuses the wxFileDialog...

Oh, BTW PcbFileWildcard is mostly the same as BoardFileWildcard,
I propose to pick one and junk the other one (no sense in keeping both
of them).

Eeschema doesn't suffer the problem... what it does is:

        wxFileDialog dlg( this, _( "Open Schematic" ), wxGetCwd(),
                          wxEmptyString, SchematicFileWildcard,
                          wxFD_OPEN | wxFD_FILE_MUST_EXIST );

I don't get why it's done differently (I'm no expert in wx), but I guess
that doing the same in pcbnew would fix the nuisance. I'll try that
later...

I've been digging around the source and this inconsistency occurs in
some of the other Kicad apps as well.  I'll change all of the Kicad apps
open file dialog behavior to mimic the file dialog behavior in EESchema
if no one objects.  I looked at a least a dozen other apps and all of
them had no file name defined in the open file dialog.  Putting the file
name of the file you already have open in the open file dialog doesn't
make a lot of sense.

Wayne


I would object to changes in the specctra import and export area. I put the time into those to make them work the way I wanted them to work at the time I wrote them. So let's not change what's not broken there please. I really do not have time to confirm that what you are contemplating will not break what I tried to achieve.


Thanks,

Dick




Follow ups

References