Make sure reporters have a better default path than /bin.

This commit is contained in:
Jeff Young 2021-02-25 15:05:26 +00:00
parent 4d2a1055d3
commit b8c95345d0
14 changed files with 25 additions and 40 deletions

View File

@ -37,8 +37,7 @@ WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL( wxWindow* parent,
WX_HTML_REPORT_PANEL_BASE( parent, id, pos, size, style ), WX_HTML_REPORT_PANEL_BASE( parent, id, pos, size, style ),
m_reporter( this ), m_reporter( this ),
m_severities( -1 ), m_severities( -1 ),
m_lazyUpdate( false ), m_lazyUpdate( false )
m_printInfo( true )
{ {
syncCheckboxes(); syncCheckboxes();
m_htmlView->SetPage( addHeader( "" ) ); m_htmlView->SetPage( addHeader( "" ) );
@ -409,12 +408,6 @@ wxString& WX_HTML_REPORT_PANEL::GetFileName( void )
} }
void WX_HTML_REPORT_PANEL::SetPrintInfo( bool aPrintInfo )
{
m_printInfo = aPrintInfo;
}
void WX_HTML_REPORT_PANEL::SetShowSeverity( SEVERITY aSeverity, bool aValue ) void WX_HTML_REPORT_PANEL::SetShowSeverity( SEVERITY aSeverity, bool aValue )
{ {
switch( aSeverity ) switch( aSeverity )

View File

@ -85,9 +85,6 @@ public:
///< If the m_showAll option is set, the mask is < 0 ///< If the m_showAll option is set, the mask is < 0
int GetVisibleSeverities() const; int GetVisibleSeverities() const;
///< If true prints Info: at the beginning of each Info severity line (Default)
void SetPrintInfo( bool aPrintInfo );
///< @return the visible severity filter. ///< @return the visible severity filter.
///< If the m_showAll option is set, the mask is < 0 ///< If the m_showAll option is set, the mask is < 0
void SetShowSeverity( SEVERITY aSeverity, bool aValue ); void SetShowSeverity( SEVERITY aSeverity, bool aValue );
@ -126,28 +123,17 @@ private:
void onBtnSaveToFile( wxCommandEvent& event ) override; void onBtnSaveToFile( wxCommandEvent& event ) override;
///< copy of the report, stored for filtering private:
REPORT_LINES m_report;
///< Lines to print at the very end of the report, regardless of sorting
REPORT_LINES m_reportTail;
///< Lines to print at the very beginning of the report, regardless of sorting
REPORT_LINES m_reportHead;
///< the reporter
WX_HTML_PANEL_REPORTER m_reporter; WX_HTML_PANEL_REPORTER m_reporter;
///< message severities to display (mask) REPORT_LINES m_report; ///< copy of the report, stored for filtering
int m_severities; REPORT_LINES m_reportTail; ///< Lines to print at the end, regardless of sorting
REPORT_LINES m_reportHead; ///< ... and at the beginning, regardless of sorting
bool m_lazyUpdate; int m_severities; ///< message severities to display (mask)
bool m_lazyUpdate;
///< Print "Info:" at the front of Info messages (default) wxString m_reportFileName; ///< defaults to the not very useful /bin/report.txt
bool m_printInfo;
///< Use this as the filename instead of /bin/report.txt (default)
wxString m_reportFileName;
}; };
#endif //__WX_HTML_REPORT_PANEL_H__ #endif //__WX_HTML_REPORT_PANEL_H__

View File

@ -96,6 +96,7 @@ DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent, const wxString& messag
} }
m_MessageWindow->SetLabel( _( "Annotation Messages:" ) ); m_MessageWindow->SetLabel( _( "Annotation Messages:" ) );
m_MessageWindow->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
// We use a sdbSizer to get platform-dependent ordering of the action buttons, but // We use a sdbSizer to get platform-dependent ordering of the action buttons, but
// that requires us to correct the button labels here. // that requires us to correct the button labels here.

View File

@ -111,6 +111,7 @@ DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS( SCH_EDIT_FRAME* aParent, SCH_COMPO
} }
m_messagePanel->SetLazyUpdate( true ); m_messagePanel->SetLazyUpdate( true );
m_messagePanel->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
if( aSymbol && aSymbol->IsSelected() ) if( aSymbol && aSymbol->IsSelected() )
{ {

View File

@ -25,6 +25,7 @@
*/ */
#include <bitmaps.h> #include <bitmaps.h>
#include <dialogs/wx_html_report_panel.h>
#include <dialog_plot_schematic.h> #include <dialog_plot_schematic.h>
#include <eeschema_settings.h> #include <eeschema_settings.h>
#include <kiface_i.h> #include <kiface_i.h>
@ -54,6 +55,8 @@ DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC( SCH_EDIT_FRAME* parent )
m_browseButton->SetBitmap( KiBitmap( small_folder_xpm ) ); m_browseButton->SetBitmap( KiBitmap( small_folder_xpm ) );
m_MessagesBox->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
// We use a sdbSizer to get platform-dependent ordering of the action buttons, but // We use a sdbSizer to get platform-dependent ordering of the action buttons, but
// that requires us to correct the button labels here. // that requires us to correct the button labels here.
m_sdbSizer1OK->SetLabel( _( "Plot All Pages" ) ); m_sdbSizer1OK->SetLabel( _( "Plot All Pages" ) );

View File

@ -73,6 +73,8 @@ DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP( SCH_EDIT_FRAME* aParent ) :
"you will be responsible for manually remapping the symbols." ); "you will be responsible for manually remapping the symbols." );
m_htmlCtrl->AppendToPage( text ); m_htmlCtrl->AppendToPage( text );
m_messagePanel->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
} }

View File

@ -40,6 +40,7 @@ DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB( SCH_EDIT_FRAME* aParent )
{ {
m_messagePanel->SetLabel( _( "Changes To Be Applied" ) ); m_messagePanel->SetLabel( _( "Changes To Be Applied" ) );
m_messagePanel->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
m_messagePanel->SetLazyUpdate( true ); m_messagePanel->SetLazyUpdate( true );
m_messagePanel->GetSizer()->SetSizeHints( this ); m_messagePanel->GetSizer()->SetSizeHints( this );

View File

@ -163,17 +163,7 @@ DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE( PCB_EDIT_FRAME* aParentFrame )
m_ExcludeList->SetToolTip( m_ExcludeListText->GetToolTipText() ); m_ExcludeList->SetToolTip( m_ExcludeListText->GetToolTipText() );
m_GridChoice->SetToolTip( m_SortGridText->GetToolTipText() ); m_GridChoice->SetToolTip( m_SortGridText->GetToolTipText() );
// Set the reporter window filename to something sensible m_MessageWindow->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
if( m_MessageWindow->GetFileName().empty() )
{
wxFileName fn = m_frame->GetBoard()->GetFileName();
fn.SetName( "annotationreport" );
fn.SetExt( "txt " );
wxString fullname = fn.GetFullPath();
m_MessageWindow->SetFileName( fullname );
}
m_MessageWindow->SetPrintInfo( false ); // Suppress the "Info: " prefix
finishDialogSettings(); finishDialogSettings();
} }

View File

@ -146,6 +146,7 @@ DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS( PCB_EDIT_FRAME* aParent,
m_reset3DModels->SetValue( g_reset3DModels[ m_updateMode ? 0 : 1 ] ); m_reset3DModels->SetValue( g_reset3DModels[ m_updateMode ? 0 : 1 ] );
m_MessageWindow->SetLazyUpdate( true ); m_MessageWindow->SetLazyUpdate( true );
m_MessageWindow->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
// DIALOG_SHIM needs a unique hash_key because classname is not sufficient // DIALOG_SHIM needs a unique hash_key because classname is not sufficient
// because the update and change versions of this dialog have different controls. // because the update and change versions of this dialog have different controls.

View File

@ -83,6 +83,8 @@ DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG( PCB_EDIT_FRAME* aParent, BOARD* aBoard ) :
{ {
m_browseButton->SetBitmap( KiBitmap( small_folder_xpm ) ); m_browseButton->SetBitmap( KiBitmap( small_folder_xpm ) );
m_messagesPanel->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
initDialog(); initDialog();
// We use a sdbSizer to get platform-dependent ordering of the action buttons, but // We use a sdbSizer to get platform-dependent ordering of the action buttons, but

View File

@ -80,6 +80,7 @@ DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxString& aNetlistFullF
m_MessageWindow->SetLabel( _("Changes To Be Applied") ); m_MessageWindow->SetLabel( _("Changes To Be Applied") );
m_MessageWindow->SetVisibleSeverities( cfg->m_NetlistDialog.report_filter ); m_MessageWindow->SetVisibleSeverities( cfg->m_NetlistDialog.report_filter );
m_MessageWindow->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
// We use a sdbSizer to get platform-dependent ordering of the action buttons, but // We use a sdbSizer to get platform-dependent ordering of the action buttons, but
// that requires us to correct the button labels here. // that requires us to correct the button labels here.

View File

@ -54,6 +54,8 @@ DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* aParent ) :
m_plotOpts = aParent->GetPlotSettings(); m_plotOpts = aParent->GetPlotSettings();
m_DRCWarningTemplate = m_DRCExclusionsWarning->GetLabel(); m_DRCWarningTemplate = m_DRCExclusionsWarning->GetLabel();
m_messagesPanel->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
init_Dialog(); init_Dialog();
// We use a sdbSizer to get platform-dependent ordering of the action buttons, but // We use a sdbSizer to get platform-dependent ordering of the action buttons, but

View File

@ -51,6 +51,7 @@ DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB( PCB_EDIT_FRAME* aParent, NETLIST* aNetlist
m_cbWarnNoNetPad->SetValue( m_warnForNoNetPads ); m_cbWarnNoNetPad->SetValue( m_warnForNoNetPads );
m_messagePanel->SetLabel( _("Changes To Be Applied") ); m_messagePanel->SetLabel( _("Changes To Be Applied") );
m_messagePanel->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
m_messagePanel->SetLazyUpdate( true ); m_messagePanel->SetLazyUpdate( true );
m_netlist->SortByReference(); m_netlist->SortByReference();

View File

@ -57,6 +57,7 @@ public:
m_parent( aParent ), m_parent( aParent ),
m_plotOpts( aParent->GetPlotSettings() ) m_plotOpts( aParent->GetPlotSettings() )
{ {
m_messagesPanel->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
m_reporter = &m_messagesPanel->Reporter(); m_reporter = &m_messagesPanel->Reporter();
initDialog(); initDialog();