← Back to team overview

kicad-developers team mailing list archive

Re: wxFileDialog issues

 

Wayne Stambaugh wrote:
On 5/12/2010 10:52 AM, Dick Hollenbeck wrote:
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.

If you want to back out of changes and reload the same file.... It might be that the original author should be given a chance to comment on this, and perhaps he is on vacation?


I don't think we should be afraid of being different than the other apps you tested. How can you be better if you are the same? Start with the assumption that you are the best software developer in the world, if that helps establish the proper mindset, and that you are free to improve on the ideas that others have had before you. Improvement means change and differences. Nothing in this statement means that you cannot also adopt good ideas unchanged, when you decide they are good ideas. But that decision needs to be made consciously.

If we only mimic other's ideas, and not improve on them, then we will always be following, not leading.

Dick





Follow ups

References