37#include <wx/dcclient.h>
86 m_Rescuer( &aRescuer ),
87 m_currentSheet( aCurrentSheet ),
88 m_AskShowAgain( aAskShowAgain )
90 wxASSERT( aCurrentSheet );
102 _(
"This schematic was made using older symbol libraries which may break the "
103 "schematic. Some symbols may need to be linked to a different symbol name. "
104 "Some symbols may need to be \"rescued\" (copied and renamed) into a new library.\n\n"
105 "The following changes are recommended to update the project." );
109 wxString header =
_(
"Accept" );
114 wxClientDC dc(
this );
118 int width = dc.GetTextExtent( header ).GetWidth() * 1.25;
120 m_ListOfConflicts->AppendToggleColumn( header, wxDATAVIEW_CELL_ACTIVATABLE, width,
123 header =
_(
"Symbol Name" );
124 width = dc.GetTextExtent( header ).GetWidth() * 2;
127 header =
_(
"Action Taken" );
128 width = dc.GetTextExtent( header ).GetWidth() * 10;
131 header =
_(
"Reference" );
132 width = dc.GetTextExtent( header ).GetWidth() * 2;
135 header =
_(
"Value" );
136 width = dc.GetTextExtent( header ).GetWidth() * 10;
147 int approx_info_height = ( 2 * info_size.x / prompt_size.x ) * font_size.y;
148 m_htmlPrompt->SetSizeHints( 2 * prompt_size.x / 3, approx_info_height );
154 GetSizer()->SetSizeHints(
this );
168 if( !wxDialog::TransferDataToWindow() )
183 wxVector<wxVariant> data;
188 data.push_back( wxVariant(
true ) );
212 if( row == wxNOT_FOUND )
217 wxVector<wxVariant> data;
229 data.push_back( valueField ? valueField->
GetText() : wxString( wxT(
"" ) ) );
234 wxString msg = wxString::Format(
_(
"Instances of this symbol (%d items):" ), count );
277 if( !wxDialog::TransferDataFromWindow() )
284 bool rescue_part = val.GetBool();
296 wxMessageDialog dlg( GetParent(),
297 _(
"Stop showing this tool?\n"
298 "No changes will be made.\n\n"
299 "This setting can be changed from the \"Preferences\" dialog,\n"
300 "and the tool can be activated manually from the \"Tools\" menu." ),
301 _(
"Rescue Symbols" ), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION );
302 int resp = dlg.ShowModal ();
304 if( resp == wxID_YES )
327 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".