27#include <wx/filedlg.h>
28#include <wx/filename.h>
38 m_reportList->AppendTextColumn(
_(
"Action" ), wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE );
39 m_reportList->AppendTextColumn(
_(
"Feature" ), wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE );
40 m_reportList->AppendTextColumn(
_(
"Detail" ), wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE );
46 if( entry.m_bucket != aBucket )
49 wxString feature = entry.m_feature;
51 if( entry.m_count > 1 )
52 feature += wxString::Format( wxT(
" (%d)" ), entry.m_count );
54 wxVector<wxVariant> row;
55 row.push_back( wxVariant( aLabel ) );
56 row.push_back( wxVariant( feature ) );
57 row.push_back( wxVariant( entry.m_detail ) );
68 m_headline->SetLabel( wxString::Format(
_(
"This project uses features %s cannot represent." ), aTargetName ) );
75 m_headline->SetLabel( wxString::Format(
_(
"Exporting to %s will change some features:" ), aTargetName ) );
86 wxFileDialog dlg(
this,
_(
"Save Compatibility Report" ), fn.GetPath(), fn.GetFullName(),
91 if( dlg.ShowModal() != wxID_OK )
96 if( fn.GetExt().IsEmpty() )
102 && wxMessageBox( wxString::Format(
_(
"The file '%s' already exists. Overwrite it?" ), fn.GetFullPath() ),
103 _(
"Save Compatibility Report" ), wxYES_NO | wxNO_DEFAULT | wxICON_WARNING,
this )
115 DisplayErrorMessage(
this, wxString::Format(
_(
"Cannot write report to file '%s'." ), fn.GetFullPath() ),
What an export to a given target will keep, approximate, drop, or block.
bool IsBlocked() const
True if some feature makes the target impossible. The user cannot export anyway.
const std::vector< COMPAT_ENTRY > & Entries() const
wxButton * m_sdbSizerCancel
DIALOG_DOWNGRADE_REPORT_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Compatibility Report"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(500, 386), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxDataViewListCtrl * m_reportList
wxStaticText * m_headline
void OnSaveReport(wxCommandEvent &aEvent) override
DIALOG_DOWNGRADE_REPORT(wxWindow *aParent, const wxString &aTargetName, const COMPATIBILITY_REPORT &aReport)
const wxString m_reportText
wxString m_reportFileName
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
DOWNGRADE_BUCKET
What happens to a feature when we export to an older KiCad.
@ BLOCK
Cannot be represented at all, export to this target is not possible.
@ LOWER
Approximated down to a simpler equivalent.
@ DROP
No equivalent, left out.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
static const std::string TextFileExtension
static wxString TextFileWildcard()
One line in the compatibility report.
Definition of file extensions used in Kicad.