Commit 87bc31bb authored by charras's avatar charras

Eeschema: fixed minor bug: unexpected error message when creating a new lib

parent 6700c604
...@@ -80,10 +80,15 @@ void WinEDA_LibeditFrame::OnImportPart( wxCommandEvent& event ) ...@@ -80,10 +80,15 @@ void WinEDA_LibeditFrame::OnImportPart( wxCommandEvent& event )
} }
/* Routine to create a new library and backup the current component in /* Routine to create a new library and backup the current component in this
* this library. * library or export the component of the current library.
* Create_lib == TRUE if the backup directory of library. * createLib == TRUE if we are creating a new library.
* If not: backup as the request without modifications. * If not: export the library component.
* Basically these 2 options do the same thing, but for user's convenience
* > When creating a new lib, the user is prompted to add the new lib to
* current eeschema config library list
* > When exporting there is no message (it is expected the user does not want to add the
* new created lib
* *
* The file format is created in all cases the same. * The file format is created in all cases the same.
*/ */
...@@ -92,7 +97,7 @@ void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event ) ...@@ -92,7 +97,7 @@ void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event )
wxFileName fn; wxFileName fn;
wxString msg, title; wxString msg, title;
CMP_LIBRARY* CurLibTmp; CMP_LIBRARY* CurLibTmp;
bool createLib = ( event.GetId() != ExportPartId ) ? false : true; bool createLib = ( event.GetId() == ExportPartId ) ? false : true;
if( m_component == NULL ) if( m_component == NULL )
{ {
...@@ -127,13 +132,18 @@ void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event ) ...@@ -127,13 +132,18 @@ void WinEDA_LibeditFrame::OnExportPart( wxCommandEvent& event )
delete m_library; delete m_library;
m_library = CurLibTmp; m_library = CurLibTmp;
if( createLib && success ) if( success )
{ {
msg = fn.GetFullPath() + _( " - OK" ); if( createLib )
DisplayInfoMessage( this, _( "This library will not be available \ {
msg = fn.GetFullPath() + _( " - OK" );
DisplayInfoMessage( this, _( "This library will not be available \
until it is loaded by EESchema.\n\nModify the EESchema library configuration \ until it is loaded by EESchema.\n\nModify the EESchema library configuration \
if you want to include it as part of this project." ) ); if you want to include it as part of this project." ) );
} }
else
msg = fn.GetFullPath() + _( " - Export OK" );
} // Error
else else
msg = _( "Error creating " ) + fn.GetFullName(); msg = _( "Error creating " ) + fn.GetFullName();
Affiche_Message( msg ); Affiche_Message( msg );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment