37#include <wx/dcclient.h>
86 m_Rescuer( &aRescuer ),
87 m_currentSheet( aCurrentSheet ),
88 m_AskShowAgain( aAskShowAgain )
90 wxASSERT( aCurrentSheet );
100 _(
"This schematic was made using older symbol libraries which may break the "
101 "schematic. Some symbols may need to be linked to a different symbol name. "
102 "Some symbols may need to be \"rescued\" (copied and renamed) into a new library.\n\n"
103 "The following changes are recommended to update the project." );
107 wxString header =
_(
"Accept" );
112 wxClientDC dc(
this );
116 int width = dc.GetTextExtent( header ).GetWidth() * 1.25;
118 m_ListOfConflicts->AppendToggleColumn( header, wxDATAVIEW_CELL_ACTIVATABLE, width,
121 header =
_(
"Symbol Name" );
122 width = dc.GetTextExtent( header ).GetWidth() * 2;
125 header =
_(
"Action Taken" );
126 width = dc.GetTextExtent( header ).GetWidth() * 10;
129 header =
_(
"Reference" );
130 width = dc.GetTextExtent( header ).GetWidth() * 2;
133 header =
_(
"Value" );
134 width = dc.GetTextExtent( header ).GetWidth() * 10;
145 int approx_info_height = ( 2 * info_size.x / prompt_size.x ) * font_size.y;
146 m_htmlPrompt->SetSizeHints( 2 * prompt_size.x / 3, approx_info_height );
152 GetSizer()->SetSizeHints(
this );
166 if( !wxDialog::TransferDataToWindow() )
181 wxVector<wxVariant> data;
186 data.push_back( wxVariant(
true ) );
210 if( row == wxNOT_FOUND )
215 wxVector<wxVariant> data;
227 data.push_back( valueField ? valueField->
GetText() : wxString( wxT(
"" ) ) );
232 wxString msg = wxString::Format(
_(
"Instances of this symbol (%d items):" ), count );
275 if( !wxDialog::TransferDataFromWindow() )
282 bool rescue_part = val.GetBool();
294 wxMessageDialog dlg( GetParent(),
295 _(
"Stop showing this tool?\n"
296 "No changes will be made.\n\n"
297 "This setting can be changed from the \"Symbol Libraries\" dialog,\n"
298 "and the tool can be activated manually from the \"Tools\" menu." ),
299 _(
"Rescue Symbols" ), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION );
300 int resp = dlg.ShowModal ();
302 if( resp == wxID_YES )
325 DIALOG_RESCUE_EACH dlg( aParent, aRescuer, aCurrentSheet, aGalBackEndType, aAskShowAgain );
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
Class DIALOG_RESCUE_EACH_BASE.
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
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
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={})
virtual const wxString & GetText() const
Return the string associated with the text object.
bool AppendToPage(const wxString &aSource)
APP_SETTINGS_BASE * KifaceSettings() const
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
std::vector< RESCUE_CANDIDATE * > m_chosen_candidates
std::vector< SCH_SYMBOL * > * GetSymbols()
Get the list of symbols that need rescued.
size_t GetCandidateCount()
Return the number of rescue candidates found.
boost::ptr_vector< RESCUE_CANDIDATE > m_all_candidates
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.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
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...
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.
Definition for symbol library class.
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".