Resolve textvars before opening file browser.
Fixes https://gitlab.com/kicad/code/kicad/issues/6436
This commit is contained in:
parent
cc18c31cb5
commit
c3bed8f6ee
|
@ -1262,10 +1262,10 @@ wxString DIALOG_PLOT_SCHEMATIC::getOutputPath()
|
|||
|
||||
// Build the absolute path of current output directory to preselect it in the file browser.
|
||||
std::function<bool( wxString* )> textResolver =
|
||||
[&]( wxString* token ) -> bool
|
||||
{
|
||||
return m_parent->Schematic().ResolveTextVar( token, 0 );
|
||||
};
|
||||
[&]( wxString* token ) -> bool
|
||||
{
|
||||
return m_parent->Schematic().ResolveTextVar( token, 0 );
|
||||
};
|
||||
|
||||
wxString path = m_outputDirectoryName->GetValue();
|
||||
path = ExpandTextVars( path, &textResolver, nullptr, &Prj() );
|
||||
|
|
|
@ -461,7 +461,15 @@ void DIALOG_PLOT::OnSetScaleOpt( wxCommandEvent& event )
|
|||
void DIALOG_PLOT::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )
|
||||
{
|
||||
// Build the absolute path of current output directory to preselect it in the file browser.
|
||||
wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() );
|
||||
std::function<bool( wxString* )> textResolver =
|
||||
[&]( wxString* token ) -> bool
|
||||
{
|
||||
return m_parent->GetBoard()->ResolveTextVar( token, 0 );
|
||||
};
|
||||
|
||||
wxString path = m_outputDirectoryName->GetValue();
|
||||
path = ExpandTextVars( path, &textResolver, nullptr, &Prj() );
|
||||
path = ExpandEnvVarSubstitutions( path, &Prj() );
|
||||
path = Prj().AbsolutePath( path );
|
||||
|
||||
wxDirDialog dirDialog( this, _( "Select Output Directory" ), path );
|
||||
|
|
Loading…
Reference in New Issue