Code formatting cleanup.

This commit is contained in:
Jeff Young 2019-04-14 23:13:46 +01:00
parent d5f136cd7e
commit ef3f773f84
1 changed files with 27 additions and 32 deletions

View File

@ -22,11 +22,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file dialog_select_net_from_list.cpp
* @brief methods to show available net names and select and highligth a net
*/
#include <fctsys.h> #include <fctsys.h>
#include <kicad_string.h> #include <kicad_string.h>
#include <kicad_device_context.h> #include <kicad_device_context.h>
@ -149,6 +144,7 @@ void DIALOG_SELECT_NET_FROM_LIST::buildNetsList()
if( !netFilter.IsEmpty() ) if( !netFilter.IsEmpty() )
{ {
wxString netname = UnescapeString( net->GetNetname() ); wxString netname = UnescapeString( net->GetNetname() );
if( filter.Find( netname.MakeUpper() ) == EDA_PATTERN_NOT_FOUND ) if( filter.Find( netname.MakeUpper() ) == EDA_PATTERN_NOT_FOUND )
continue; continue;
} }
@ -191,10 +187,10 @@ void DIALOG_SELECT_NET_FROM_LIST::buildNetsList()
} }
} }
dataLine.push_back( wxVariant( wxString::Format( "%u", viaCount ) ) ); // vias dataLine.push_back( wxVariant( wxString::Format( wxT( "%u" ), viaCount ) ) );
dataLine.push_back( wxVariant( wxString::Format( "%s", MessageTextFromValue( units, len ).c_str() ) ) ); // board dataLine.push_back( wxVariant( MessageTextFromValue( units, len ) ) );
dataLine.push_back( wxVariant( wxString::Format( "%s", MessageTextFromValue( units, lenPadToDie ).c_str() ) ) ); // die dataLine.push_back( wxVariant( MessageTextFromValue( units, lenPadToDie ) ) );
dataLine.push_back( wxVariant( wxString::Format( "%s", MessageTextFromValue( units, len + lenPadToDie ).c_str() ) ) ); // length dataLine.push_back( wxVariant( MessageTextFromValue( units, len + lenPadToDie ) ) );
} }
else // For the net 0 (unconnected pads), the pad count is not known else // For the net 0 (unconnected pads), the pad count is not known
{ {
@ -205,7 +201,6 @@ void DIALOG_SELECT_NET_FROM_LIST::buildNetsList()
dataLine.push_back( wxVariant( wxT( "---" ) ) ); // length dataLine.push_back( wxVariant( wxT( "---" ) ) ); // length
} }
m_netsList->AppendItem( dataLine ); m_netsList->AppendItem( dataLine );
} }
@ -342,13 +337,13 @@ bool DIALOG_SELECT_NET_FROM_LIST::GetNetName( wxString& aName )
void DIALOG_SELECT_NET_FROM_LIST::onExport( wxMouseEvent& aEvent ) void DIALOG_SELECT_NET_FROM_LIST::onExport( wxMouseEvent& aEvent )
{ {
wxFileDialog wxFileDialog dlg( this, _( "Export file" ), "", "", "Text files (*.txt)|*.txt",
saveFileDialog(this, _( "Export file" ), "", "", wxFD_SAVE|wxFD_OVERWRITE_PROMPT );
"Text files (*.txt)|*.txt", wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
if (saveFileDialog.ShowModal() == wxID_CANCEL) if( dlg.ShowModal() == wxID_CANCEL )
return; return;
wxTextFile f( saveFileDialog.GetPath() ); wxTextFile f( dlg.GetPath() );
f.Create(); f.Create();
@ -356,13 +351,13 @@ void DIALOG_SELECT_NET_FROM_LIST::onExport( wxMouseEvent& aEvent )
for( int row = 0; row < rows; row++ ) for( int row = 0; row < rows; row++ )
{ {
wxString txt = m_netsList->GetTextValue(row, 0)+";"+ wxString txt = m_netsList->GetTextValue( row, 0 ) + ";" +
m_netsList->GetTextValue(row, 1)+";"+ m_netsList->GetTextValue( row, 1 ) + ";" +
m_netsList->GetTextValue(row, 2)+";"+ m_netsList->GetTextValue( row, 2 ) + ";" +
m_netsList->GetTextValue(row, 3)+";"+ m_netsList->GetTextValue( row, 3 ) + ";" +
m_netsList->GetTextValue(row, 4)+";"+ m_netsList->GetTextValue( row, 4 ) + ";" +
m_netsList->GetTextValue(row, 5)+";"+ m_netsList->GetTextValue( row, 5 ) + ";" +
m_netsList->GetTextValue(row, 6)+";"; m_netsList->GetTextValue( row, 6 ) + ";";
f.AddLine( txt ); f.AddLine( txt );
} }