mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Allow opening arbitrary jobset files
This commit is contained in:
parent
f7b01d8eb9
commit
012867faf8
@ -82,6 +82,13 @@ TOOL_ACTION KICAD_MANAGER_ACTIONS::openProject( TOOL_ACTION_ARGS()
|
||||
.FriendlyName( _( "Open Project..." ) )
|
||||
.Icon( BITMAPS::open_project ) );
|
||||
|
||||
TOOL_ACTION KICAD_MANAGER_ACTIONS::openJobsetFile( TOOL_ACTION_ARGS()
|
||||
.Name( "kicad.Control.openJobset" )
|
||||
.Scope( AS_GLOBAL )
|
||||
.LegacyHotkeyName( "Open Jobset File" )
|
||||
.FriendlyName( _( "Open Jobset File..." ) )
|
||||
.Icon( BITMAPS::open_project ) );
|
||||
|
||||
TOOL_ACTION KICAD_MANAGER_ACTIONS::closeProject( TOOL_ACTION_ARGS()
|
||||
.Name( "kicad.Control.closeProject" )
|
||||
.Scope( AS_GLOBAL )
|
||||
|
@ -37,6 +37,7 @@ public:
|
||||
static TOOL_ACTION newJobsetFile;
|
||||
static TOOL_ACTION openDemoProject;
|
||||
static TOOL_ACTION openProject;
|
||||
static TOOL_ACTION openJobsetFile;
|
||||
static TOOL_ACTION closeProject;
|
||||
static TOOL_ACTION loadProject;
|
||||
static TOOL_ACTION viewDroppedGerbers;
|
||||
|
@ -420,6 +420,23 @@ int KICAD_MANAGER_CONTROL::OpenProject( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
|
||||
|
||||
int KICAD_MANAGER_CONTROL::OpenJobsetFile( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
wxString default_dir = wxFileName( Prj().GetProjectFullName() ).GetPathWithSep();
|
||||
wxFileDialog dlg( m_frame, _( "Create New Jobset" ), default_dir, wxEmptyString,
|
||||
FILEEXT::JobsetFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
||||
|
||||
if( dlg.ShowModal() == wxID_CANCEL )
|
||||
return -1;
|
||||
|
||||
wxFileName jobsetFn( dlg.GetPath() );
|
||||
|
||||
m_frame->OpenJobsFile( jobsetFn.GetFullPath(), true );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int KICAD_MANAGER_CONTROL::CloseProject( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
m_frame->CloseProject( true );
|
||||
@ -990,6 +1007,7 @@ void KICAD_MANAGER_CONTROL::setTransitions()
|
||||
Go( &KICAD_MANAGER_CONTROL::NewJobsetFile, KICAD_MANAGER_ACTIONS::newJobsetFile.MakeEvent() );
|
||||
Go( &KICAD_MANAGER_CONTROL::OpenDemoProject, KICAD_MANAGER_ACTIONS::openDemoProject.MakeEvent() );
|
||||
Go( &KICAD_MANAGER_CONTROL::OpenProject, KICAD_MANAGER_ACTIONS::openProject.MakeEvent() );
|
||||
Go( &KICAD_MANAGER_CONTROL::OpenJobsetFile, KICAD_MANAGER_ACTIONS::openJobsetFile.MakeEvent() );
|
||||
Go( &KICAD_MANAGER_CONTROL::CloseProject, KICAD_MANAGER_ACTIONS::closeProject.MakeEvent() );
|
||||
Go( &KICAD_MANAGER_CONTROL::SaveProjectAs, ACTIONS::saveAs.MakeEvent() );
|
||||
Go( &KICAD_MANAGER_CONTROL::LoadProject, KICAD_MANAGER_ACTIONS::loadProject.MakeEvent() );
|
||||
|
@ -50,6 +50,7 @@ public:
|
||||
int NewJobsetFile( const TOOL_EVENT& aEvent );
|
||||
int OpenProject( const TOOL_EVENT& aEvent );
|
||||
int OpenDemoProject( const TOOL_EVENT& aEvent );
|
||||
int OpenJobsetFile( const TOOL_EVENT& aEvent );
|
||||
int CloseProject( const TOOL_EVENT& aEvent );
|
||||
int SaveProjectAs( const TOOL_EVENT& aEvent );
|
||||
int LoadProject( const TOOL_EVENT& aEvent );
|
||||
|
Loading…
x
Reference in New Issue
Block a user