Fix starting path in worksheet selection dialog when using env vars
This commit is contained in:
parent
01c69f1066
commit
a01de6bf53
|
@ -21,6 +21,7 @@
|
||||||
#include <pgm_base.h>
|
#include <pgm_base.h>
|
||||||
#include <bitmaps.h>
|
#include <bitmaps.h>
|
||||||
#include <base_screen.h>
|
#include <base_screen.h>
|
||||||
|
#include <common.h> // ExpandEnvVarSubstitutions
|
||||||
#include <confirm.h>
|
#include <confirm.h>
|
||||||
#include <core/arraydim.h>
|
#include <core/arraydim.h>
|
||||||
#include <dialogs/dialog_page_settings.h>
|
#include <dialogs/dialog_page_settings.h>
|
||||||
|
@ -773,17 +774,21 @@ void DIALOG_PAGES_SETTINGS::GetCustomSizeMilsFromDialog()
|
||||||
void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
|
void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
wxFileName fn = GetWksFileName();
|
wxFileName fn = GetWksFileName();
|
||||||
wxString name = GetWksFileName();
|
wxString name = fn.GetFullName();
|
||||||
wxString path;
|
wxString path;
|
||||||
|
|
||||||
if( fn.IsAbsolute() )
|
if( fn.IsAbsolute() )
|
||||||
{
|
{
|
||||||
path = fn.GetPath();
|
path = fn.GetPath();
|
||||||
name = fn.GetFullName();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
path = m_projectPath;
|
wxFileName expanded( ExpandEnvVarSubstitutions( GetWksFileName(), &m_parentFrame->Prj() ) );
|
||||||
|
|
||||||
|
if( expanded.IsAbsolute() )
|
||||||
|
path = expanded.GetPath();
|
||||||
|
else
|
||||||
|
path = m_projectPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display a file picker dialog
|
// Display a file picker dialog
|
||||||
|
|
Loading…
Reference in New Issue