From 271fb7fed470337b6b6d11eec4062914cc3b2c0a Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 14 Sep 2018 13:25:41 +0200 Subject: [PATCH] Make the color picker dialog translatable Fixes: lp:1792556 https://bugs.launchpad.net/kicad/+bug/1792556 --- common/widgets/color4Dpickerdlg.cpp | 22 ++- common/widgets/color4Dpickerdlg.h | 19 +++ common/widgets/color4Dpickerdlg_base.cpp | 26 +-- common/widgets/color4Dpickerdlg_base.fbp | 191 ++++++++++++++++++++++- common/widgets/color4Dpickerdlg_base.h | 5 +- 5 files changed, 244 insertions(+), 19 deletions(-) diff --git a/common/widgets/color4Dpickerdlg.cpp b/common/widgets/color4Dpickerdlg.cpp index e3e490d6a3..1a8d3993ce 100644 --- a/common/widgets/color4Dpickerdlg.cpp +++ b/common/widgets/color4Dpickerdlg.cpp @@ -2,6 +2,26 @@ * @file color4Dpickerdlg.cpp : */ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * 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 3 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 . + */ + + #include "math.h" #include "color4Dpickerdlg.h" @@ -118,7 +138,7 @@ bool COLOR4D_PICKER_DLG::TransferDataToWindow() m_notebook->GetPage( 1 )->Layout(); FinishDialogSettings(); - + return true; } diff --git a/common/widgets/color4Dpickerdlg.h b/common/widgets/color4Dpickerdlg.h index 6c125a1084..881285ff97 100644 --- a/common/widgets/color4Dpickerdlg.h +++ b/common/widgets/color4Dpickerdlg.h @@ -2,6 +2,25 @@ * @file color4Dpickerdlg.h */ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. + * + * 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 3 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 . + */ + #ifndef COLOR4DPICKERDLG_H #define COLOR4DPICKERDLG_H diff --git a/common/widgets/color4Dpickerdlg_base.cpp b/common/widgets/color4Dpickerdlg_base.cpp index 10d84795c0..0f6bf3f241 100644 --- a/common/widgets/color4Dpickerdlg_base.cpp +++ b/common/widgets/color4Dpickerdlg_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Jul 11 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -28,7 +28,7 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i bSizerPanels = new wxBoxSizer( wxHORIZONTAL ); wxStaticBoxSizer* sbSizerViewRGB; - sbSizerViewRGB = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, wxT("RGB") ), wxVERTICAL ); + sbSizerViewRGB = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, _("RGB") ), wxVERTICAL ); m_RgbBitmap = new wxStaticBitmap( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 264,264 ), 0 ); m_RgbBitmap->SetMinSize( wxSize( 264,264 ) ); @@ -43,15 +43,15 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i fgSizerRGB->SetFlexibleDirection( wxBOTH ); fgSizerRGB->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticTextR = new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxT("Red:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextR = new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY, _("Red:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextR->Wrap( -1 ); fgSizerRGB->Add( m_staticTextR, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - m_staticTextG = new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxT("Green:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextG = new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY, _("Green:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextG->Wrap( -1 ); fgSizerRGB->Add( m_staticTextG, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - m_staticTextB = new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxT("Blue:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextB = new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY, _("Blue:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextB->Wrap( -1 ); fgSizerRGB->Add( m_staticTextB, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); @@ -77,7 +77,7 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i bSizerPanels->Add( sbSizerViewRGB, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); wxStaticBoxSizer* sbSizerViewHSV; - sbSizerViewHSV = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, wxT("HSV") ), wxHORIZONTAL ); + sbSizerViewHSV = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, _("HSV") ), wxHORIZONTAL ); wxBoxSizer* bSizer10; bSizer10 = new wxBoxSizer( wxVERTICAL ); @@ -94,11 +94,11 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i fgSizerHSV->SetFlexibleDirection( wxBOTH ); fgSizerHSV->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticTextHue = new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxT("Hue:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextHue = new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY, _("Hue:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextHue->Wrap( -1 ); fgSizerHSV->Add( m_staticTextHue, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - m_staticTextSat = new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxT("Saturation:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextSat = new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY, _("Saturation:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextSat->Wrap( -1 ); fgSizerHSV->Add( m_staticTextSat, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); @@ -121,7 +121,7 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i wxBoxSizer* bSizerBright; bSizerBright = new wxBoxSizer( wxVERTICAL ); - m_staticTextBright = new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxT("Value:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextBright = new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY, _("Value:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextBright->Wrap( -1 ); bSizerBright->Add( m_staticTextBright, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); @@ -141,7 +141,7 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i m_panelFreeColors->SetSizer( bSizerUpperFreeColors ); m_panelFreeColors->Layout(); bSizerUpperFreeColors->Fit( m_panelFreeColors ); - m_notebook->AddPage( m_panelFreeColors, wxT("Color Picker"), true ); + m_notebook->AddPage( m_panelFreeColors, _("Color Picker"), true ); m_panelDefinedColors = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_SizerDefinedColors = new wxBoxSizer( wxVERTICAL ); @@ -161,7 +161,7 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i m_panelDefinedColors->SetSizer( m_SizerDefinedColors ); m_panelDefinedColors->Layout(); m_SizerDefinedColors->Fit( m_panelDefinedColors ); - m_notebook->AddPage( m_panelDefinedColors, wxT("Defined Colors"), false ); + m_notebook->AddPage( m_panelDefinedColors, _("Defined Colors"), false ); bSizerUpperMain->Add( m_notebook, 0, wxEXPAND | wxALL, 5 ); @@ -170,7 +170,7 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i m_SizerTransparency->Add( 0, 20, 0, wxTOP, 5 ); - m_opacityLabel = new wxStaticText( this, wxID_ANY, wxT("Opacity:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_opacityLabel = new wxStaticText( this, wxID_ANY, _("Opacity:"), wxDefaultPosition, wxDefaultSize, 0 ); m_opacityLabel->Wrap( -1 ); m_SizerTransparency->Add( m_opacityLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); @@ -192,7 +192,7 @@ COLOR4D_PICKER_DLG_BASE::COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID i wxBoxSizer* bButtonsSizer; bButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); - m_staticTextOldColor = new wxStaticText( this, wxID_ANY, wxT("Preview (old / new):"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextOldColor = new wxStaticText( this, wxID_ANY, _("Preview (old / new):"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextOldColor->Wrap( -1 ); bButtonsSizer->Add( m_staticTextOldColor, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); diff --git a/common/widgets/color4Dpickerdlg_base.fbp b/common/widgets/color4Dpickerdlg_base.fbp index ce160301cc..000bac82ec 100644 --- a/common/widgets/color4Dpickerdlg_base.fbp +++ b/common/widgets/color4Dpickerdlg_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,7 +14,8 @@ color4Dpickerdlg_base 1000 none - 0 + + 1 color4Dpickerdlg . @@ -54,13 +55,20 @@ - + + + + + + + + @@ -75,17 +83,23 @@ + + + + + + @@ -159,7 +173,14 @@ + + + + + + + @@ -239,7 +260,14 @@ wxTAB_TRAVERSAL + + + + + + + @@ -345,7 +373,14 @@ + + + + + + + @@ -419,6 +454,7 @@ 0 wxID_ANY Red: + 0 0 @@ -444,7 +480,14 @@ -1 + + + + + + + @@ -502,6 +545,7 @@ 0 wxID_ANY Green: + 0 0 @@ -527,7 +571,14 @@ -1 + + + + + + + @@ -585,6 +636,7 @@ 0 wxID_ANY Blue: + 0 0 @@ -610,7 +662,14 @@ -1 + + + + + + + @@ -695,7 +754,14 @@ + + + + + + + @@ -783,7 +849,14 @@ + + + + + + + @@ -871,7 +944,14 @@ + + + + + + + @@ -981,7 +1061,14 @@ + + + + + + + @@ -1055,6 +1142,7 @@ 0 wxID_ANY Hue: + 0 0 @@ -1080,7 +1168,14 @@ -1 + + + + + + + @@ -1138,6 +1233,7 @@ 0 wxID_ANY Saturation: + 0 0 @@ -1163,7 +1259,14 @@ -1 + + + + + + + @@ -1248,7 +1351,14 @@ + + + + + + + @@ -1336,7 +1446,14 @@ + + + + + + + @@ -1410,6 +1527,7 @@ 0 wxID_ANY Value: + 0 0 @@ -1435,7 +1553,14 @@ -1 + + + + + + + @@ -1523,7 +1648,14 @@ + + + + + + + @@ -1565,6 +1697,7 @@ + @@ -1632,7 +1765,14 @@ wxTAB_TRAVERSAL + + + + + + + @@ -1735,6 +1875,7 @@ 0 wxID_ANY Opacity: + 0 0 @@ -1760,7 +1901,14 @@ -1 + + + + + + + @@ -1848,7 +1996,14 @@ + + + + + + + @@ -1890,6 +2045,7 @@ + @@ -1963,7 +2119,14 @@ + + + + + + + @@ -2030,6 +2193,7 @@ 0 wxID_ANY Preview (old / new): + 0 0 @@ -2055,7 +2219,14 @@ -1 + + + + + + + @@ -2136,7 +2307,14 @@ + + + + + + + @@ -2217,7 +2395,14 @@ + + + + + + + diff --git a/common/widgets/color4Dpickerdlg_base.h b/common/widgets/color4Dpickerdlg_base.h index 3d33189809..953cee2988 100644 --- a/common/widgets/color4Dpickerdlg_base.h +++ b/common/widgets/color4Dpickerdlg_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Jul 11 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -10,6 +10,7 @@ #include #include +#include #include "dialog_shim.h" #include #include @@ -88,7 +89,7 @@ class COLOR4D_PICKER_DLG_BASE : public DIALOG_SHIM public: - COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Color Picker"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + COLOR4D_PICKER_DLG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Color Picker"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~COLOR4D_PICKER_DLG_BASE(); };