38#include <wx/dcclient.h>
87 m_Rescuer( &aRescuer ),
88 m_currentSheet( aCurrentSheet ),
89 m_AskShowAgain( aAskShowAgain )
91 wxASSERT( aCurrentSheet );
101 _(
"This schematic was made using older symbol libraries which may break the "
102 "schematic. Some symbols may need to be linked to a different symbol name. "
103 "Some symbols may need to be \"rescued\" (copied and renamed) into a new library.\n\n"
104 "The following changes are recommended to update the project." );
108 wxString header =
_(
"Accept" );
113 wxClientDC dc(
this );
117 int width = dc.GetTextExtent( header ).GetWidth() * 1.25;
119 m_ListOfConflicts->AppendToggleColumn( header, wxDATAVIEW_CELL_ACTIVATABLE, width,
122 header =
_(
"Symbol Name" );
123 width = dc.GetTextExtent( header ).GetWidth() * 2;
126 header =
_(
"Action Taken" );
127 width = dc.GetTextExtent( header ).GetWidth() * 10;
130 header =
_(
"Reference" );
131 width = dc.GetTextExtent( header ).GetWidth() * 2;
134 header =
_(
"Value" );
135 width = dc.GetTextExtent( header ).GetWidth() * 10;
146 int approx_info_height = ( 2 * info_size.x / prompt_size.x ) * font_size.y;
147 m_htmlPrompt->SetSizeHints( 2 * prompt_size.x / 3, approx_info_height );
153 GetSizer()->SetSizeHints(
this );
167 if( !wxDialog::TransferDataToWindow() )
182 wxVector<wxVariant> data;
187 data.push_back( wxVariant(
true ) );
211 if( row == wxNOT_FOUND )
216 wxVector<wxVariant> data;
228 data.push_back( valueField ? valueField->
GetText() : wxT(
"" ) );
233 wxString msg =
wxString::Format(
_(
"Instances of this symbol (%d items):" ), count );
276 if( !wxDialog::TransferDataFromWindow() )
283 bool rescue_part = val.GetBool();
295 wxMessageDialog dlg( GetParent(),
296 _(
"Stop showing this tool?\n"
297 "No changes will be made.\n\n"
298 "This setting can be changed from the \"Symbol Libraries\" dialog,\n"
299 "and the tool can be activated manually from the \"Tools\" menu." ),
300 _(
"Rescue Symbols" ), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION );
301 int resp = dlg.ShowModal ();
303 if( resp == wxID_YES )
326 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.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition for symbol library class.
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".