Browse Source

Footprint Editor: make call to DXF importer not possible if a footprint does not exist, to avoid crash. ( It fixes an issue on Unity, where the file menu to call the DXF importer is not always disabled when no footprint loaded)

pull/7/head
jean-pierre charras 10 years ago
parent
commit
8193a898f3
  1. 3
      pcbnew/dialogs/dialog_export_vrml.cpp
  2. 7
      pcbnew/modedit.cpp
  3. 1
      pcbnew/moduleframe.cpp

3
pcbnew/dialogs/dialog_export_vrml.cpp

@ -242,7 +242,8 @@ void PCB_EDIT_FRAME::OnExportVRML( wxCommandEvent& event )
usePlainPCB, modelPath.GetPath(),
aXRef, aYRef ) )
{
wxString msg = _( "Unable to create file " ) + fullFilename;
wxString msg;
msg.Printf( _( "Unable to create file '%s'" ), GetChars( fullFilename ) );
wxMessageBox( msg );
return;
}

7
pcbnew/modedit.cpp

@ -839,8 +839,11 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_GEN_IMPORT_DXF_FILE:
InvokeDXFDialogModuleImport( this, GetBoard()->m_Modules );
m_canvas->Refresh();
if( GetBoard()->m_Modules )
{
InvokeDXFDialogModuleImport( this, GetBoard()->m_Modules );
m_canvas->Refresh();
}
break;
default:

1
pcbnew/moduleframe.cpp

@ -171,6 +171,7 @@ BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU( ID_MENU_CANVAS_CAIRO, PCB_BASE_FRAME::SwitchCanvas )
EVT_MENU( ID_MENU_CANVAS_OPENGL, PCB_BASE_FRAME::SwitchCanvas )
// UI update events.
EVT_UPDATE_UI( ID_MODEDIT_DELETE_PART, FOOTPRINT_EDIT_FRAME::OnUpdateLibSelected )
EVT_UPDATE_UI( ID_MODEDIT_SELECT_CURRENT_LIB, FOOTPRINT_EDIT_FRAME::OnUpdateSelectCurrentLib )
EVT_UPDATE_UI( ID_MODEDIT_EXPORT_PART, FOOTPRINT_EDIT_FRAME::OnUpdateModuleSelected )

Loading…
Cancel
Save