diff --git a/eeschema/dialogs/dialog_rescue_each.cpp b/eeschema/dialogs/dialog_rescue_each.cpp index ff64327f64..a6d07f99d5 100644 --- a/eeschema/dialogs/dialog_rescue_each.cpp +++ b/eeschema/dialogs/dialog_rescue_each.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2015-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -114,7 +114,7 @@ DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH( wxWindow* aParent, dc.SetFont( font ); - int width = dc.GetTextExtent( header ).GetWidth(); + int width = dc.GetTextExtent( header ).GetWidth() * 1.25; m_ListOfConflicts->AppendToggleColumn( header, wxDATAVIEW_CELL_ACTIVATABLE, width, wxALIGN_CENTER ); @@ -138,9 +138,6 @@ DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH( wxWindow* aParent, m_previewOldWidget->SetLayoutDirection( wxLayout_LeftToRight ); m_previewNewWidget->SetLayoutDirection( wxLayout_LeftToRight ); - Layout(); - setSizeInDU( 480, 360 ); - // Make sure the HTML window is large enough. Some fun size juggling and // fudge factors here but it does seem to work pretty reliably. wxSize info_size = m_htmlPrompt->GetTextExtent( info ); @@ -150,10 +147,12 @@ DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH( wxWindow* aParent, m_htmlPrompt->SetSizeHints( 2 * prompt_size.x / 3, approx_info_height ); SetupStandardButtons(); + m_stdButtonsOK->SetLabel( _( "Rescue Symbols" ) ); + m_stdButtonsCancel->SetLabel( _( "Skip Symbol Rescue" ) ); + m_stdButtons->Layout(); + GetSizer()->SetSizeHints( this ); Layout(); - GetSizer()->SetSizeHints( this ); - setSizeInDU( 480, 360 ); Center(); } @@ -181,6 +180,7 @@ bool DIALOG_RESCUE_EACH::TransferDataToWindow() void DIALOG_RESCUE_EACH::PopulateConflictList() { wxVector data; + for( RESCUE_CANDIDATE& each_candidate : m_Rescuer->m_all_candidates ) { data.clear(); @@ -195,6 +195,7 @@ void DIALOG_RESCUE_EACH::PopulateConflictList() { // Select the first choice m_ListOfConflicts->SelectRow( 0 ); + // Ensure this choice is displayed: displayItemsInConflict(); } @@ -284,6 +285,7 @@ bool DIALOG_RESCUE_EACH::TransferDataFromWindow() if( rescue_part ) m_Rescuer->m_chosen_candidates.push_back( &m_Rescuer->m_all_candidates[index] ); } + return true; } @@ -291,11 +293,11 @@ bool DIALOG_RESCUE_EACH::TransferDataFromWindow() void DIALOG_RESCUE_EACH::OnNeverShowClick( wxCommandEvent& aEvent ) { wxMessageDialog dlg( GetParent(), - _( "Stop showing this tool?\n" - "No changes will be made.\n\n" - "This setting can be changed from the \"Symbol Libraries\" dialog,\n" - "and the tool can be activated manually from the \"Tools\" menu." ), - _( "Rescue Symbols" ), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION ); + _( "Stop showing this tool?\n" + "No changes will be made.\n\n" + "This setting can be changed from the \"Symbol Libraries\" dialog,\n" + "and the tool can be activated manually from the \"Tools\" menu." ), + _( "Rescue Symbols" ), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION ); int resp = dlg.ShowModal (); if( resp == wxID_YES ) diff --git a/eeschema/dialogs/dialog_rescue_each_base.cpp b/eeschema/dialogs/dialog_rescue_each_base.cpp index 90f22b0a79..843408d37e 100644 --- a/eeschema/dialogs/dialog_rescue_each_base.cpp +++ b/eeschema/dialogs/dialog_rescue_each_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0) +// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -11,7 +11,7 @@ DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { - this->SetSizeHints( wxSize( 400,-1 ), wxDefaultSize ); + this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); wxBoxSizer* bSizerMain; bSizerMain = new wxBoxSizer( wxVERTICAL ); @@ -27,24 +27,24 @@ DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID i m_titleSymbols = new wxStaticText( this, wxID_ANY, _("Symbols to update:"), wxDefaultPosition, wxDefaultSize, 0 ); m_titleSymbols->Wrap( -1 ); - m_titleSymbols->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + m_titleSymbols->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); - bSizer8->Add( m_titleSymbols, 0, wxLEFT|wxRIGHT, 10 ); + bSizer8->Add( m_titleSymbols, 0, wxEXPAND|wxLEFT|wxRIGHT, 10 ); m_ListOfConflicts = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); bSizer8->Add( m_ListOfConflicts, 2, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 ); m_titleInstances = new wxStaticText( this, wxID_ANY, _("Instances of this symbol:"), wxDefaultPosition, wxDefaultSize, 0 ); m_titleInstances->Wrap( -1 ); - m_titleInstances->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + m_titleInstances->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); - bSizer8->Add( m_titleInstances, 0, wxRIGHT|wxLEFT, 10 ); + bSizer8->Add( m_titleInstances, 0, wxEXPAND|wxLEFT|wxRIGHT, 10 ); m_ListOfInstances = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer8->Add( m_ListOfInstances, 2, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 ); + bSizer8->Add( m_ListOfInstances, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 ); - bSizerMain->Add( bSizer8, 2, wxEXPAND, 5 ); + bSizerMain->Add( bSizer8, 3, wxEXPAND, 5 ); wxBoxSizer* bSizerPreviews; bSizerPreviews = new wxBoxSizer( wxHORIZONTAL ); @@ -54,11 +54,13 @@ DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID i m_previewOldLabel = new wxStaticText( this, wxID_ANY, _("Cached Symbol:"), wxDefaultPosition, wxDefaultSize, 0 ); m_previewOldLabel->Wrap( -1 ); - m_previewOldLabel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + m_previewOldLabel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); bSizerLeftPreview->Add( m_previewOldLabel, 0, 0, 5 ); m_previewOldPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_previewOldPanel->SetMinSize( wxSize( 350,-1 ) ); + m_SizerOldPanel = new wxBoxSizer( wxVERTICAL ); @@ -75,11 +77,13 @@ DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID i m_previewNewLabel = new wxStaticText( this, wxID_ANY, _("Library Symbol:"), wxDefaultPosition, wxDefaultSize, 0 ); m_previewNewLabel->Wrap( -1 ); - m_previewNewLabel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + m_previewNewLabel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); bSizerRightPreview->Add( m_previewNewLabel, 0, 0, 5 ); m_previewNewPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_previewNewPanel->SetMinSize( wxSize( 350,-1 ) ); + m_SizerNewPanel = new wxBoxSizer( wxVERTICAL ); @@ -92,7 +96,7 @@ DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID i bSizerPreviews->Add( bSizerRightPreview, 1, wxEXPAND, 5 ); - bSizerMain->Add( bSizerPreviews, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 ); + bSizerMain->Add( bSizerPreviews, 2, wxEXPAND|wxRIGHT|wxLEFT, 10 ); wxBoxSizer* bSizer5; bSizer5 = new wxBoxSizer( wxHORIZONTAL ); diff --git a/eeschema/dialogs/dialog_rescue_each_base.fbp b/eeschema/dialogs/dialog_rescue_each_base.fbp index a79dd76fb3..61abeb395c 100644 --- a/eeschema/dialogs/dialog_rescue_each_base.fbp +++ b/eeschema/dialogs/dialog_rescue_each_base.fbp @@ -44,7 +44,7 @@ 0 wxID_ANY - 400,-1 + -1,-1 DIALOG_RESCUE_EACH_BASE -1,-1 @@ -65,7 +65,7 @@ 5 wxEXPAND - 2 + 3 bSizer8 @@ -131,7 +131,7 @@ 10 - wxLEFT|wxRIGHT + wxEXPAND|wxLEFT|wxRIGHT 0 1 @@ -220,7 +220,7 @@ 10 - wxRIGHT|wxLEFT + wxEXPAND|wxLEFT|wxRIGHT 0 1 @@ -282,7 +282,7 @@ 10 wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 2 + 1 @@ -311,7 +311,7 @@ 10 wxEXPAND|wxRIGHT|wxLEFT - 1 + 2 bSizerPreviews @@ -422,9 +422,9 @@ 0 - + -1,-1 0 - + 350,-1 1 m_previewOldPanel 1 @@ -556,10 +556,10 @@ wxID_ANY 0 - - + -1,-1 + -1,-1 0 - + 350,-1 1 m_previewNewPanel 1 diff --git a/eeschema/dialogs/dialog_rescue_each_base.h b/eeschema/dialogs/dialog_rescue_each_base.h index f513e1721a..e7a8f7de97 100644 --- a/eeschema/dialogs/dialog_rescue_each_base.h +++ b/eeschema/dialogs/dialog_rescue_each_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0) +// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE!