Commit 24b8f4a5 authored by charras's avatar charras

Fixed: inconsistencies in dialog_eeschema_config.cpp (delete and add/insert do...

Fixed: inconsistencies in dialog_eeschema_config.cpp (delete and add/insert do not have the same behavior: add/insert cannot be cancelled )
parent dea07b0f
...@@ -176,6 +176,9 @@ void DIALOG_EESCHEMA_CONFIG::OnCloseWindow( wxCloseEvent& event ) ...@@ -176,6 +176,9 @@ void DIALOG_EESCHEMA_CONFIG::OnCloseWindow( wxCloseEvent& event )
/*********************************************************************/ /*********************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnRemoveLibClick( wxCommandEvent& event ) void DIALOG_EESCHEMA_CONFIG::OnRemoveLibClick( wxCommandEvent& event )
/*********************************************************************/ /*********************************************************************/
/* Remove a library to the library list.
* The real list (g_LibName_List) is not changed, so the change can be cancelled
*/
{ {
int ii; int ii;
...@@ -192,9 +195,10 @@ void DIALOG_EESCHEMA_CONFIG::OnRemoveLibClick( wxCommandEvent& event ) ...@@ -192,9 +195,10 @@ void DIALOG_EESCHEMA_CONFIG::OnRemoveLibClick( wxCommandEvent& event )
void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
/**************************************************************************/ /**************************************************************************/
/* Insert or add a library to the existing library list: /* Insert or add a library to the library list:
* New library is put in list before (insert) or after (add) * The new library is put in list before (insert button) the selection,
* the selection * or added (add button) to end of list
* The real list (g_LibName_List) is not changed, so the change can be cancelled
*/ */
{ {
int ii; int ii;
...@@ -236,9 +240,9 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) ...@@ -236,9 +240,9 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
{ {
m_LibListChanged = TRUE; m_LibListChanged = TRUE;
if( event.GetId() == ID_ADD_LIB ) if( event.GetId() == ID_ADD_LIB )
g_LibName_List.Add( tmp ); m_ListLibr->Append( tmp );
else else
g_LibName_List.Insert( tmp, ii++ ); m_ListLibr->Insert( tmp, ii++ );
} }
else else
{ {
...@@ -247,9 +251,6 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) ...@@ -247,9 +251,6 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
DisplayError( this, msg ); DisplayError( this, msg );
} }
} }
m_ListLibr->Clear();
m_ListLibr->InsertItems( g_LibName_List, 0 );
} }
......
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