fix pcbnew file save as problem, if previous file by same basename did not exist. Show default file ext.
This commit is contained in:
parent
760d02e4d2
commit
1b4f7d6ce5
|
@ -415,13 +415,20 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
|
||||||
wildcard << wxGetTranslation( PcbFileWildcard ) << wxChar( '|' ) <<
|
wildcard << wxGetTranslation( PcbFileWildcard ) << wxChar( '|' ) <<
|
||||||
wxGetTranslation( LegacyPcbFileWildcard );
|
wxGetTranslation( LegacyPcbFileWildcard );
|
||||||
|
|
||||||
wxFileDialog dlg( this, _( "Save Board File As" ), wxEmptyString, GetBoard()->GetFileName(),
|
pcbFileName = GetBoard()->GetFileName();
|
||||||
wildcard, wxFD_SAVE
|
|
||||||
/* wxFileDialog is not equipped to handle multiple wildcards and
|
// Match the default wildcard filter choice, with the inital file extension shown.
|
||||||
|
// That'll be the extension unless user changes filter dropdown listbox.
|
||||||
|
pcbFileName.SetExt( KiCadPcbFileExtension );
|
||||||
|
|
||||||
|
wxFileDialog dlg( this, _( "Save Board File As" ), wxEmptyString,
|
||||||
|
pcbFileName.GetFullPath(),
|
||||||
|
wildcard, wxFD_SAVE
|
||||||
|
/* wxFileDialog is not equipped to handle multiple wildcards and
|
||||||
wxFD_OVERWRITE_PROMPT both together.
|
wxFD_OVERWRITE_PROMPT both together.
|
||||||
| wxFD_OVERWRITE_PROMPT
|
| wxFD_OVERWRITE_PROMPT
|
||||||
*/
|
*/
|
||||||
);
|
);
|
||||||
|
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return false;
|
return false;
|
||||||
|
@ -431,6 +438,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
|
||||||
pluginType = ( filterNdx == 1 ) ? IO_MGR::LEGACY : IO_MGR::KICAD;
|
pluginType = ( filterNdx == 1 ) ? IO_MGR::LEGACY : IO_MGR::KICAD;
|
||||||
|
|
||||||
// Note: on Linux wxFileDialog is not reliable for noticing a changed filename.
|
// Note: on Linux wxFileDialog is not reliable for noticing a changed filename.
|
||||||
|
// We probably need to file a bug report or implement our own derivation.
|
||||||
|
|
||||||
pcbFileName = dlg.GetPath();
|
pcbFileName = dlg.GetPath();
|
||||||
|
|
||||||
|
@ -487,7 +495,6 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
backupFileName.Clear();
|
backupFileName.Clear();
|
||||||
saveok = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue