From 6e8dd598c05835d501cad393f94f781e78e1f853 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 22 Apr 2019 09:34:28 +0200 Subject: [PATCH] Minor fixes in translatable strings. Fix also a minor compil warning. --- .../dialogs/dialog_migrate_buses_base.cpp | 56 ++--- .../dialogs/dialog_migrate_buses_base.fbp | 228 ++---------------- eeschema/dialogs/dialog_migrate_buses_base.h | 28 +-- eeschema/libedit/lib_edit_frame.cpp | 10 +- eeschema/sch_painter.cpp | 2 +- eeschema/tools/sch_drawing_tool.cpp | 2 +- 6 files changed, 67 insertions(+), 259 deletions(-) diff --git a/eeschema/dialogs/dialog_migrate_buses_base.cpp b/eeschema/dialogs/dialog_migrate_buses_base.cpp index 46cdf22fae..c98178da85 100644 --- a/eeschema/dialogs/dialog_migrate_buses_base.cpp +++ b/eeschema/dialogs/dialog_migrate_buses_base.cpp @@ -1,8 +1,8 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 17 2016) +// C++ code generated with wxFormBuilder (version Dec 1 2018) // http://www.wxformbuilder.org/ // -// PLEASE DO "NOT" EDIT THIS FILE! +// PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #include "dialog_migrate_buses_base.h" @@ -12,56 +12,56 @@ DIALOG_MIGRATE_BUSES_BASE::DIALOG_MIGRATE_BUSES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - + wxBoxSizer* main_sizer; main_sizer = new wxBoxSizer( wxVERTICAL ); - - m_staticText5 = new wxStaticText( this, wxID_ANY, _("This schematic has one or more buses with more than one label. This was allowed in previous KiCad versions but is no longer permitted."), wxDefaultPosition, wxDefaultSize, 0 ); + + m_staticText5 = new wxStaticText( this, wxID_ANY, _("This schematic has one or more buses with more than one label.\nThis was allowed in previous KiCad versions but is no longer permitted."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText5->Wrap( 480 ); main_sizer->Add( m_staticText5, 0, wxALL|wxEXPAND, 5 ); - + m_staticText7 = new wxStaticText( this, wxID_ANY, _("Please select a new name for each of the buses below.\nA name has been suggested for you based on the labels attached to the bus."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText7->Wrap( 480 ); m_staticText7->SetMinSize( wxSize( -1,60 ) ); - + main_sizer->Add( m_staticText7, 0, wxALL|wxEXPAND, 5 ); - + m_migration_list = new wxListView( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES ); m_migration_list->SetMinSize( wxSize( 460,100 ) ); - + main_sizer->Add( m_migration_list, 1, wxALL|wxEXPAND, 5 ); - + m_staticText6 = new wxStaticText( this, wxID_ANY, _("Proposed new name:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText6->Wrap( -1 ); - main_sizer->Add( m_staticText6, 0, wxALL, 5 ); - + main_sizer->Add( m_staticText6, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + wxBoxSizer* bSizer7; bSizer7 = new wxBoxSizer( wxHORIZONTAL ); - - m_cb_new_name = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + + m_cb_new_name = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); m_cb_new_name->SetMinSize( wxSize( 300,-1 ) ); m_cb_new_name->SetMaxSize( wxSize( 460,-1 ) ); - + bSizer7->Add( m_cb_new_name, 1, wxALL|wxEXPAND, 5 ); - + m_btn_accept = new wxButton( this, wxID_ANY, _("Accept Name"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer7->Add( m_btn_accept, 0, wxALL, 5 ); - - + + main_sizer->Add( bSizer7, 0, wxEXPAND, 5 ); - - m_sdbSizer1 = new wxStdDialogButtonSizer(); - m_sdbSizer1OK = new wxButton( this, wxID_OK ); - m_sdbSizer1->AddButton( m_sdbSizer1OK ); - m_sdbSizer1->Realize(); - - main_sizer->Add( m_sdbSizer1, 0, wxEXPAND, 5 ); - - + + m_sdbSizer = new wxStdDialogButtonSizer(); + m_sdbSizerOK = new wxButton( this, wxID_OK ); + m_sdbSizer->AddButton( m_sdbSizerOK ); + m_sdbSizer->Realize(); + + main_sizer->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 ); + + this->SetSizer( main_sizer ); this->Layout(); main_sizer->Fit( this ); - + this->Centre( wxBOTH ); } diff --git a/eeschema/dialogs/dialog_migrate_buses_base.fbp b/eeschema/dialogs/dialog_migrate_buses_base.fbp index 02524c026e..2d61195b39 100644 --- a/eeschema/dialogs/dialog_migrate_buses_base.fbp +++ b/eeschema/dialogs/dialog_migrate_buses_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,6 +14,7 @@ dialog_migrate_buses_base 1000 none + 1 DIALOG_MIGRATE_BUSES_BASE @@ -52,42 +53,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - main_sizer @@ -125,7 +90,8 @@ 0 0 wxID_ANY - This schematic has one or more buses with more than one label. This was allowed in previous KiCad versions but is no longer permitted. + This schematic has one or more buses with more than one label. This was allowed in previous KiCad versions but is no longer permitted. + 0 0 @@ -151,29 +117,6 @@ 480 - - - - - - - - - - - - - - - - - - - - - - - @@ -209,6 +152,7 @@ 0 wxID_ANY Please select a new name for each of the buses below. A name has been suggested for you based on the labels attached to the bus. + 0 0 @@ -234,29 +178,6 @@ 480 - - - - - - - - - - - - - - - - - - - - - - - @@ -319,54 +240,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL + wxTOP|wxRIGHT|wxLEFT 0 1 @@ -397,6 +275,7 @@ 0 wxID_ANY Proposed new name: + 0 0 @@ -422,29 +301,6 @@ -1 - - - - - - - - - - - - - - - - - - - - - - - @@ -519,32 +375,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -562,25 +392,31 @@ + 1 0 1 1 + 0 0 + Dock 0 Left 1 1 + 0 0 wxID_ANY Accept Name + + 0 0 @@ -595,6 +431,8 @@ protected 1 + + Resizable 1 @@ -609,37 +447,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND + wxEXPAND|wxALL 0 0 @@ -651,16 +465,8 @@ 0 0 - m_sdbSizer1 + m_sdbSizer protected - - - - - - - - diff --git a/eeschema/dialogs/dialog_migrate_buses_base.h b/eeschema/dialogs/dialog_migrate_buses_base.h index a64731c471..7487bf6401 100644 --- a/eeschema/dialogs/dialog_migrate_buses_base.h +++ b/eeschema/dialogs/dialog_migrate_buses_base.h @@ -1,19 +1,15 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 17 2016) +// C++ code generated with wxFormBuilder (version Dec 1 2018) // http://www.wxformbuilder.org/ // -// PLEASE DO "NOT" EDIT THIS FILE! +// PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __DIALOG_MIGRATE_BUSES_BASE_H__ -#define __DIALOG_MIGRATE_BUSES_BASE_H__ +#pragma once #include #include #include -class DIALOG_SHIM; -class wxListView; - #include "dialog_shim.h" #include #include @@ -23,6 +19,9 @@ class wxListView; #include #include #include +#include +#include +#include #include #include #include @@ -36,7 +35,7 @@ class wxListView; class DIALOG_MIGRATE_BUSES_BASE : public DIALOG_SHIM { private: - + protected: wxStaticText* m_staticText5; wxStaticText* m_staticText7; @@ -44,14 +43,13 @@ class DIALOG_MIGRATE_BUSES_BASE : public DIALOG_SHIM wxStaticText* m_staticText6; wxComboBox* m_cb_new_name; wxButton* m_btn_accept; - wxStdDialogButtonSizer* m_sdbSizer1; - wxButton* m_sdbSizer1OK; - + wxStdDialogButtonSizer* m_sdbSizer; + wxButton* m_sdbSizerOK; + public: - - DIALOG_MIGRATE_BUSES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Migrate Buses"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); + + DIALOG_MIGRATE_BUSES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Migrate Buses"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); ~DIALOG_MIGRATE_BUSES_BASE(); - + }; -#endif //__DIALOG_MIGRATE_BUSES_BASE_H__ diff --git a/eeschema/libedit/lib_edit_frame.cpp b/eeschema/libedit/lib_edit_frame.cpp index 755336a0eb..6fafe9eba6 100644 --- a/eeschema/libedit/lib_edit_frame.cpp +++ b/eeschema/libedit/lib_edit_frame.cpp @@ -1465,7 +1465,7 @@ void LIB_EDIT_FRAME::OnAddPartToSchematic( wxCommandEvent& event ) if( schframe == NULL ) // happens when the schematic editor is not active (or closed) { - DisplayErrorMessage( this, _("No schematic currently open." ) ); + DisplayErrorMessage( this, _( "No schematic currently open." ) ); return; } @@ -1529,7 +1529,10 @@ bool LIB_EDIT_FRAME::addLibraryFile( bool aCreateNew ) { if( !m_libMgr->CreateLibrary( fn.GetFullPath(), libTable ) ) { - DisplayError( this, _( "Could not create the library file. Check write permission." ) ); + DisplayError( this, + wxString::Format( _( "Could not create the library file \"%s\".\n" + "Check write permission." ), + fn.GetFullPath() ) ); return false; } } @@ -1682,7 +1685,8 @@ bool LIB_EDIT_FRAME::backupFile( const wxFileName& aOriginalFile, const wxString if( !wxCopyFile( aOriginalFile.GetFullPath(), backupFileName.GetFullPath() ) ) { - DisplayError( this, _( "Failed to save backup to " ) + backupFileName.GetFullPath() ); + DisplayError( this, wxString::Format( _( "Failed to save backup to \"%s\"" ), + backupFileName.GetFullPath() ) ); return false; } } diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index 700bc05485..ef777e31d2 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -1111,7 +1111,7 @@ void SCH_PAINTER::draw( SCH_COMPONENT *aComp, int aLayer ) // Copy pin info from the component SCH_PINS pinMap = aComp->GetPinMap(); - for( int i = 0; i < originalPins.size() && i < tempPins.size(); ++i ) + for( unsigned i = 0; i < originalPins.size() && i < tempPins.size(); ++i ) { LIB_PIN* originalPin = originalPins[ i ]; LIB_PIN* tempPin = tempPins[ i ]; diff --git a/eeschema/tools/sch_drawing_tool.cpp b/eeschema/tools/sch_drawing_tool.cpp index 1ac347630c..485ce0652c 100644 --- a/eeschema/tools/sch_drawing_tool.cpp +++ b/eeschema/tools/sch_drawing_tool.cpp @@ -125,7 +125,7 @@ TOOL_ACTION SCH_ACTIONS::placeSchematicText( "eeschema.InteractiveDrawing.placeS TOOL_ACTION SCH_ACTIONS::drawLines( "eeschema.InteractiveDrawing.drawLines", AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_ADD_GRAPHIC_POLYLINE ), - _( "Add Lines" ), _( "Add connected lines" ), NULL, AF_ACTIVATE ); + _( "Add Lines" ), _( "Add connected graphic lines" ), NULL, AF_ACTIVATE ); TOOL_ACTION SCH_ACTIONS::placeImage( "eeschema.InteractiveDrawing.placeImage", AS_GLOBAL, 0,