Use the new nudge path for the symbol lib table, save global and project mru differently
This commit is contained in:
parent
991c8fbf8f
commit
31fd49d444
|
@ -38,6 +38,7 @@
|
||||||
#include <symbol_viewer_frame.h>
|
#include <symbol_viewer_frame.h>
|
||||||
#include <sch_edit_frame.h>
|
#include <sch_edit_frame.h>
|
||||||
#include <kiway.h>
|
#include <kiway.h>
|
||||||
|
#include <paths.h>
|
||||||
#include <pgm_base.h>
|
#include <pgm_base.h>
|
||||||
#include <settings/settings_manager.h>
|
#include <settings/settings_manager.h>
|
||||||
#include <widgets/grid_readonly_text_helpers.h>
|
#include <widgets/grid_readonly_text_helpers.h>
|
||||||
|
@ -197,9 +198,9 @@ PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE( DIALOG_EDIT_LIBRARY_TABLES* aParent, P
|
||||||
EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
|
EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
|
||||||
|
|
||||||
if( cfg->m_lastSymbolLibDir.IsEmpty() )
|
if( cfg->m_lastSymbolLibDir.IsEmpty() )
|
||||||
{
|
cfg->m_lastSymbolLibDir = PATHS::GetDefaultUserSymbolsPath();
|
||||||
cfg->m_lastSymbolLibDir = m_project->GetProjectPath();
|
|
||||||
}
|
m_lastProjectLibDir = m_project->GetProjectPath();
|
||||||
|
|
||||||
auto setupGrid =
|
auto setupGrid =
|
||||||
[&]( WX_GRID* aGrid )
|
[&]( WX_GRID* aGrid )
|
||||||
|
@ -447,8 +448,15 @@ void PANEL_SYM_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
|
||||||
+ "|" + LegacySymbolLibFileWildcard();
|
+ "|" + LegacySymbolLibFileWildcard();
|
||||||
|
|
||||||
EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
|
EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
|
||||||
|
|
||||||
|
wxString openDir = cfg->m_lastSymbolLibDir;
|
||||||
|
if( m_cur_grid == m_project_grid )
|
||||||
|
{
|
||||||
|
openDir = m_lastProjectLibDir;
|
||||||
|
}
|
||||||
|
|
||||||
wxFileDialog dlg( this, _( "Select Library" ),
|
wxFileDialog dlg( this, _( "Select Library" ),
|
||||||
cfg->m_lastSymbolLibDir, wxEmptyString, wildcards,
|
openDir, wxEmptyString, wildcards,
|
||||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE );
|
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE );
|
||||||
|
|
||||||
auto result = dlg.ShowModal();
|
auto result = dlg.ShowModal();
|
||||||
|
@ -456,7 +464,14 @@ void PANEL_SYM_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
|
||||||
if( result == wxID_CANCEL )
|
if( result == wxID_CANCEL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cfg->m_lastSymbolLibDir = dlg.GetDirectory();
|
if( m_cur_grid == m_global_grid )
|
||||||
|
{
|
||||||
|
cfg->m_lastSymbolLibDir = dlg.GetPath();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_lastProjectLibDir = dlg.GetPath();
|
||||||
|
}
|
||||||
|
|
||||||
const ENV_VAR_MAP& envVars = Pgm().GetLocalEnvVariables();
|
const ENV_VAR_MAP& envVars = Pgm().GetLocalEnvVariables();
|
||||||
bool addDuplicates = false;
|
bool addDuplicates = false;
|
||||||
|
|
|
@ -84,6 +84,7 @@ private:
|
||||||
|
|
||||||
WX_GRID* m_cur_grid; ///< changed based on tab choice
|
WX_GRID* m_cur_grid; ///< changed based on tab choice
|
||||||
static size_t m_pageNdx; ///< Remember the last notebook page selected
|
static size_t m_pageNdx; ///< Remember the last notebook page selected
|
||||||
|
wxString m_lastProjectLibDir; //< Transient (unsaved) last browsed folder when adding a project level library
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue