From 24b8f4a5b29e5d3a40895dab8add71af7452f914 Mon Sep 17 00:00:00 2001 From: charras Date: Thu, 9 Apr 2009 13:21:26 +0000 Subject: [PATCH] Fixed: inconsistencies in dialog_eeschema_config.cpp (delete and add/insert do not have the same behavior: add/insert cannot be cancelled ) --- eeschema/dialog_eeschema_config.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/eeschema/dialog_eeschema_config.cpp b/eeschema/dialog_eeschema_config.cpp index 073cdfdb95..6e50c49d06 100644 --- a/eeschema/dialog_eeschema_config.cpp +++ b/eeschema/dialog_eeschema_config.cpp @@ -176,6 +176,9 @@ void DIALOG_EESCHEMA_CONFIG::OnCloseWindow( wxCloseEvent& 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; @@ -192,9 +195,10 @@ void DIALOG_EESCHEMA_CONFIG::OnRemoveLibClick( wxCommandEvent& event ) void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) /**************************************************************************/ -/* Insert or add a library to the existing library list: - * New library is put in list before (insert) or after (add) - * the selection +/* Insert or add a library to the library list: + * The new library is put in list before (insert button) 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; @@ -236,9 +240,9 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) { m_LibListChanged = TRUE; if( event.GetId() == ID_ADD_LIB ) - g_LibName_List.Add( tmp ); + m_ListLibr->Append( tmp ); else - g_LibName_List.Insert( tmp, ii++ ); + m_ListLibr->Insert( tmp, ii++ ); } else { @@ -247,9 +251,6 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event ) DisplayError( this, msg ); } } - - m_ListLibr->Clear(); - m_ListLibr->InsertItems( g_LibName_List, 0 ); }