38#include <wx/dcclient.h>
88 wxASSERT( aCurrentSheet );
97 wxString
info =
_(
"This schematic was made using older symbol libraries which may break the "
98 "schematic. Some symbols may need to be linked to a different symbol name. "
99 "Some symbols may need to be \"rescued\" (copied and renamed) into a new library.\n\n"
100 "The following changes are recommended to update the project." );
104 wxString header =
_(
"Accept" );
109 wxClientDC dc(
this );
113 int width = dc.GetTextExtent( header ).GetWidth() * 1.25;
115 m_ListOfConflicts->AppendToggleColumn( header, wxDATAVIEW_CELL_ACTIVATABLE, width, wxALIGN_CENTER );
117 header =
_(
"Symbol Name" );
118 width = dc.GetTextExtent( header ).GetWidth() * 2;
121 header =
_(
"Action Taken" );
122 width = dc.GetTextExtent( header ).GetWidth() * 10;
125 header =
_(
"Reference" );
126 width = dc.GetTextExtent( header ).GetWidth() * 2;
129 header =
_(
"Value" );
130 width = dc.GetTextExtent( header ).GetWidth() * 10;
141 int approx_info_height = ( 2 * info_size.x / prompt_size.x ) * font_size.y;
142 m_htmlPrompt->SetSizeHints( 2 * prompt_size.x / 3, approx_info_height );
148 GetSizer()->SetSizeHints(
this );
157 if( !wxDialog::TransferDataToWindow() )
172 wxVector<wxVariant> data;
177 data.push_back( wxVariant(
true ) );
184 if( !
m_rescuer->m_all_candidates.empty() )
201 if( row == wxNOT_FOUND )
206 wxVector<wxVariant> data;
218 data.push_back( valueField ? valueField->
GetText() : wxString( wxT(
"" ) ) );
223 wxString msg = wxString::Format(
_(
"Instances of this symbol (%d items):" ), count );
264 if( !wxDialog::TransferDataFromWindow() )
271 bool rescue_part = val.GetBool();
284 _(
"Stop showing this tool?\n"
285 "No changes will be made.\n\n"
286 "This setting can be changed from the \"Preferences\" dialog,\n"
287 "and the tool can be activated manually from the \"Tools\" menu." ),
288 _(
"Rescue Symbols" ), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION );
289 int resp = dlg.ShowModal ();
291 if( resp == wxID_YES )
314 DIALOG_RESCUE_EACH dlg( aParent, aRescuer, aCurrentSheet, aGalBackEndType, aAskShowAgain );
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
wxBoxSizer * m_SizerNewPanel
HTML_WINDOW * m_htmlPrompt
wxBoxSizer * m_SizerOldPanel
wxButton * m_stdButtonsCancel
wxButton * m_stdButtonsOK
virtual void OnCancelClick(wxCommandEvent &event)
wxPanel * m_previewNewPanel
wxDataViewListCtrl * m_ListOfConflicts
wxPanel * m_previewOldPanel
wxButton * m_btnNeverShowAgain
wxDataViewListCtrl * m_ListOfInstances
wxStdDialogButtonSizer * m_stdButtons
wxStaticText * m_titleInstances
DIALOG_RESCUE_EACH_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Project Rescue Helper"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void PopulateConflictList()
DIALOG_RESCUE_EACH(wxWindow *aParent, RESCUER &aRescuer, SCH_SHEET_PATH *aCurrentSheet, EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackEndType, bool aAskShowAgain)
This dialog asks the user which rescuable, cached parts he wants to rescue.
void OnNeverShowClick(wxCommandEvent &aEvent) override
bool TransferDataToWindow() override
void OnCancelClick(wxCommandEvent &aEvent) override
SYMBOL_PREVIEW_WIDGET * m_previewNewWidget
~DIALOG_RESCUE_EACH()=default
bool TransferDataFromWindow() override
void OnConflictSelect(wxDataViewEvent &aEvent) override
SYMBOL_PREVIEW_WIDGET * m_previewOldWidget
void PopulateInstanceList()
void displayItemsInConflict()
SCH_SHEET_PATH * m_currentSheet
void SetupStandardButtons(std::map< int, wxString > aLabels={})
APP_SETTINGS_BASE * KifaceSettings() const
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
virtual wxString GetActionDescription() const =0
Get a description of the action proposed, for displaying in the UI.
virtual LIB_SYMBOL * GetCacheCandidate() const
Get the part that can be loaded from the project cache, if possible, or else NULL.
virtual wxString GetRequestedName() const
Get the name that was originally requested in the schematic.
virtual LIB_SYMBOL * GetLibCandidate() const
Get the part the would be loaded from the libraries, if possible, or else NULL.
virtual const wxString & GetText() const override
Return the string associated with the text object.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
This file is part of the common library.
#define KICAD_MESSAGE_DIALOG
int InvokeDialogRescueEach(wxWindow *aParent, RESCUER &aRescuer, SCH_SHEET_PATH *aCurrentSheet, EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackEndType, bool aAskShowAgain)
This dialog asks the user which rescuable, cached parts he wants to rescue.
@ VALUE
Field Value of part, i.e. "3.3K".