37 #include <wx/msgdlg.h> 38 #include <wx/dcclient.h> 87 m_Rescuer( &aRescuer ),
88 m_currentSheet( aCurrentSheet ),
89 m_AskShowAgain( aAskShowAgain )
91 wxASSERT( aCurrentSheet );
103 _(
"This schematic was made using older symbol libraries which may break the " 104 "schematic. Some symbols may need to be linked to a different symbol name. " 105 "Some symbols may need to be \"rescued\" (copied and renamed) into a new library.\n\n" 106 "The following changes are recommended to update the project." );
110 wxString header =
_(
"Accept" );
115 wxClientDC dc(
this );
119 int width = dc.GetTextExtent( header ).GetWidth();
121 m_ListOfConflicts->AppendToggleColumn( header, wxDATAVIEW_CELL_ACTIVATABLE, width,
124 header =
_(
"Symbol Name" );
125 width = dc.GetTextExtent( header ).GetWidth() * 2;
128 header =
_(
"Action Taken" );
129 width = dc.GetTextExtent( header ).GetWidth() * 10;
132 header =
_(
"Reference" );
133 width = dc.GetTextExtent( header ).GetWidth() * 2;
136 header =
_(
"Value" );
137 width = dc.GetTextExtent( header ).GetWidth() * 10;
151 auto approx_info_height = ( 2 * info_size.x / prompt_size.x ) * font_size.y;
152 m_htmlPrompt->SetSizeHints( 2 * prompt_size.x / 3, approx_info_height );
154 GetSizer()->SetSizeHints(
this );
167 if( !wxDialog::TransferDataToWindow() )
182 wxVector<wxVariant> data;
186 data.push_back( wxVariant(
true ) );
209 if( row == wxNOT_FOUND )
214 wxVector<wxVariant> data;
226 data.push_back( valueField ? valueField->
GetText() : wxT(
"" ) );
231 wxString msg =
wxString::Format(
_(
"Instances of this symbol (%d items):" ), count );
274 if( !wxDialog::TransferDataFromWindow() )
281 bool rescue_part = val.GetBool();
292 wxMessageDialog dlg( GetParent(),
293 _(
"Stop showing this tool?\n" 294 "No changes will be made.\n\n" 295 "This setting can be changed from the \"Symbol Libraries\" dialog,\n" 296 "and the tool can be activated manually from the \"Tools\" menu." ),
297 _(
"Rescue Symbols" ), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION );
298 int resp = dlg.ShowModal ();
300 if( resp == wxID_YES )
302 auto cfg = dynamic_cast<EESCHEMA_SETTINGS*>(
Kiface().KifaceSettings() );
305 cfg->m_RescueNeverShow =
true;
323 DIALOG_RESCUE_EACH dlg( aParent, aRescuer, aCurrentSheet, aGalBackEndType, aAskShowAgain );
wxPanel * m_previewNewPanel
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
void setSizeInDU(int x, int y)
Set the dialog to the given dimensions in "dialog units".
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
virtual LIB_PART * GetLibCandidate() const
Get the part the would be loaded from the libraries, if possible, or else NULL.
virtual wxString GetActionDescription() const =0
Get a description of the action proposed, for displaying in the UI.
virtual wxString GetRequestedName() const
Get the name that was originally requested in the schematic.
bool TransferDataFromWindow() override
Class DIALOG_RESCUE_EACH_BASE.
wxBoxSizer * m_SizerNewPanel
SCH_SHEET_PATH * m_currentSheet
void displayItemsInConflict()
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.
virtual void OnCancelClick(wxCommandEvent &event)
boost::ptr_vector< RESCUE_CANDIDATE > m_all_candidates
bool TransferDataToWindow() override
wxButton * m_btnNeverShowAgain
Field Value of part, i.e. "3.3K".
SYMBOL_PREVIEW_WIDGET * m_previewOldWidget
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
size_t GetCandidateCount()
Returen the number of rescue candidates found.
virtual LIB_PART * GetCacheCandidate() const
Get the part that can be loaded from the project cache, if possible, or else NULL.
wxBoxSizer * m_SizerOldPanel
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
wxHtmlWindow * m_htmlPrompt
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
std::vector< RESCUE_CANDIDATE * > m_chosen_candidates
void OnConflictSelect(wxDataViewEvent &aEvent) override
wxStaticText * m_titleInstances
void OnNeverShowClick(wxCommandEvent &aEvent) override
std::vector< SCH_COMPONENT * > * GetComponents()
Get the list of symbols that need rescued.
void OnCancelClick(wxCommandEvent &aEvent) override
wxButton * m_stdButtonsOK
wxDataViewListCtrl * m_ListOfConflicts
void PopulateInstanceList()
Definition for part library class.
wxPanel * m_previewOldPanel
SYMBOL_PREVIEW_WIDGET * m_previewNewWidget
virtual const wxString & GetText() const
Return the string associated with the text object.
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 PopulateConflictList()
wxDataViewListCtrl * m_ListOfInstances