Exchange footprint dialog uses now the reporter widget for a better report of actions and errors.
Fixes: lp:1711379 https://bugs.launchpad.net/kicad/+bug/1711379
This commit is contained in:
parent
28c04cbbf5
commit
6be2f2934e
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 21 2016)
|
||||
// C++ code generated with wxFormBuilder (version Jul 2 2017)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -59,7 +59,7 @@ WX_HTML_REPORT_PANEL_BASE::WX_HTML_REPORT_PANEL_BASE( wxWindow* parent, wxWindow
|
|||
|
||||
fgSizer3->Add( m_checkBoxShowActions, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_btnSaveReportToFile = new wxButton( m_box->GetStaticBox(), wxID_ANY, _("Save Output"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_btnSaveReportToFile = new wxButton( m_box->GetStaticBox(), wxID_ANY, _("Save Report File"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer3->Add( m_btnSaveReportToFile, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxLEFT, 5 );
|
||||
|
||||
|
||||
|
|
|
@ -759,7 +759,7 @@
|
|||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Save Output</property>
|
||||
<property name="label">Save Report File</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size">-1,-1</property>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 21 2016)
|
||||
// C++ code generated with wxFormBuilder (version Jul 2 2017)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
#include <class_board.h>
|
||||
#include <class_module.h>
|
||||
#include <project.h>
|
||||
#include <wx_html_report_panel.h>
|
||||
//#include <reporter.h>
|
||||
|
||||
#include <pcbnew.h>
|
||||
#include <dialog_exchange_modules.h>
|
||||
|
@ -102,6 +104,9 @@ void DIALOG_EXCHANGE_MODULE::OnOkClick( wxCommandEvent& event )
|
|||
m_selectionMode = m_Selection->GetSelection();
|
||||
bool result = false;
|
||||
|
||||
m_MessageWindow->Clear();
|
||||
m_MessageWindow->Flush();
|
||||
|
||||
switch( m_Selection->GetSelection() )
|
||||
{
|
||||
case 0:
|
||||
|
@ -156,25 +161,26 @@ void DIALOG_EXCHANGE_MODULE::OnSelectionClicked( wxCommandEvent& event )
|
|||
|
||||
void DIALOG_EXCHANGE_MODULE::RebuildCmpList( wxCommandEvent& event )
|
||||
{
|
||||
wxFileName fn;
|
||||
wxString msg;
|
||||
REPORTER& reporter = m_MessageWindow->Reporter();
|
||||
m_MessageWindow->Clear();
|
||||
m_MessageWindow->Flush();
|
||||
|
||||
// Build the .cmp file name from the board name
|
||||
fn = m_parent->GetBoard()->GetFileName();
|
||||
wxFileName fn = m_parent->GetBoard()->GetFileName();
|
||||
fn.SetExt( ComponentFileExtension );
|
||||
|
||||
if( RecreateCmpFile( m_parent->GetBoard(), fn.GetFullPath() ) )
|
||||
{
|
||||
msg.Printf( _( "File '%s' created\n" ),
|
||||
GetChars( fn.GetFullPath() ) );
|
||||
msg.Printf( _( "File '%s' created\n" ), GetChars( fn.GetFullPath() ) );
|
||||
reporter.Report( msg, REPORTER::RPT_INFO );
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.Printf( _( "** Could not create file '%s' ***\n" ),
|
||||
GetChars( fn.GetFullPath() ) );
|
||||
reporter.Report( msg, REPORTER::RPT_ERROR );
|
||||
}
|
||||
|
||||
m_WinMessages->AppendText( msg );
|
||||
}
|
||||
|
||||
|
||||
|
@ -298,28 +304,29 @@ bool DIALOG_EXCHANGE_MODULE::change_1_Module( MODULE* aModule,
|
|||
bool aShowError )
|
||||
{
|
||||
MODULE* newModule;
|
||||
wxString line;
|
||||
wxString msg;
|
||||
|
||||
if( aModule == NULL )
|
||||
return false;
|
||||
|
||||
wxBusyCursor dummy;
|
||||
REPORTER& reporter = m_MessageWindow->Reporter();
|
||||
|
||||
// Copy parameters from the old module.
|
||||
// Copy parameters from the old footprint.
|
||||
LIB_ID oldFootprintFPID = aModule->GetFPID();
|
||||
|
||||
// Load module.
|
||||
line.Printf( _( "Change footprint '%s' (from '%s') to '%s'" ),
|
||||
msg.Printf( _( "Change footprint '%s' (from '%s') to '%s'" ),
|
||||
GetChars( aModule->GetReference() ),
|
||||
oldFootprintFPID.Format().c_str(),
|
||||
aNewFootprintFPID.Format().c_str() );
|
||||
m_WinMessages->AppendText( line );
|
||||
|
||||
newModule = m_parent->LoadFootprint( aNewFootprintFPID );
|
||||
|
||||
if( newModule == NULL ) // New module not found, redraw the old one.
|
||||
if( newModule == NULL ) // New module not found.
|
||||
{
|
||||
m_WinMessages->AppendText( wxT( ": footprint not found\n" ) );
|
||||
msg << ": " << _( "footprint not found" );
|
||||
reporter.Report( msg, REPORTER::RPT_ERROR );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -328,7 +335,8 @@ bool DIALOG_EXCHANGE_MODULE::change_1_Module( MODULE* aModule,
|
|||
if( aModule == m_currentModule )
|
||||
m_currentModule = newModule;
|
||||
|
||||
m_WinMessages->AppendText( wxT( ": OK\n" ) );
|
||||
msg += ": OK";
|
||||
reporter.Report( msg, REPORTER::RPT_ACTION );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// C++ code generated with wxFormBuilder (version Aug 4 2017)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "wx_html_report_panel.h"
|
||||
|
||||
#include "dialog_exchange_modules_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
@ -27,7 +29,6 @@ DIALOG_EXCHANGE_MODULE_BASE::DIALOG_EXCHANGE_MODULE_BASE( wxWindow* parent, wxWi
|
|||
bLeftSizer->Add( m_staticTextCmpVal, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_CmpValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
|
||||
m_CmpValue->SetMaxLength( 0 );
|
||||
bLeftSizer->Add( m_CmpValue, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_staticTexCmpRef = new wxStaticText( this, wxID_ANY, _("Component reference"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
@ -75,7 +76,6 @@ DIALOG_EXCHANGE_MODULE_BASE::DIALOG_EXCHANGE_MODULE_BASE( wxWindow* parent, wxWi
|
|||
bMainSizer->Add( m_staticTextCurrFPID, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_CurrentFootprintFPID = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
|
||||
m_CurrentFootprintFPID->SetMaxLength( 0 );
|
||||
bMainSizer->Add( m_CurrentFootprintFPID, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_staticTextNewFPID = new wxStaticText( this, wxID_ANY, _("New footprint name (FPID)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
@ -83,17 +83,12 @@ DIALOG_EXCHANGE_MODULE_BASE::DIALOG_EXCHANGE_MODULE_BASE( wxWindow* parent, wxWi
|
|||
bMainSizer->Add( m_staticTextNewFPID, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_NewFootprintFPID = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_NewFootprintFPID->SetMaxLength( 0 );
|
||||
bMainSizer->Add( m_NewFootprintFPID, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||
|
||||
m_staticTextMsg = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextMsg->Wrap( -1 );
|
||||
bMainSizer->Add( m_staticTextMsg, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
m_MessageWindow = new WX_HTML_REPORT_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
m_MessageWindow->SetMinSize( wxSize( 300,300 ) );
|
||||
|
||||
m_WinMessages = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
|
||||
m_WinMessages->SetMinSize( wxSize( -1,150 ) );
|
||||
|
||||
bMainSizer->Add( m_WinMessages, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
bMainSizer->Add( m_MessageWindow, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
||||
|
|
|
@ -403,7 +403,7 @@
|
|||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="maxlength">0</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
|
@ -1189,92 +1189,9 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Messages:</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextMsg</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxEXPAND | wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<object class="wxPanel" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
|
@ -1305,12 +1222,11 @@
|
|||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,150</property>
|
||||
<property name="minimum_size">300,300</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_WinMessages</property>
|
||||
<property name="name">m_MessageWindow</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
|
@ -1320,18 +1236,12 @@
|
|||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxTE_MULTILINE|wxTE_READONLY</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="subclass">WX_HTML_REPORT_PANEL; wx_html_report_panel.h</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="window_style">wxTAB_TRAVERSAL</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
|
@ -1354,10 +1264,6 @@
|
|||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnText"></event>
|
||||
<event name="OnTextEnter"></event>
|
||||
<event name="OnTextMaxLen"></event>
|
||||
<event name="OnTextURL"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// C++ code generated with wxFormBuilder (version Aug 4 2017)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -12,6 +12,7 @@
|
|||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
class DIALOG_SHIM;
|
||||
class WX_HTML_REPORT_PANEL;
|
||||
|
||||
#include "dialog_shim.h"
|
||||
#include <wx/string.h>
|
||||
|
@ -24,6 +25,7 @@ class DIALOG_SHIM;
|
|||
#include <wx/sizer.h>
|
||||
#include <wx/radiobox.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
|
@ -51,8 +53,7 @@ class DIALOG_EXCHANGE_MODULE_BASE : public DIALOG_SHIM
|
|||
wxTextCtrl* m_CurrentFootprintFPID;
|
||||
wxStaticText* m_staticTextNewFPID;
|
||||
wxTextCtrl* m_NewFootprintFPID;
|
||||
wxStaticText* m_staticTextMsg;
|
||||
wxTextCtrl* m_WinMessages;
|
||||
WX_HTML_REPORT_PANEL* m_MessageWindow;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxButton* m_Applybutton;
|
||||
wxButton* m_Quitbutton;
|
||||
|
|
Loading…
Reference in New Issue