Move ConfigurePaths and LibTable management to common ACTIONs.

This commit is contained in:
Jeff Young 2019-06-03 00:17:27 +01:00
parent a5f670b69d
commit e517199794
26 changed files with 145 additions and 176 deletions

View File

@ -40,6 +40,12 @@ CACHE_WRAPPER::~CACHE_WRAPPER()
}
FILENAME_RESOLVER* PROJECT::Get3DFilenameResolver()
{
return Get3DCacheManager()->GetResolver();
}
S3D_CACHE* PROJECT::Get3DCacheManager( bool updateProjDir )
{
wxCriticalSectionLocker lock( lock3D_wrapper );

View File

@ -344,6 +344,28 @@ TOOL_ACTION ACTIONS::highContrastDec( "common.Control.highContrastDec",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_HIGHCONTRAST_DEC ),
"", "" );
TOOL_ACTION ACTIONS::show3DViewer( "common.Control.show3DViewer",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_3D_VIEWER ),
_( "3D Viewer" ), _( "Show 3D viewer window" ),
three_d_xpm );
TOOL_ACTION ACTIONS::configurePaths( "common.Control.configurePaths",
AS_GLOBAL, 0,
_( "Configure Paths..." ), _( "Edit path configuration environment variables" ),
path_xpm );
TOOL_ACTION ACTIONS::showSymbolLibTable( "common.Control.showSymbolLibTable",
AS_GLOBAL, 0,
_( "Manage Symbol Libraries..." ),
_( "Edit the global and project symbol library lists" ),
library_table_xpm );
TOOL_ACTION ACTIONS::showFootprintLibTable( "common.Control.showFootprintLibTable",
AS_GLOBAL, 0,
_( "Manage Footprint Libraries..." ),
_( "Edit the global and project footprint library lists" ),
library_table_xpm );
TOOL_ACTION ACTIONS::acceleratedGraphics( "common.Control.acceleratedGraphics",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_CANVAS_OPENGL ),
_( "Accelerated Graphics" ), _( "Use hardware-accelerated graphics (recommended)" ),
@ -354,11 +376,6 @@ TOOL_ACTION ACTIONS::standardGraphics( "common.Control.standardGraphics",
_( "Standard Graphics" ), _( "Use software graphics (fall-back)" ),
tools_xpm );
TOOL_ACTION ACTIONS::show3DViewer( "pcbnew.Control.show3DViewer",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_3D_VIEWER ),
_( "3D Viewer" ), _( "Show 3D viewer window" ),
three_d_xpm );
// System-wide selection Events

View File

@ -34,7 +34,9 @@
#include <hotkeys.h>
#include <tool/common_tools.h>
#include <id.h>
#include <project.h>
#include <kiface_i.h>
#include <dialog_configure_paths.h>
void COMMON_TOOLS::Reset( RESET_REASON aReason )
{
@ -492,6 +494,31 @@ int COMMON_TOOLS::ToggleCursorStyle( const TOOL_EVENT& aEvent )
}
int COMMON_TOOLS::ConfigurePaths( const TOOL_EVENT& aEvent )
{
KIFACE* kiface = m_frame->Kiway().KiFACE( KIWAY::FACE_PCB );
kiface->CreateWindow( m_frame, DIALOG_CONFIGUREPATHS, &m_frame->Kiway() );
return 0;
}
int COMMON_TOOLS::ShowLibraryTable( const TOOL_EVENT& aEvent )
{
if( aEvent.IsAction( &ACTIONS::showSymbolLibTable ) )
{
KIFACE* kiface = m_frame->Kiway().KiFACE( KIWAY::FACE_SCH );
kiface->CreateWindow( m_frame, DIALOG_SCH_LIBRARY_TABLE, &m_frame->Kiway() );
}
else if( aEvent.IsAction( &ACTIONS::showFootprintLibTable ) )
{
KIFACE* kiface = m_frame->Kiway().KiFACE( KIWAY::FACE_PCB );
kiface->CreateWindow( m_frame, DIALOG_PCB_LIBRARY_TABLE, &m_frame->Kiway() );
}
return 0;
}
int COMMON_TOOLS::SwitchCanvas( const TOOL_EVENT& aEvent )
{
if( aEvent.IsAction( &ACTIONS::acceleratedGraphics ) )
@ -553,6 +580,9 @@ void COMMON_TOOLS::setTransitions()
Go( &COMMON_TOOLS::ToggleCursor, ACTIONS::toggleCursor.MakeEvent() );
Go( &COMMON_TOOLS::ToggleCursorStyle, ACTIONS::toggleCursorStyle.MakeEvent() );
Go( &COMMON_TOOLS::ConfigurePaths, ACTIONS::configurePaths.MakeEvent() );
Go( &COMMON_TOOLS::ShowLibraryTable, ACTIONS::showSymbolLibTable.MakeEvent() );
Go( &COMMON_TOOLS::ShowLibraryTable, ACTIONS::showFootprintLibTable.MakeEvent() );
Go( &COMMON_TOOLS::SwitchCanvas, ACTIONS::acceleratedGraphics.MakeEvent() );
Go( &COMMON_TOOLS::SwitchCanvas, ACTIONS::standardGraphics.MakeEvent() );
}

