Check for read permissions before trying to import schematic file
This will display a better error message to the user, instead of saying that no plugins to load the file are found (because the plugin tests will also fail due to being unable to read the file).
This commit is contained in:
parent
87a8235831
commit
e67eae90e9
|
@ -758,6 +758,12 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent )
|
||||||
|
|
||||||
wxFileName fn = dlg.GetPath();
|
wxFileName fn = dlg.GetPath();
|
||||||
|
|
||||||
|
if( !fn.IsFileReadable() )
|
||||||
|
{
|
||||||
|
wxLogError( _( "Insufficient permissions to read file '%s'." ), fn.GetFullPath() );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SCH_IO_MGR::SCH_FILE_T pluginType = SCH_IO_MGR::SCH_FILE_T::SCH_FILE_UNKNOWN;
|
SCH_IO_MGR::SCH_FILE_T pluginType = SCH_IO_MGR::SCH_FILE_T::SCH_FILE_UNKNOWN;
|
||||||
|
|
||||||
for( const SCH_IO_MGR::SCH_FILE_T& fileType : SCH_IO_MGR::SCH_FILE_T_vector )
|
for( const SCH_IO_MGR::SCH_FILE_T& fileType : SCH_IO_MGR::SCH_FILE_T_vector )
|
||||||
|
|
Loading…
Reference in New Issue