Commit 569c2be3 authored by jean-pierre charras's avatar jean-pierre charras

Minor fixes: dialog rescue: make strings translatable. Remove a few coverity...

Minor fixes: dialog rescue: make strings translatable. Remove a few coverity warnings (not initialized members). Very minor other changes.
parent c74f7b1a
......@@ -201,7 +201,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
<< HtmlNewline( 4 )
<< _( "The complete KiCad EDA Suite is released under the" ) << HtmlNewline( 2 )
<< HtmlHyperlink( wxT( "http://www.gnu.org/licenses" ),
_( "GNU General Public License (GPL) version 2" ) )
_( "GNU General Public License (GPL) version 2 or any later version" ) )
<< wxT( "</div>" );
info.SetLicense( license );
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 6 2013)
// C++ code generated with wxFormBuilder (version Jun 5 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -65,23 +65,18 @@ dialog_about_base::dialog_about_base( wxWindow* parent, wxWindowID id, const wxS
bSizer1->Add( m_auiNotebook, 2, wxEXPAND | wxALL, 5 );
m_buttonOK = new wxButton( this, wxID_CANCEL, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonOK->SetDefault();
bSizer1->Add( m_buttonOK, 0, wxALIGN_CENTER|wxALL, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizer->Realize();
bSizer1->Add( m_sdbSizer, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
this->SetSizer( bSizer1 );
this->Layout();
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( dialog_about_base::OnClose ) );
m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_about_base::OnOkClick ), NULL, this );
}
dialog_about_base::~dialog_about_base()
{
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( dialog_about_base::OnClose ) );
m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_about_base::OnOkClick ), NULL, this );
}
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="11" />
<FileVersion major="1" minor="13" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
......@@ -44,7 +44,7 @@
<property name="minimum_size">-1,-1</property>
<property name="name">dialog_about_base</property>
<property name="pos"></property>
<property name="size">750,450</property>
<property name="size">750,437</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSTAY_ON_TOP</property>
<property name="subclass"></property>
<property name="title">About...</property>
......@@ -61,7 +61,7 @@
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnClose">OnClose</event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
......@@ -88,7 +88,7 @@
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="0">
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer1</property>
<property name="orient">wxVERTICAL</property>
......@@ -720,92 +720,30 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER|wxALL</property>
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="0">
<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">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_CANCEL</property>
<property name="label">OK</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>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property>
<property name="Cancel">0</property>
<property name="ContextHelp">0</property>
<property name="Help">0</property>
<property name="No">0</property>
<property name="OK">1</property>
<property name="Save">0</property>
<property name="Yes">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_buttonOK</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">private</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="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnOkClick</event>
<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>
<property name="name">m_sdbSizer</property>
<property name="permission">protected</property>
<event name="OnApplyButtonClick"></event>
<event name="OnCancelButtonClick"></event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
<event name="OnOKButtonClick"></event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
</object>
</object>
</object>
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 6 2013)
// C++ code generated with wxFormBuilder (version Jun 5 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -35,7 +35,6 @@
class dialog_about_base : public wxDialog
{
private:
wxButton* m_buttonOK;
protected:
wxStaticBitmap* m_bitmapApp;
......@@ -44,15 +43,12 @@ class dialog_about_base : public wxDialog
wxStaticText* m_staticTextBuildVersion;
wxStaticText* m_staticTextLibVersion;
wxAuiNotebook* m_auiNotebook;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
public:
dialog_about_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About..."), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 750,450 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSTAY_ON_TOP );
dialog_about_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About..."), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 750,437 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSTAY_ON_TOP );
~dialog_about_base();
};
......
......@@ -99,10 +99,10 @@ bool DIALOG_RESCUE_EACH::TransferDataToWindow()
if( !wxDialog::TransferDataToWindow() )
return false;
m_ListOfConflicts->AppendToggleColumn( wxT("Rescue") );
m_ListOfConflicts->AppendTextColumn( wxT("Symbol Name") );
m_ListOfInstances->AppendTextColumn( wxT("Reference") );
m_ListOfInstances->AppendTextColumn( wxT("Value") );
m_ListOfConflicts->AppendToggleColumn( _("Rescue symbol") );
m_ListOfConflicts->AppendTextColumn( _("Symbol name") );
m_ListOfInstances->AppendTextColumn( _("Reference") );
m_ListOfInstances->AppendTextColumn( _("Value") );
PopulateConflictList();
PopulateInstanceList();
......@@ -273,10 +273,12 @@ bool DIALOG_RESCUE_EACH::TransferDataFromWindow()
void DIALOG_RESCUE_EACH::OnNeverShowClick( wxCommandEvent& aEvent )
{
wxMessageDialog dlg( m_Parent, wxT( "Stop showing this tool? No changes will be made.\n\n"
"This setting can be changed from the Component Libraries settings, and the "
"tool can be activated manually from the Tools menu." ),
wxT( "Rescue Components" ), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION );
wxMessageDialog dlg( m_Parent,
_( "Stop showing this tool?\n"
"No changes will be made.\n\n"
"This setting can be changed from the \"Component Libraries\" dialog,\n"
"and the tool can be activated manually from the \"Tools\" menu." ),
_( "Rescue Components" ), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION );
int resp = dlg.ShowModal ();
if( resp == wxID_YES )
......
......@@ -27,7 +27,7 @@ DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID i
bSizerMain->Add( m_staticText5, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ListOfConflicts = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
bSizerMain->Add( m_ListOfConflicts, 2, wxALL|wxEXPAND, 5 );
bSizerMain->Add( m_ListOfConflicts, 2, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticText4 = new wxStaticText( this, wxID_ANY, _("Instances of this symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText4->Wrap( -1 );
......@@ -36,7 +36,7 @@ DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID i
bSizerMain->Add( m_staticText4, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ListOfInstances = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
bSizerMain->Add( m_ListOfInstances, 1, wxALL|wxEXPAND, 5 );
bSizerMain->Add( m_ListOfInstances, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerView;
bSizerView = new wxBoxSizer( wxHORIZONTAL );
......@@ -53,7 +53,7 @@ DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID i
m_componentViewOld = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER );
m_componentViewOld->SetMinSize( wxSize( 150,150 ) );
bSizer6->Add( m_componentViewOld, 1, wxEXPAND | wxALL, 5 );
bSizer6->Add( m_componentViewOld, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerView->Add( bSizer6, 1, wxEXPAND, 5 );
......@@ -70,7 +70,7 @@ DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID i
m_componentViewNew = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER );
m_componentViewNew->SetMinSize( wxSize( 150,150 ) );
bSizer7->Add( m_componentViewNew, 1, wxEXPAND | wxALL, 5 );
bSizer7->Add( m_componentViewNew, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerView->Add( bSizer7, 1, wxEXPAND, 5 );
......
......@@ -261,7 +261,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">2</property>
<object class="wxDataViewListCtrl" expanded="1">
<property name="bg"></property>
......@@ -412,7 +412,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxDataViewListCtrl" expanded="1">
<property name="bg"></property>
......@@ -581,7 +581,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
......@@ -755,7 +755,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property>
......
......@@ -360,10 +360,6 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles(bool aGenDrill, bool aGenMap)
* layer pair by layer pair for
* buried vias
*/
int layer1 = F_Cu;
int layer2 = B_Cu;
bool gen_through_holes = true;
bool gen_NPTH_holes = false;
UpdateConfig(); // set params and Save drill options
......@@ -372,14 +368,17 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles(bool aGenDrill, bool aGenMap)
if( m_microViasCount || m_blindOrBuriedViasCount )
hasBuriedVias = true;
EXCELLON_WRITER excellonWriter( m_parent->GetBoard(),
m_FileDrillOffset );
EXCELLON_WRITER excellonWriter( m_parent->GetBoard() );
excellonWriter.SetFormat( !m_UnitDrillIsInch,
(EXCELLON_WRITER::zeros_fmt) m_ZerosFormat,
m_Precision.m_lhs, m_Precision.m_rhs );
excellonWriter.SetOptions( m_Mirror, m_MinimalHeader, m_FileDrillOffset, m_Merge_PTH_NPTH );
wxFileName fn;
int layer1 = F_Cu;
int layer2 = B_Cu;
bool gen_through_holes = true;
bool gen_NPTH_holes = false;
for( ; ; )
{
......@@ -509,8 +508,7 @@ void DIALOG_GENDRILL::OnGenReportFile( wxCommandEvent& event )
if( dlg.ShowModal() == wxID_CANCEL )
return;
EXCELLON_WRITER excellonWriter( m_parent->GetBoard(),
m_FileDrillOffset );
EXCELLON_WRITER excellonWriter( m_parent->GetBoard() );
excellonWriter.SetFormat( !m_UnitDrillIsInch,
(EXCELLON_WRITER::zeros_fmt) m_ZerosFormat,
m_Precision.m_lhs, m_Precision.m_rhs );
......
......@@ -431,7 +431,7 @@ void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
int aLastLayer,
bool aExcludeThroughHoles,
bool aGenerateNPTH_list,
bool aMergePTHNPTH )
bool aMerge_PTH_NPTH )
{
HOLE_INFO new_hole;
int hole_value;
......@@ -445,7 +445,7 @@ void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
EXCHG( aFirstLayer, aLastLayer );
}
if ( aGenerateNPTH_list && aMergePTHNPTH )
if ( aGenerateNPTH_list && aMerge_PTH_NPTH )
{
return;
}
......@@ -497,7 +497,7 @@ void EXCELLON_WRITER::BuildHolesList( int aFirstLayer,
{
if( ! aGenerateNPTH_list &&
pad->GetAttribute() == PAD_HOLE_NOT_PLATED &&
! aMergePTHNPTH )
! aMerge_PTH_NPTH )
continue;
if( aGenerateNPTH_list && pad->GetAttribute() != PAD_HOLE_NOT_PLATED )
......
......@@ -143,12 +143,12 @@ private:
// (i.e inches or mm)
bool m_mirror;
wxPoint m_offset; // Drill offset coordinates
bool m_mergePTHNPTH;
bool m_merge_PTH_NPTH;
std::vector<HOLE_INFO> m_holeListBuffer; // Buffer containing holes
std::vector<DRILL_TOOL> m_toolListBuffer; // Buffer containing tools
public:
EXCELLON_WRITER( BOARD* aPcb, wxPoint aOffset )
EXCELLON_WRITER( BOARD* aPcb )
{
m_file = NULL;
m_pcb = aPcb;
......@@ -156,7 +156,7 @@ public:
m_conversionUnits = 0.0001;
m_unitsDecimal = false;
m_mirror = false;
m_mergePTHNPTH = false;
m_merge_PTH_NPTH = false;
m_minimalHeader = false;
m_ShortHeader = false;
}
......@@ -188,14 +188,14 @@ public:
* @param aMirror = true to create mirrored coordinates (Y coordinates negated)
* @param aMinimalHeader = true to use a minimal header (no comments, no info)
* @param aOffset = drill coordinates offset
* @param aMergePTHNPTH : true to create only one list which contains both PTH and NPTH
* @param aMerge_PTH_NPTH : true to create only one list which contains both PTH and NPTH
*/
void SetOptions( bool aMirror, bool aMinimalHeader, wxPoint aOffset, bool aMergePTHNPTH )
void SetOptions( bool aMirror, bool aMinimalHeader, wxPoint aOffset, bool aMerge_PTH_NPTH )
{
m_mirror = aMirror;
m_offset = aOffset;
m_minimalHeader = aMinimalHeader;
m_mergePTHNPTH = aMergePTHNPTH;
m_merge_PTH_NPTH = aMerge_PTH_NPTH;
}
/**
......@@ -210,12 +210,12 @@ public:
* @param aGenerateNPTH_list :
* true to create NPTH only list (with no plated holes)
* false to created plated holes list (with no NPTH )
* @param aMergePTHNPTH : true to create only one list which contains both PTH and NPTH
* @param aMerge_PTH_NPTH : true to create only one list which contains both PTH and NPTH
*/
void BuildHolesList( int aFirstLayer, int aLastLayer,
bool aExcludeThroughHoles,
bool aGenerateNPTH_list,
bool aMergePTHNPTH );
bool aMerge_PTH_NPTH );
int GetHolesCount() const { return m_holeListBuffer.size(); }
......
......@@ -176,9 +176,15 @@ class PNS_DP_GATEWAYS
public:
PNS_DP_GATEWAYS ( int aGap ):
m_gap(aGap), m_viaGap( aGap ) {};
m_gap(aGap), m_viaGap( aGap )
{
// Do not leave unitialized members, and keep static analyser quiet:
m_viaDiameter = 0;
m_fitVias = true;
}
void SetGap ( int aGap ) {
void SetGap ( int aGap )
{
m_gap = aGap;
m_viaGap = aGap;
}
......@@ -320,6 +326,13 @@ public:
m_net_n = aLineN.Net();
m_p = aLineP.CLine();
m_n = aLineN.CLine();
// Do not leave unitialized members, and keep static analyser quiet:
m_width = 0;
m_gap = 0;
m_viaGap = 0;
m_maxUncoupledLength = 0;
m_chamferLimit = 0;
}
static inline bool ClassOf( const PNS_ITEM* aItem )
......
......@@ -115,6 +115,12 @@ public:
m_width( aWidth ),
m_baselineOffset( 0 )
{
// Do not leave unitialized members, and keep static analyser quiet:
m_type = MT_SINGLE;
m_amplitude = 0;
m_side = false;
m_baseIndex = 0;
m_currentTarget = NULL;
}
/**
......@@ -385,6 +391,11 @@ class PNS_MEANDERED_LINE
public:
PNS_MEANDERED_LINE()
{
// Do not leave unitialized members, and keep static analyser quiet:
m_placer = NULL;
m_dual = false;
m_width = 0;
m_baselineOffset = 0;
}
/**
......@@ -397,6 +408,9 @@ public:
m_placer( aPlacer ),
m_dual( aIsDual )
{
// Do not leave unitialized members, and keep static analyser quiet:
m_width = 0;
m_baselineOffset = 0;
}
/**
......
......@@ -94,6 +94,7 @@ class CONTEXT_TRACK_WIDTH_MENU: public CONTEXT_MENU
public:
CONTEXT_TRACK_WIDTH_MENU()
{
m_board = NULL;
SetIcon( width_track_via_xpm );
setCustomEventHandler( boost::bind( &CONTEXT_TRACK_WIDTH_MENU::handleCustomEvent,
this, _1 ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment