2015-06-16 12:20:42 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2015 CERN
|
2018-05-23 09:31:13 +00:00
|
|
|
* Copyright (C) 2015-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
2015-06-16 12:20:42 +00:00
|
|
|
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 2 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2018-05-21 22:28:26 +00:00
|
|
|
#include <algorithm>
|
|
|
|
|
2015-06-16 12:20:42 +00:00
|
|
|
#include "wx_html_report_panel.h"
|
|
|
|
|
|
|
|
#include <wildcards_and_files_ext.h>
|
2018-02-20 01:40:14 +00:00
|
|
|
#include <gal/color4d.h>
|
2018-03-19 16:03:36 +00:00
|
|
|
#include <wx/clipbrd.h>
|
2015-06-16 12:20:42 +00:00
|
|
|
|
|
|
|
WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL( wxWindow* parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxSize& size,
|
|
|
|
long style ) :
|
|
|
|
WX_HTML_REPORT_PANEL_BASE( parent, id, pos, size, style ),
|
|
|
|
m_reporter( this ),
|
|
|
|
m_severities( -1 ),
|
2015-07-24 15:47:48 +00:00
|
|
|
m_lazyUpdate( false )
|
2015-06-16 12:20:42 +00:00
|
|
|
{
|
|
|
|
syncCheckboxes();
|
2015-06-26 15:34:07 +00:00
|
|
|
m_htmlView->SetPage( addHeader( "" ) );
|
2018-03-19 16:03:36 +00:00
|
|
|
|
|
|
|
Connect( wxEVT_COMMAND_MENU_SELECTED,
|
|
|
|
wxMenuEventHandler( WX_HTML_REPORT_PANEL::onMenuEvent ), NULL, this );
|
2015-06-16 12:20:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WX_HTML_REPORT_PANEL::~WX_HTML_REPORT_PANEL()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-12-04 17:06:54 +00:00
|
|
|
void WX_HTML_REPORT_PANEL::MsgPanelSetMinSize( const wxSize& aMinSize )
|
|
|
|
{
|
2018-02-17 11:43:56 +00:00
|
|
|
m_fgSizer->SetMinSize( aMinSize );
|
2015-12-04 17:06:54 +00:00
|
|
|
GetSizer()->SetSizeHints( this );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-16 12:20:42 +00:00
|
|
|
REPORTER& WX_HTML_REPORT_PANEL::Reporter()
|
|
|
|
{
|
|
|
|
return m_reporter;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-05-21 22:28:26 +00:00
|
|
|
void WX_HTML_REPORT_PANEL::Report( const wxString& aText, REPORTER::SEVERITY aSeverity,
|
|
|
|
REPORTER::LOCATION aLocation )
|
2015-06-16 12:20:42 +00:00
|
|
|
{
|
|
|
|
REPORT_LINE line;
|
|
|
|
line.message = aText;
|
|
|
|
line.severity = aSeverity;
|
|
|
|
|
2018-05-21 22:28:26 +00:00
|
|
|
if( aLocation == REPORTER::LOC_HEAD )
|
|
|
|
m_reportHead.push_back( line );
|
|
|
|
else if( aLocation == REPORTER::LOC_TAIL )
|
|
|
|
m_reportTail.push_back( line );
|
|
|
|
else
|
|
|
|
m_report.push_back( line );
|
2015-07-24 15:47:48 +00:00
|
|
|
|
|
|
|
if( !m_lazyUpdate )
|
|
|
|
{
|
|
|
|
m_htmlView->AppendToPage( generateHtml( line ) );
|
|
|
|
scrollToBottom();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WX_HTML_REPORT_PANEL::SetLazyUpdate( bool aLazyUpdate )
|
|
|
|
{
|
|
|
|
m_lazyUpdate = aLazyUpdate;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-05-21 22:28:26 +00:00
|
|
|
void WX_HTML_REPORT_PANEL::Flush( bool aSort )
|
2015-07-24 15:47:48 +00:00
|
|
|
{
|
2018-05-21 22:28:26 +00:00
|
|
|
wxString html;
|
|
|
|
|
|
|
|
if( aSort )
|
|
|
|
{
|
|
|
|
std::sort( m_report.begin(), m_report.end(),
|
2018-05-23 09:31:13 +00:00
|
|
|
[]( const REPORT_LINE& a, const REPORT_LINE& b)
|
2018-05-21 22:28:26 +00:00
|
|
|
{
|
|
|
|
return a.severity < b.severity;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
for( auto line : m_reportHead )
|
|
|
|
html += generateHtml( line );
|
|
|
|
|
|
|
|
for( auto line : m_report )
|
|
|
|
html += generateHtml( line );
|
|
|
|
|
|
|
|
for( auto line : m_reportTail )
|
|
|
|
html += generateHtml( line );
|
|
|
|
|
|
|
|
m_htmlView->SetPage( addHeader( html ) );
|
2015-06-16 12:20:42 +00:00
|
|
|
scrollToBottom();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WX_HTML_REPORT_PANEL::scrollToBottom()
|
|
|
|
{
|
|
|
|
int x, y, xUnit, yUnit;
|
2015-07-24 15:47:48 +00:00
|
|
|
|
2015-06-16 12:20:42 +00:00
|
|
|
m_htmlView->GetVirtualSize( &x, &y );
|
|
|
|
m_htmlView->GetScrollPixelsPerUnit( &xUnit, &yUnit );
|
|
|
|
m_htmlView->Scroll( 0, y / yUnit );
|
2018-02-20 01:40:14 +00:00
|
|
|
|
|
|
|
updateBadges();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-02-28 09:44:22 +00:00
|
|
|
#define BADGE_SIZE 20
|
|
|
|
#define BADGE_FONT_SIZE 10
|
2018-02-20 01:40:14 +00:00
|
|
|
|
2018-02-22 16:05:06 +00:00
|
|
|
static wxBitmap makeBadge( REPORTER::SEVERITY aStyle, int aCount, wxWindow* aWindow )
|
2018-02-20 01:40:14 +00:00
|
|
|
{
|
2018-02-28 09:44:22 +00:00
|
|
|
wxSize size( BADGE_SIZE, BADGE_SIZE );
|
2018-02-20 01:40:14 +00:00
|
|
|
wxBitmap bitmap( size );
|
|
|
|
wxBrush brush;
|
|
|
|
wxMemoryDC badgeDC;
|
|
|
|
wxColour badgeColour;
|
|
|
|
wxColour textColour;
|
|
|
|
int fontSize = BADGE_FONT_SIZE;
|
|
|
|
|
|
|
|
if( aCount > 99 )
|
|
|
|
fontSize--;
|
|
|
|
|
|
|
|
badgeDC.SelectObject( bitmap );
|
|
|
|
|
|
|
|
brush.SetStyle( wxBRUSHSTYLE_SOLID );
|
|
|
|
// We're one level deep in staticBoxes; each level is darkened by 210
|
|
|
|
brush.SetColour( aWindow->GetParent()->GetBackgroundColour().MakeDisabled( 210 ) );
|
|
|
|
badgeDC.SetBackground( brush );
|
|
|
|
badgeDC.Clear();
|
|
|
|
|
2018-02-28 09:44:22 +00:00
|
|
|
if( aCount == 0 )
|
|
|
|
return bitmap;
|
|
|
|
|
2018-02-20 01:40:14 +00:00
|
|
|
switch( aStyle )
|
|
|
|
{
|
|
|
|
case REPORTER::RPT_ERROR:
|
|
|
|
badgeColour = *wxRED;
|
|
|
|
textColour = *wxWHITE;
|
|
|
|
break;
|
|
|
|
case REPORTER::RPT_WARNING:
|
2018-02-28 09:44:22 +00:00
|
|
|
badgeColour = wxColour( 235, 120, 80 ); // Orange
|
|
|
|
textColour = *wxWHITE;
|
2018-02-20 01:40:14 +00:00
|
|
|
break;
|
|
|
|
case REPORTER::RPT_ACTION:
|
|
|
|
badgeColour = *wxGREEN;
|
|
|
|
textColour = *wxWHITE;
|
|
|
|
break;
|
|
|
|
case REPORTER::RPT_INFO:
|
|
|
|
default:
|
|
|
|
badgeColour = *wxLIGHT_GREY;
|
|
|
|
textColour = *wxBLACK;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
brush.SetStyle( wxBRUSHSTYLE_SOLID );
|
|
|
|
brush.SetColour( badgeColour );
|
|
|
|
badgeDC.SetBrush( brush );
|
|
|
|
badgeDC.SetPen( wxPen( badgeColour, 0 ) );
|
|
|
|
badgeDC.DrawCircle( size.x / 2 - 1, size.y / 2, ( std::max( size.x, size.y ) / 2 ) - 1 );
|
|
|
|
|
2018-02-28 09:44:22 +00:00
|
|
|
wxFont font( fontSize, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD );
|
|
|
|
badgeDC.SetFont( font );
|
|
|
|
|
2018-02-20 01:40:14 +00:00
|
|
|
wxString text = wxString::Format( wxT( "%d" ), aCount );
|
2018-02-28 09:44:22 +00:00
|
|
|
wxSize textExtent = badgeDC.GetTextExtent( text );
|
2018-02-20 01:40:14 +00:00
|
|
|
|
|
|
|
badgeDC.SetTextForeground( textColour );
|
2018-02-28 09:44:22 +00:00
|
|
|
badgeDC.DrawText( text, size.x / 2 - textExtent.x / 2 - 1, size.y / 2 - textExtent.y / 2 );
|
2018-02-20 01:40:14 +00:00
|
|
|
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WX_HTML_REPORT_PANEL::updateBadges()
|
|
|
|
{
|
|
|
|
int count = Count( REPORTER::RPT_ERROR );
|
2018-02-28 09:44:22 +00:00
|
|
|
m_errorsBadge->SetBitmap( makeBadge( REPORTER::RPT_ERROR, count, m_errorsBadge ) );
|
2018-02-20 01:40:14 +00:00
|
|
|
|
|
|
|
count = Count( REPORTER::RPT_WARNING );
|
2018-02-28 09:44:22 +00:00
|
|
|
m_warningsBadge->SetBitmap( makeBadge( REPORTER::RPT_WARNING, count, m_warningsBadge ) );
|
2015-06-16 12:20:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-26 15:34:07 +00:00
|
|
|
wxString WX_HTML_REPORT_PANEL::addHeader( const wxString& aBody )
|
|
|
|
{
|
|
|
|
wxColour bgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
|
2015-06-29 08:43:09 +00:00
|
|
|
wxColour fgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
|
2015-06-26 15:34:07 +00:00
|
|
|
|
2018-03-14 14:13:27 +00:00
|
|
|
return wxString::Format( wxT( "<html><body bgcolor='%s' text='%s'>%s</body></html>" ),
|
|
|
|
bgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
|
|
|
|
fgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
|
|
|
|
aBody );
|
2015-06-26 15:34:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-02-17 11:43:56 +00:00
|
|
|
int WX_HTML_REPORT_PANEL::Count( int severityMask )
|
|
|
|
{
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
for( const REPORT_LINE& reportLine : m_report )
|
|
|
|
if( severityMask & reportLine.severity )
|
|
|
|
count++;
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-16 12:20:42 +00:00
|
|
|
wxString WX_HTML_REPORT_PANEL::generateHtml( const REPORT_LINE& aLine )
|
|
|
|
{
|
2017-11-28 18:13:44 +00:00
|
|
|
wxString retv;
|
|
|
|
|
2018-11-24 04:29:33 +00:00
|
|
|
if( !( m_severities & aLine.severity ) )
|
2017-11-28 18:13:44 +00:00
|
|
|
return retv;
|
2015-06-16 12:20:42 +00:00
|
|
|
|
|
|
|
switch( aLine.severity )
|
|
|
|
{
|
|
|
|
case REPORTER::RPT_ERROR:
|
2017-11-28 18:13:44 +00:00
|
|
|
retv = "<font color=\"red\" size=2><b>" + _( "Error: " ) + "</b></font><font size=2>" +
|
|
|
|
aLine.message + "</font><br>";
|
|
|
|
break;
|
2015-06-16 12:20:42 +00:00
|
|
|
case REPORTER::RPT_WARNING:
|
2017-11-28 18:13:44 +00:00
|
|
|
retv = "<font color=\"orange\" size=2><b>" + _( "Warning: " ) +
|
|
|
|
"</b></font><font size=2>" + aLine.message + "</font><br>";
|
|
|
|
break;
|
2015-06-16 12:20:42 +00:00
|
|
|
case REPORTER::RPT_INFO:
|
2017-11-28 18:13:44 +00:00
|
|
|
retv = "<font color=\"dark gray\" size=2><b>" + _( "Info: " ) + "</b>" + aLine.message +
|
|
|
|
"</font><br>";
|
|
|
|
break;
|
2015-06-16 12:20:42 +00:00
|
|
|
case REPORTER::RPT_ACTION:
|
2017-11-28 18:13:44 +00:00
|
|
|
retv = "<font color=\"dark green\" size=2>" + aLine.message + "</font><br>";
|
|
|
|
break;
|
2015-06-16 12:20:42 +00:00
|
|
|
default:
|
2017-11-28 18:13:44 +00:00
|
|
|
retv = "<font size=2>" + aLine.message + "</font><br>";
|
2015-06-16 12:20:42 +00:00
|
|
|
}
|
2017-11-28 18:13:44 +00:00
|
|
|
|
|
|
|
return retv;
|
2015-06-16 12:20:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxString WX_HTML_REPORT_PANEL::generatePlainText( const REPORT_LINE& aLine )
|
|
|
|
{
|
|
|
|
switch( aLine.severity )
|
|
|
|
{
|
|
|
|
case REPORTER::RPT_ERROR:
|
|
|
|
return _( "Error: " ) + aLine.message + wxT( "\n" );
|
|
|
|
case REPORTER::RPT_WARNING:
|
|
|
|
return _( "Warning: " ) + aLine.message + wxT( "\n" );
|
|
|
|
case REPORTER::RPT_INFO:
|
|
|
|
return _( "Info: " ) + aLine.message + wxT( "\n" );
|
|
|
|
default:
|
|
|
|
return aLine.message + wxT( "\n" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-03-19 16:03:36 +00:00
|
|
|
void WX_HTML_REPORT_PANEL::onRightClick( wxMouseEvent& event )
|
|
|
|
{
|
|
|
|
wxMenu popup;
|
|
|
|
popup.Append( wxID_COPY, "Copy" );
|
|
|
|
PopupMenu( &popup );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WX_HTML_REPORT_PANEL::onMenuEvent( wxMenuEvent& event )
|
|
|
|
{
|
|
|
|
if( event.GetId() == wxID_COPY )
|
|
|
|
{
|
|
|
|
if( wxTheClipboard->Open() )
|
|
|
|
{
|
|
|
|
bool primarySelection = wxTheClipboard->IsUsingPrimarySelection();
|
|
|
|
wxTheClipboard->UsePrimarySelection( false ); // required to use the main clipboard
|
|
|
|
wxTheClipboard->SetData( new wxTextDataObject( m_htmlView->SelectionToText() ) );
|
|
|
|
wxTheClipboard->Close();
|
|
|
|
wxTheClipboard->UsePrimarySelection( primarySelection );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-16 12:20:42 +00:00
|
|
|
void WX_HTML_REPORT_PANEL::onCheckBoxShowAll( wxCommandEvent& event )
|
|
|
|
{
|
2018-03-19 16:03:36 +00:00
|
|
|
if( event.IsChecked() )
|
2018-11-24 04:29:33 +00:00
|
|
|
m_severities = REPORTER::RPT_ALL;
|
2018-03-19 16:03:36 +00:00
|
|
|
else
|
2018-11-24 04:29:33 +00:00
|
|
|
m_severities = 0;
|
2015-06-16 12:20:42 +00:00
|
|
|
|
|
|
|
syncCheckboxes();
|
2018-05-21 22:28:26 +00:00
|
|
|
Flush( true );
|
2015-06-16 12:20:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WX_HTML_REPORT_PANEL::syncCheckboxes()
|
|
|
|
{
|
2018-11-24 04:29:33 +00:00
|
|
|
m_checkBoxShowAll->SetValue( m_severities == REPORTER::RPT_ALL );
|
2015-06-16 12:20:42 +00:00
|
|
|
m_checkBoxShowWarnings->SetValue( m_severities & REPORTER::RPT_WARNING );
|
|
|
|
m_checkBoxShowErrors->SetValue( m_severities & REPORTER::RPT_ERROR );
|
|
|
|
m_checkBoxShowInfos->SetValue( m_severities & REPORTER::RPT_INFO );
|
|
|
|
m_checkBoxShowActions->SetValue( m_severities & REPORTER::RPT_ACTION );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WX_HTML_REPORT_PANEL::onCheckBoxShowWarnings( wxCommandEvent& event )
|
|
|
|
{
|
2018-05-21 22:28:26 +00:00
|
|
|
if( event.IsChecked() )
|
2015-07-24 18:49:47 +00:00
|
|
|
m_severities |= REPORTER::RPT_WARNING;
|
|
|
|
else
|
|
|
|
m_severities &= ~REPORTER::RPT_WARNING;
|
2015-06-16 12:20:42 +00:00
|
|
|
|
2018-11-24 04:29:33 +00:00
|
|
|
syncCheckboxes();
|
2018-05-21 22:28:26 +00:00
|
|
|
Flush( true );
|
2015-06-16 12:20:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WX_HTML_REPORT_PANEL::onCheckBoxShowErrors( wxCommandEvent& event )
|
|
|
|
{
|
2018-05-21 22:28:26 +00:00
|
|
|
if( event.IsChecked() )
|
|
|
|
m_severities |= REPORTER::RPT_ERROR;
|
|
|
|
else
|
|
|
|
m_severities &= ~REPORTER::RPT_ERROR;
|
2015-06-16 12:20:42 +00:00
|
|
|
|
2018-11-24 04:29:33 +00:00
|
|
|
syncCheckboxes();
|
2018-05-21 22:28:26 +00:00
|
|
|
Flush( true );
|
2015-06-16 12:20:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WX_HTML_REPORT_PANEL::onCheckBoxShowInfos( wxCommandEvent& event )
|
|
|
|
{
|
2018-05-21 22:28:26 +00:00
|
|
|
if( event.IsChecked() )
|
|
|
|
m_severities |= REPORTER::RPT_INFO;
|
|
|
|
else
|
|
|
|
m_severities &= ~REPORTER::RPT_INFO;
|
2015-06-16 12:20:42 +00:00
|
|
|
|
2018-11-24 04:29:33 +00:00
|
|
|
syncCheckboxes();
|
2018-05-21 22:28:26 +00:00
|
|
|
Flush( true );
|
2015-06-16 12:20:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WX_HTML_REPORT_PANEL::onCheckBoxShowActions( wxCommandEvent& event )
|
|
|
|
{
|
2018-05-21 22:28:26 +00:00
|
|
|
if( event.IsChecked() )
|
|
|
|
m_severities |= REPORTER::RPT_ACTION;
|
|
|
|
else
|
|
|
|
m_severities &= ~REPORTER::RPT_ACTION;
|
2015-06-16 12:20:42 +00:00
|
|
|
|
2018-11-24 04:29:33 +00:00
|
|
|
syncCheckboxes();
|
2018-05-21 22:28:26 +00:00
|
|
|
Flush( true );
|
2015-06-16 12:20:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WX_HTML_REPORT_PANEL::onBtnSaveToFile( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
wxFileName fn( "./report.txt" );
|
|
|
|
|
2017-11-12 00:31:38 +00:00
|
|
|
wxFileDialog dlg( this, _( "Save Report to File" ), fn.GetPath(), fn.GetFullName(),
|
|
|
|
TextFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
2015-06-16 12:20:42 +00:00
|
|
|
|
|
|
|
if( dlg.ShowModal() != wxID_OK )
|
|
|
|
return;
|
|
|
|
|
|
|
|
fn = dlg.GetPath();
|
|
|
|
|
|
|
|
if( fn.GetExt().IsEmpty() )
|
2017-11-28 18:13:44 +00:00
|
|
|
fn.SetExt( "txt" );
|
2015-06-16 12:20:42 +00:00
|
|
|
|
|
|
|
wxFile f( fn.GetFullPath(), wxFile::write );
|
|
|
|
|
|
|
|
if( !f.IsOpened() )
|
|
|
|
{
|
|
|
|
wxString msg;
|
|
|
|
|
2017-12-15 11:37:46 +00:00
|
|
|
msg.Printf( _( "Cannot write report to file \"%s\"." ),
|
2015-06-16 18:04:02 +00:00
|
|
|
fn.GetFullPath().GetData() );
|
2015-06-16 12:20:42 +00:00
|
|
|
wxMessageBox( msg, _( "File save error" ), wxOK | wxICON_ERROR, this );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-09-24 18:11:58 +00:00
|
|
|
for( const REPORT_LINE& l : m_report )
|
2015-06-16 12:20:42 +00:00
|
|
|
{
|
|
|
|
f.Write( generatePlainText( l ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
f.Close();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WX_HTML_REPORT_PANEL::Clear()
|
|
|
|
{
|
|
|
|
m_report.clear();
|
2018-05-21 22:28:26 +00:00
|
|
|
m_reportHead.clear();
|
|
|
|
m_reportTail.clear();
|
2015-06-16 12:20:42 +00:00
|
|
|
}
|
2015-07-24 15:47:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
void WX_HTML_REPORT_PANEL::SetLabel( const wxString& aLabel )
|
|
|
|
{
|
|
|
|
m_box->GetStaticBox()->SetLabel( aLabel );
|
|
|
|
}
|
2015-07-24 18:49:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
void WX_HTML_REPORT_PANEL::SetVisibleSeverities( int aSeverities )
|
|
|
|
{
|
|
|
|
if( aSeverities < 0 )
|
2018-11-24 04:29:33 +00:00
|
|
|
m_severities = REPORTER::RPT_ALL;
|
2015-07-24 18:49:47 +00:00
|
|
|
else
|
|
|
|
m_severities = aSeverities;
|
|
|
|
|
|
|
|
syncCheckboxes();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int WX_HTML_REPORT_PANEL::GetVisibleSeverities()
|
|
|
|
{
|
2018-11-24 04:29:33 +00:00
|
|
|
return m_severities;
|
2015-07-24 18:49:47 +00:00
|
|
|
}
|