View File

@ -34,6 +34,7 @@ using namespace std::placeholders;
#include <tools/cvpcb_selection_tool.h>
// JEY TODO: move all these actions to tool/actions.cpp
// Selection tool actions
TOOL_ACTION CVPCB_ACTIONS::selectionActivate( "cvpcb.InteractiveSelection",
AS_GLOBAL, 0,

View File

@ -703,6 +703,10 @@ size_t PANEL_SYM_LIB_TABLE::m_pageNdx = 0;
void InvokeSchEditSymbolLibTable( KIWAY* aKiway, wxWindow *aParent )
{
SCH_EDIT_FRAME* schEditor = (SCH_EDIT_FRAME*) aKiway->Player( FRAME_SCH, false );
LIB_EDIT_FRAME* libEditor = (LIB_EDIT_FRAME*) aKiway->Player( FRAME_SCH_LIB_EDITOR, false );
LIB_VIEW_FRAME* libViewer = (LIB_VIEW_FRAME*) aKiway->Player( FRAME_SCH_VIEWER, false );
SYMBOL_LIB_TABLE* globalTable = &SYMBOL_LIB_TABLE::GetGlobalLibTable();
wxString globalTablePath = SYMBOL_LIB_TABLE::GetGlobalTableFileName();
SYMBOL_LIB_TABLE* projectTable = aKiway->Prj().SchSymbolLibTable();
@ -710,6 +714,10 @@ void InvokeSchEditSymbolLibTable( KIWAY* aKiway, wxWindow *aParent )
wxFileName projectTableFn( projectPath, SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
wxString msg;
// This prevents an ugly crash on OSX (https://bugs.launchpad.net/kicad/+bug/1765286)
if( libEditor )
libEditor->FreezeSearchTree();
DIALOG_EDIT_LIBRARY_TABLES dlg( aParent, _( "Symbol Libraries" ) );
dlg.InstallPanel( new PANEL_SYM_LIB_TABLE( &dlg, globalTable, globalTablePath,
@ -750,20 +758,15 @@ void InvokeSchEditSymbolLibTable( KIWAY* aKiway, wxWindow *aParent )
schematic.UpdateSymbolLinks( true ); // Update all symbol library links for all sheets.
SCH_EDIT_FRAME* schEditor = (SCH_EDIT_FRAME*) aKiway->Player( FRAME_SCH, false );
if( schEditor )
schEditor->SyncView();
auto editor = (LIB_EDIT_FRAME*) aKiway->Player( FRAME_SCH_LIB_EDITOR, false );
if( libEditor )
{
libEditor->SyncLibraries( true );
libEditor->ThawSearchTree();
}
if( editor )
editor->SyncLibraries( true );
LIB_VIEW_FRAME* viewer = (LIB_VIEW_FRAME*) aKiway->Player( FRAME_SCH_VIEWER, false );
if( viewer )
viewer->ReCreateListLib();
if( libViewer )
libViewer->ReCreateListLib();
}

View File

@ -72,45 +72,40 @@ static struct IFACE : public KIFACE_I
switch( aClassId )
{
case FRAME_SCH:
{
SCH_EDIT_FRAME* frame = new SCH_EDIT_FRAME( aKiway, aParent );
{
SCH_EDIT_FRAME* frame = new SCH_EDIT_FRAME( aKiway, aParent );
if( Kiface().IsSingle() )
{
// only run this under single_top, not under a project manager.
frame->CreateServer( KICAD_SCH_PORT_SERVICE_NUMBER );
}
return frame;
if( Kiface().IsSingle() )
{
// only run this under single_top, not under a project manager.
frame->CreateServer( KICAD_SCH_PORT_SERVICE_NUMBER );
}
break;
return frame;
}
case FRAME_SCH_LIB_EDITOR:
{
LIB_EDIT_FRAME* frame = new LIB_EDIT_FRAME( aKiway, aParent );
return frame;
}
break;
{
LIB_EDIT_FRAME* frame = new LIB_EDIT_FRAME( aKiway, aParent );
return frame;
}
#ifdef KICAD_SPICE
case FRAME_SIMULATOR:
{
SIM_PLOT_FRAME* frame = new SIM_PLOT_FRAME( aKiway, aParent );
return frame;
}
break;
#endif /* KICAD_SPICE */
{
SIM_PLOT_FRAME* frame = new SIM_PLOT_FRAME( aKiway, aParent );
return frame;
}
#endif
case FRAME_SCH_VIEWER:
case FRAME_SCH_VIEWER_MODAL:
{
LIB_VIEW_FRAME* frame = new LIB_VIEW_FRAME( aKiway, aParent, FRAME_T( aClassId ) );
return frame;
}
break;
{
LIB_VIEW_FRAME* frame = new LIB_VIEW_FRAME( aKiway, aParent, FRAME_T( aClassId ) );
return frame;
}
case DIALOG_SCH_LIBRARY_TABLE:
InvokeSchEditSymbolLibTable( aKiway, aParent );
// Dialog has completed; nothing to return.
return nullptr;

View File

@ -204,12 +204,6 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
Raise();
Show( true );
Bind( wxEVT_COMMAND_MENU_SELECTED, &LIB_EDIT_FRAME::OnConfigurePaths, this,
ID_PREFERENCES_CONFIGURE_PATHS );
Bind( wxEVT_COMMAND_MENU_SELECTED, &LIB_EDIT_FRAME::OnEditSymbolLibTable, this,
ID_EDIT_SYM_LIB_TABLE );
m_toolManager->RunAction( ACTIONS::zoomFitScreen, true );
SyncView();
@ -231,9 +225,6 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
LIB_EDIT_FRAME::~LIB_EDIT_FRAME()
{
Unbind( wxEVT_COMMAND_MENU_SELECTED, &LIB_EDIT_FRAME::OnEditSymbolLibTable, this,
ID_EDIT_SYM_LIB_TABLE );
// current screen is destroyed in EDA_DRAW_FRAME
SetScreen( m_dummyScreen );
@ -347,26 +338,21 @@ void LIB_EDIT_FRAME::OnToggleSearchTree( wxCommandEvent& event )
}
void LIB_EDIT_FRAME::OnEditSymbolLibTable( wxCommandEvent& aEvent )
{
m_libMgr->GetAdapter()->Freeze();
SCH_BASE_FRAME::OnEditSymbolLibTable( aEvent );
SyncLibraries( true );
m_libMgr->GetAdapter()->Thaw();
}
bool LIB_EDIT_FRAME::IsSearchTreeShown()
{
return m_auimgr.GetPane( m_treePane ).IsShown();
}
void LIB_EDIT_FRAME::ClearSearchTreeSelection()
void LIB_EDIT_FRAME::FreezeSearchTree()
{
m_treePane->GetLibTree()->Unselect();
m_libMgr->GetAdapter()->Freeze();
}
void LIB_EDIT_FRAME::ThawSearchTree()
{
m_libMgr->GetAdapter()->Thaw();
}

View File

@ -162,22 +162,12 @@ public:
/** @return The default pin len setting.
*/
static int GetDefaultPinLength() { return m_defaultPinLength; }
/** Set the default pin len.
*/
static void SetDefaultPinLength( int aLength ) { m_defaultPinLength = aLength; }
/**
* @return the increment value of the position of a pin
* for the pin repeat command
* @return the increment value of the position of a pin for the pin repeat command
*/
int GetRepeatPinStep() const { return m_repeatPinStep; }
/**
* Sets the repeat step value for pins repeat command
* @param aStep the increment value of the position of an item
* for the repeat command
*/
void SetRepeatPinStep( int aStep) { m_repeatPinStep = aStep; }
void ReCreateMenuBar() override;
@ -270,10 +260,9 @@ public:
void OnToggleSearchTree( wxCommandEvent& event );
void OnEditSymbolLibTable( wxCommandEvent& aEvent ) override;
bool IsSearchTreeShown();
void ClearSearchTreeSelection();
void FreezeSearchTree();
void ThawSearchTree();
void OnUpdateHavePart( wxUpdateUIEvent& aEvent );
void OnUpdateSyncPinEdit( wxUpdateUIEvent& event );

View File

@ -314,14 +314,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
};
prefsMenu->AddItem( ID_PREFERENCES_CONFIGURE_PATHS, _( "Configure Pa&ths..." ),
_( "Edit path configuration environment variables" ),
path_xpm, EE_CONDITIONS::ShowAlways );
prefsMenu->AddItem( ID_EDIT_SYM_LIB_TABLE, _( "Manage Symbol Libraries..." ),
_( "Edit the global and project symbol library lists" ),
library_table_xpm, EE_CONDITIONS::ShowAlways );
prefsMenu->AddItem( ACTIONS::configurePaths, EE_CONDITIONS::ShowAlways );
prefsMenu->AddItem( ACTIONS::showSymbolLibTable, EE_CONDITIONS::ShowAlways );
prefsMenu->AddItem( wxID_PREFERENCES,
AddHotkeyName( _( "Preferences..." ), g_Eeschema_Hotkeys_Descr, HK_PREFERENCES ),
_( "Show preferences for all open tools" ),

View File

@ -36,14 +36,10 @@
#include <viewlib_frame.h>
#include <sch_base_frame.h>
#include <symbol_lib_table.h>
#include <dialog_configure_paths.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <tools/ee_actions.h>
#include "dialogs/panel_sym_lib_table.h"
LIB_ALIAS* SchGetLibAlias( const LIB_ID& aLibId, SYMBOL_LIB_TABLE* aLibTable, PART_LIB* aCacheLib,
wxWindow* aParent, bool aShowErrorMsg )
@ -262,19 +258,6 @@ void SCH_BASE_FRAME::UpdateStatusBar()
}
void SCH_BASE_FRAME::OnConfigurePaths( wxCommandEvent& aEvent )
{
DIALOG_CONFIGURE_PATHS dlg( this, nullptr );
dlg.ShowModal();
}
void SCH_BASE_FRAME::OnEditSymbolLibTable( wxCommandEvent& aEvent )
{
InvokeSchEditSymbolLibTable( &Kiway(), this );
}
LIB_ALIAS* SCH_BASE_FRAME::GetLibAlias( const LIB_ID& aLibId, bool aUseCacheLib, bool aShowError )
{
PART_LIB* cache = ( aUseCacheLib ) ? Prj().SchLibs()->GetCacheLibrary() : NULL;

View File

@ -244,8 +244,6 @@ public:
const LIB_ID* aHighlight = nullptr,
bool aAllowFields = true );
void OnConfigurePaths( wxCommandEvent& aEvent );
/**
* Return a template field names list for read only access.
*/
@ -265,8 +263,6 @@ public:
return m_templateFieldNames.GetFieldName( aName );
}
virtual void OnEditSymbolLibTable( wxCommandEvent& aEvent );
/**
* Load symbol from symbol library table.
*

View File

@ -228,7 +228,6 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_MENU( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, SCH_EDIT_FRAME::Process_Config )
EVT_TOOL( wxID_PREFERENCES, SCH_EDIT_FRAME::OnPreferencesOptions )
EVT_MENU( ID_PREFERENCES_CONFIGURE_PATHS, SCH_EDIT_FRAME::OnConfigurePaths )
EVT_TOOL( ID_RESCUE_CACHED, SCH_EDIT_FRAME::OnRescueProject )
EVT_MENU( ID_REMAP_SYMBOLS, SCH_EDIT_FRAME::OnRemapSymbols )
@ -317,18 +316,12 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ):
// Net list generator
DefaultExecFlags();
Bind( wxEVT_COMMAND_MENU_SELECTED, &SCH_EDIT_FRAME::OnEditSymbolLibTable, this,
ID_EDIT_SYM_LIB_TABLE );
UpdateTitle();
}
SCH_EDIT_FRAME::~SCH_EDIT_FRAME()
{
Unbind( wxEVT_COMMAND_MENU_SELECTED, &SCH_EDIT_FRAME::OnEditSymbolLibTable, this,
ID_EDIT_SYM_LIB_TABLE );
delete m_item_to_repeat; // we own the cloned object, see this->SaveCopyForRepeatItem()
SetScreen( NULL );

View File

@ -66,7 +66,8 @@ enum FRAME_T
FRAME_T_COUNT,
// Library table dialogs are transient and are never returned
DIALOG_SCH_LIBRARY_TABLE = FRAME_T_COUNT,
DIALOG_CONFIGUREPATHS = FRAME_T_COUNT,
DIALOG_SCH_LIBRARY_TABLE,
DIALOG_PCB_LIBRARY_TABLE
};

View File

@ -45,6 +45,7 @@ class SEARCH_STACK;
class S3D_CACHE;
class KIWAY;
class SYMBOL_LIB_TABLE;
class FILENAME_RESOLVER;
#define VTBL_ENTRY virtual
@ -285,6 +286,9 @@ public:
* @return a pointer to an instance of the 3D cache manager or NULL on failure
*/
S3D_CACHE* Get3DCacheManager( bool updateProjDir = false );
/// Accessor for 3D path resolver
FILENAME_RESOLVER* Get3DFilenameResolver();
#endif
@ -297,6 +301,9 @@ public:
/// Accessor for project symbol library table.
SYMBOL_LIB_TABLE* SchSymbolLibTable();
/// Accessor for 3D path resolver
FILENAME_RESOLVER* Get3DFilenameResolver() { return nullptr; }
#endif
//-----</KIFACE Specific APIs>-----------------------------------------------

View File

@ -136,9 +136,12 @@ public:
static TOOL_ACTION resetLocalCoords;
// Misc
static TOOL_ACTION show3DViewer;
static TOOL_ACTION configurePaths;
static TOOL_ACTION showSymbolLibTable;
static TOOL_ACTION showFootprintLibTable;
static TOOL_ACTION acceleratedGraphics;
static TOOL_ACTION standardGraphics;
static TOOL_ACTION show3DViewer;
/**
* Function TranslateLegacyId()

View File

@ -79,6 +79,8 @@ public:
int ToggleGrid( const TOOL_EVENT& aEvent );
int GridProperties( const TOOL_EVENT& aEvent );
int ConfigurePaths( const TOOL_EVENT& aEvent );
int ShowLibraryTable( const TOOL_EVENT& aEvent );
int SwitchCanvas( const TOOL_EVENT& aEvent );
///> Sets up handlers for various events.

View File

@ -590,8 +590,8 @@ void KICAD_MANAGER_FRAME::OnShowHotkeys( wxCommandEvent& event )
void KICAD_MANAGER_FRAME::OnConfigurePaths( wxCommandEvent& aEvent )
{
DIALOG_CONFIGURE_PATHS dlg( this, nullptr );
dlg.ShowModal();
KIFACE* kiface = Kiway().KiFACE( KIWAY::FACE_PCB );
kiface->CreateWindow( this, DIALOG_CONFIGUREPATHS, &Kiway() );
}

View File

@ -62,8 +62,6 @@
#include <dialogs/panel_modedit_settings.h>
#include <dialogs/panel_modedit_defaults.h>
#include <dialogs/panel_modedit_display_options.h>
#include <dialog_configure_paths.h>
#include <tools/position_relative_tool.h>
#include <widgets/progress_reporter.h>
#include "tools/selection_tool.h"
@ -113,13 +111,8 @@ BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME )
EVT_TOOL( ID_MODEDIT_SHOW_HIDE_SEARCH_TREE, FOOTPRINT_EDIT_FRAME::OnToggleSearchTree )
// Preferences and option menus
EVT_MENU( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
FOOTPRINT_EDIT_FRAME::ProcessPreferences )
EVT_MENU( ID_PCB_LIB_TABLE_EDIT,
FOOTPRINT_EDIT_FRAME::ProcessPreferences )
EVT_MENU( wxID_PREFERENCES,
FOOTPRINT_EDIT_FRAME::ProcessPreferences )
EVT_MENU( ID_PREFERENCES_CONFIGURE_PATHS, FOOTPRINT_EDIT_FRAME::OnConfigurePaths )
EVT_MENU( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, FOOTPRINT_EDIT_FRAME::ProcessPreferences )
EVT_MENU( wxID_PREFERENCES, FOOTPRINT_EDIT_FRAME::ProcessPreferences )
// popup commands
EVT_MENU_RANGE( ID_POPUP_PCB_START_RANGE, ID_POPUP_PCB_END_RANGE,
@ -822,10 +815,6 @@ void FOOTPRINT_EDIT_FRAME::ProcessPreferences( wxCommandEvent& event )
DisplayHotkeyList( this, g_Module_Editor_Hotkeys_Descr );
break;
case ID_PCB_LIB_TABLE_EDIT:
InvokePcbLibTableEditor( &Kiway(), this );
break;
case wxID_PREFERENCES:
ShowPreferences( g_Pcbnew_Editor_Hotkeys_Descr, g_Module_Editor_Hotkeys_Descr,
wxT( "pcbnew" ) );
@ -847,13 +836,6 @@ void FOOTPRINT_EDIT_FRAME::InstallPreferences( PAGED_DIALOG* aParent )
}
void FOOTPRINT_EDIT_FRAME::OnConfigurePaths( wxCommandEvent& aEvent )
{
DIALOG_CONFIGURE_PATHS dlg( this, Prj().Get3DCacheManager()->GetResolver() );
dlg.ShowModal();
}
void FOOTPRINT_EDIT_FRAME::setupTools()
{
PCB_DRAW_PANEL_GAL* drawPanel = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );

View File

@ -128,7 +128,6 @@ public:
// The Tool Framework initalization, for GAL mode
void setupTools();
void OnConfigurePaths( wxCommandEvent& aEvent );
void OnToggleSearchTree( wxCommandEvent& event );
void OnSaveFootprintAsPng( wxCommandEvent& event );

View File

@ -309,18 +309,13 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
};
prefsMenu->AddItem( ID_PREFERENCES_CONFIGURE_PATHS, _( "&Configure Paths..." ),
_( "Edit path configuration environment variables" ),
path_xpm, SELECTION_CONDITIONS::ShowAlways );
prefsMenu->AddItem( ID_PCB_LIB_TABLE_EDIT, _( "Manage &Footprint Libraries..." ),
_( "Edit the global and project footprint library tables." ),
library_table_xpm, SELECTION_CONDITIONS::ShowAlways );
prefsMenu->AddItem( ACTIONS::configurePaths, SELECTION_CONDITIONS::ShowAlways );
prefsMenu->AddItem( ACTIONS::showFootprintLibTable, SELECTION_CONDITIONS::ShowAlways );
prefsMenu->AddItem( wxID_PREFERENCES,
AddHotkeyName( _( "Preferences..." ), g_Module_Editor_Hotkeys_Descr, HK_PREFERENCES ),
_( "Show preferences for all open tools" ),
preference_xpm, SELECTION_CONDITIONS::ShowAlways );
preference_xpm, SELECTION_CONDITIONS::ShowAlways );
prefsMenu->AddSeparator();
Pgm().AddMenuLanguageList( prefsMenu );

View File

@ -494,23 +494,18 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
};
prefsMenu->AddItem( ID_PREFERENCES_CONFIGURE_PATHS, _( "&Configure Paths..." ),
_( "Edit path configuration environment variables" ),
path_xpm, SELECTION_CONDITIONS::ShowAlways );
prefsMenu->AddItem( ID_PCB_LIB_TABLE_EDIT, _( "Manage &Footprint Libraries..." ),
_( "Edit the global and project footprint library tables." ),
library_table_xpm, SELECTION_CONDITIONS::ShowAlways );
prefsMenu->AddItem( ACTIONS::configurePaths, SELECTION_CONDITIONS::ShowAlways );
prefsMenu->AddItem( ACTIONS::showFootprintLibTable, SELECTION_CONDITIONS::ShowAlways );
#ifdef BUILD_GITHUB_PLUGIN
prefsMenu->AddItem( ID_PCB_3DSHAPELIB_WIZARD, _( "Add &3D Shapes Libraries Wizard..." ),
_( "Download 3D shape libraries from GitHub" ),
import3d_xpm, SELECTION_CONDITIONS::ShowAlways );
import3d_xpm, SELECTION_CONDITIONS::ShowAlways );
#endif
prefsMenu->AddItem( wxID_PREFERENCES,
AddHotkeyName( _( "Preferences..." ), g_Module_Editor_Hotkeys_Descr, HK_PREFERENCES ),
_( "Show preferences for all open tools" ),
preference_xpm, SELECTION_CONDITIONS::ShowAlways );
preference_xpm, SELECTION_CONDITIONS::ShowAlways );
prefsMenu->AddSeparator();
Pgm().AddMenuLanguageList( prefsMenu );

View File

@ -44,7 +44,6 @@
#include <dialog_exchange_footprints.h>
#include <dialog_edit_footprint_for_BoardEditor.h>
#include <dialog_board_setup.h>
#include <dialog_configure_paths.h>
#include <dialog_update_pcb.h>
#include <convert_to_biu.h>
#include <view/view.h>
@ -153,9 +152,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU( wxID_EXIT, PCB_EDIT_FRAME::OnQuit )
// menu Config
EVT_MENU( ID_PCB_LIB_TABLE_EDIT, PCB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_PCB_3DSHAPELIB_WIZARD, PCB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_PREFERENCES_CONFIGURE_PATHS, PCB_EDIT_FRAME::OnConfigurePaths )
EVT_MENU( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, PCB_EDIT_FRAME::Process_Config )
EVT_MENU( wxID_PREFERENCES, PCB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_GRID_SETTINGS, PCB_EDIT_FRAME::OnGridSettings )
@ -1020,13 +1017,6 @@ bool PCB_EDIT_FRAME::SetCurrentNetClass( const wxString& aNetClassName )
}
void PCB_EDIT_FRAME::OnConfigurePaths( wxCommandEvent& aEvent )
{
DIALOG_CONFIGURE_PATHS dlg( this, Prj().Get3DCacheManager()->GetResolver() );
dlg.ShowModal();
}
void PCB_EDIT_FRAME::OnUpdatePCBFromSch( wxCommandEvent& event )
{
NETLIST netlist;

View File

@ -320,7 +320,6 @@ public:
void OnUpdateSelectTrackWidth( wxUpdateUIEvent& aEvent );
void OnUpdateMuWaveToolbar( wxUpdateUIEvent& aEvent );
void OnLayerColorChange( wxCommandEvent& aEvent );
void OnConfigurePaths( wxCommandEvent& aEvent );
void OnUpdatePCBFromSch( wxCommandEvent& event );
void OnRunEeschema( wxCommandEvent& event );

View File

@ -58,6 +58,7 @@
#include <footprint_preview_panel.h>
#include <footprint_info_impl.h>
#include <gl_context_mgr.h>
#include <dialog_configure_paths.h>
#include "invoke_pcb_dialog.h"
#include "dialog_global_fp_lib_table_config.h"
@ -119,9 +120,16 @@ static struct IFACE : public KIFACE_I
case FRAME_PCB_FOOTPRINT_PREVIEW:
return dynamic_cast< wxWindow* >( FOOTPRINT_PREVIEW_PANEL::New( aKiway, aParent ) );
case DIALOG_CONFIGUREPATHS:
{
DIALOG_CONFIGURE_PATHS dlg( aParent, aKiway->Prj().Get3DFilenameResolver() );
dlg.ShowModal();
// Dialog has completed; nothing to return.
return nullptr;
}
case DIALOG_PCB_LIBRARY_TABLE:
InvokePcbLibTableEditor( aKiway, aParent );
// Dialog has completed; nothing to return.
return nullptr;

View File

@ -66,10 +66,6 @@ void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
switch( id )
{
case ID_PCB_LIB_TABLE_EDIT:
InvokePcbLibTableEditor( &Kiway(), this );
break;
case ID_PCB_3DSHAPELIB_WIZARD:
#ifdef BUILD_GITHUB_PLUGIN
Invoke3DShapeLibsDownloaderWizard( this );

View File

@ -151,7 +151,6 @@ enum pcbnew_ids
ID_PCB_GEN_CMP_FILE,
ID_PCB_GEN_BOM_FILE_FROM_BOARD,
ID_PCB_3DSHAPELIB_WIZARD,
ID_PCB_LIB_TABLE_EDIT,
ID_BOARD_SETUP_DIALOG,
ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR,