GerbView: remember last open gerber file dialog wildcard.

This is only for the current GerbView session.  When GerbView is closed,
the last open gerber file dialog wildcard setting is lost.
This commit is contained in:
Wayne Stambaugh 2019-04-01 12:46:11 -04:00
parent 33e594e63e
commit f20a1314ff
1 changed files with 4 additions and 1 deletions

View File

@ -6,7 +6,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -182,6 +182,7 @@ void GERBVIEW_FRAME::Files_io( wxCommandEvent& event )
bool GERBVIEW_FRAME::LoadGerberFiles( const wxString& aFullFileName ) bool GERBVIEW_FRAME::LoadGerberFiles( const wxString& aFullFileName )
{ {
static int lastGerberFileWildcard = 0;
wxString filetypes; wxString filetypes;
wxArrayString filenamesList; wxArrayString filenamesList;
wxFileName filename = aFullFileName; wxFileName filename = aFullFileName;
@ -239,10 +240,12 @@ bool GERBVIEW_FRAME::LoadGerberFiles( const wxString& aFullFileName )
filename.GetFullName(), filename.GetFullName(),
filetypes, filetypes,
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE | wxFD_CHANGE_DIR ); wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE | wxFD_CHANGE_DIR );
dlg.SetFilterIndex( lastGerberFileWildcard );
if( dlg.ShowModal() == wxID_CANCEL ) if( dlg.ShowModal() == wxID_CANCEL )
return false; return false;
lastGerberFileWildcard = dlg.GetFilterIndex();
dlg.GetPaths( filenamesList ); dlg.GetPaths( filenamesList );
m_mruPath = currentPath = dlg.GetDirectory(); m_mruPath = currentPath = dlg.GetDirectory();
} }