Give blank schematics an output name

Plotting a blank schematic should have a placeholder name until the user
saves the file

Fixes https://gitlab.com/kicad/code/kicad/issues/6561
This commit is contained in:
Seth Hillbrand 2021-01-06 11:10:44 -08:00
parent e55061b043
commit b08555b924
1 changed files with 5 additions and 1 deletions

View File

@ -364,8 +364,12 @@ wxFileName DIALOG_PLOT_SCHEMATIC::createPlotFileName( const wxString& aPlotFileN
{ {
wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() ); wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() );
wxFileName outputDir = wxFileName::DirName( path ); wxFileName outputDir = wxFileName::DirName( path );
wxString plotFileName;
wxString plotFileName = Prj().AbsolutePath( aPlotFileName + wxT( "." ) + aExtension); if( !aPlotFileName.IsEmpty() )
plotFileName = Prj().AbsolutePath( aPlotFileName + wxT( "." ) + aExtension );
else
plotFileName = Prj().AbsolutePath( _( "Schematic" ) + wxT( "." ) + aExtension );
if( !EnsureFileDirectoryExists( &outputDir, plotFileName, aReporter ) ) if( !EnsureFileDirectoryExists( &outputDir, plotFileName, aReporter ) )
{ {