KiCad PCB EDA Suite
AboutDialog_main.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2010 Rafael Sokolowski <Rafael.Sokolowski@web.de>
5  * Copyright (C) 2010-2018 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <boost/version.hpp>
26 #include <wx/aboutdlg.h>
27 #include <wx/arrimpl.cpp>
28 #include <wx/textctrl.h>
29 #include <wx/utils.h>
30 
31 /* Used icons:
32  * lang_xx_xpm; // Icons of various national flags
33  * show_3d_xpm; // 3D icon
34  * edit_module_xpm;
35  * icon_kicad_xpm; // Icon of the application
36  */
37 #include <bitmaps.h>
38 #include <build_version.h>
39 #include <common.h>
40 #include <pgm_base.h>
41 #include <eda_base_frame.h>
42 
43 #include "aboutinfo.h"
44 #include "dialog_about.h"
45 
46 
47 WX_DEFINE_OBJARRAY( CONTRIBUTORS )
48 
49 // Helper functions:
50 static wxString HtmlHyperlink( const wxString& url, const wxString& description = wxEmptyString );
51 static wxString HtmlNewline( const unsigned int amount = 1 );
52 
53 
58 static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInfo )
59 {
60  // Set application specific icon
61  aInfo.SetAppIcon( aParent->GetIcon() );
62 
63  /* Set title */
64  aInfo.SetAppName( Pgm().App().GetAppName() );
65 
66  /* Copyright information */
67  aInfo.SetCopyright( "(C) 1992-2018 KiCad Developers Team" );
68 
69  /* KiCad build version */
70  wxString version;
71  version << GetBuildVersion()
72 #ifdef DEBUG
73  << ", debug"
74 #else
75  << ", release"
76 #endif
77  << " build";
78 
79  aInfo.SetBuildVersion( version );
80 
81  /* wxWidgets version */
82  wxString libVersion;
83  libVersion << wxGetLibraryVersionInfo().GetVersionString();
84 
85  /* Unicode or ANSI version */
86 #if wxUSE_UNICODE
87  libVersion << wxT( " Unicode " );
88 #else
89  libVersion << wxT( " ANSI " );
90 #endif
91 
92  // Just in case someone builds KiCad with the platform native of Boost instead of
93  // the version included with the KiCad source.
94  libVersion << "and Boost " << ( BOOST_VERSION / 100000 ) << "."
95  << ( BOOST_VERSION / 100 % 1000 ) << "." << ( BOOST_VERSION % 100 )
96  << "\n";
97 
98  // Operating System Information
99 
100  wxPlatformInfo platformInfo;
101 
102  libVersion << "Platform: " << wxGetOsDescription() << ", " << platformInfo.GetArchName();
103 
104  aInfo.SetLibVersion( libVersion );
105 
106 
107  /* info/description part HTML formatted */
108 
109  wxString description;
110 
111  /* short description */
112  description << "<p>";
113  description << "<b><u>"
114  << _( "Description" )
115  << "</u></b>"; // bold & underlined font for caption
116 
117  description << "<p>"
118  << _( "The KiCad EDA Suite is a set of open source applications for the "
119  "creation of electronic schematics and printed circuit boards." )
120  << "</p>";
121 
122  description << "</p>";
123 
124  /* websites */
125  description << "<p><b><u>"
126  << _( "KiCad on the web" )
127  << "</u></b>"; // bold & underlined font for caption
128 
129  // bullet-ed list with some http links
130  description << "<ul>";
131  description << "<li>"
132  << _( "The official KiCad website - " )
133  << HtmlHyperlink( "http://www.kicad-pcb.org" )
134  << "</li>";
135  description << "<li>"
136  << _( "Developer website on Launchpad - " )
137  << HtmlHyperlink( "https://launchpad.net/kicad" )
138  << "</li>";
139 
140  description << "<li>"
141  << _("Official KiCad library repositories - " )
142  << HtmlHyperlink( "https://kicad.github.io" )
143  << "</li>";
144 
145  description << "</ul></p>";
146 
147  description << "<p><b><u>"
148  << _( "Bug tracker" )
149  << "</u></b>"; // bold & underlined font caption
150 
151  // bullet-ed list with some http links
152  description << "<ul>";
153  description << "<li>"
154  << _( "Report or examine bugs - " )
155  << HtmlHyperlink( "https://bugs.launchpad.net/kicad/+bugs?orderby=-id&start=0",
156  "https://bugs.launchpad.net/kicad" )
157  << "</li>";
158  description << "</ul></p>";
159 
160  description << "<p><b><u>"
161  << _( "KiCad user's groups and community" )
162  << "</u></b>"; // bold & underlined font caption
163 
164  description << "<ul>";
165  description << "<li>"
166  << _( "KiCad forum - " )
167  << HtmlHyperlink( "https://forum.kicad.info" )
168  << "</li>";
169 
170  description << "<li>"
171  <<_( "KiCad user's group - " )
172  << HtmlHyperlink( "https://groups.yahoo.com/neo/groups/kicad-users/info" )
173  << "</li>";
174 
175  description << "</ul></p>";
176 
177  aInfo.SetDescription( description );
178 
179 
180  // License information also HTML formatted:
181  wxString license;
182  license
183  << "<div align='center'>"
184  << HtmlNewline( 4 )
185  << _( "The complete KiCad EDA Suite is released under the" ) << HtmlNewline( 2 )
186  << HtmlHyperlink( "http://www.gnu.org/licenses",
187  _( "GNU General Public License (GPL) version 3 or any later version" ) )
188  << "</div>";
189 
190  aInfo.SetLicense( license );
191 
192 
193  /* A contributor consists of the following information:
194  * Mandatory:
195  * - Name
196  * Optional:
197  * - EMail address
198  * - Category
199  * - Category specific icon
200  *
201  * All contributors of the same category will be enumerated under this category
202  * which should be represented by the same icon.
203  */
204 
205  // The core developers
206  aInfo.AddDeveloper( new CONTRIBUTOR( "Jean-Pierre Charras" ) );
207  aInfo.AddDeveloper( new CONTRIBUTOR( "Dick Hollenbeck" ) );
208  aInfo.AddDeveloper( new CONTRIBUTOR( "Wayne Stambaugh" ) );
209 
210  // alphabetically by last name after main 3 above:
211  aInfo.AddDeveloper( new CONTRIBUTOR( "Frank Bennett" ) );
212  aInfo.AddDeveloper( new CONTRIBUTOR( "Cirilo Bernardo" ) );
213  aInfo.AddDeveloper( new CONTRIBUTOR( "Kevin Cozens" ) );
214  aInfo.AddDeveloper( new CONTRIBUTOR( "Jonas Diemer" ) );
215  aInfo.AddDeveloper( new CONTRIBUTOR( "Jon Evans" ) );
216  aInfo.AddDeveloper( new CONTRIBUTOR( "Seth Hillbrand" ) );
217  aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Torsten Hüter" ) ) );
218  aInfo.AddDeveloper( new CONTRIBUTOR( "Jerry Jacobs" ) );
219  aInfo.AddDeveloper( new CONTRIBUTOR( "Mario Luzeiro" ) );
220  aInfo.AddDeveloper( new CONTRIBUTOR( "Daniel Majewski" ) );
221  aInfo.AddDeveloper( new CONTRIBUTOR( "Lorenzo Marcantonio" ) );
222  aInfo.AddDeveloper( new CONTRIBUTOR( "Marco Mattila" ) );
223  aInfo.AddDeveloper( new CONTRIBUTOR( "Russell Oliver" ) );
224  aInfo.AddDeveloper( new CONTRIBUTOR( "Alexis Lockwood" ) );
225  aInfo.AddDeveloper( new CONTRIBUTOR( "Miguel Angel Ajo Pelayo" ) );
226  aInfo.AddDeveloper( new CONTRIBUTOR( "Jacobo Aragunde Perez" ) );
227  aInfo.AddDeveloper( new CONTRIBUTOR( "Simon Richter" ) );
228  aInfo.AddDeveloper( new CONTRIBUTOR( "Mark Roszko" ) );
229  aInfo.AddDeveloper( new CONTRIBUTOR( "Marco Serantoni" ) );
230  aInfo.AddDeveloper( new CONTRIBUTOR( "Brian Sidebotham" ) );
231  aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Mateusz Skowroński" ) ) );
232  aInfo.AddDeveloper( new CONTRIBUTOR( "Rafael Sokolowski" ) );
233  aInfo.AddDeveloper( new CONTRIBUTOR( "Vesa Solonen" ) );
234  aInfo.AddDeveloper( new CONTRIBUTOR( "Bernhard Stegmaier" ) );
235  aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Orson (Maciej Sumiński)" ) ) );
236  aInfo.AddDeveloper( new CONTRIBUTOR( "Oliver Walters" ) );
237  aInfo.AddDeveloper( new CONTRIBUTOR( "Tomasz Wlostowski" ) );
238  aInfo.AddDeveloper( new CONTRIBUTOR( "Adam Wolf" ) );
239  aInfo.AddDeveloper( new CONTRIBUTOR( "Jeff Young" ) );
240  aInfo.AddDeveloper( new CONTRIBUTOR( "Alexander Zakamaldin" ) );
241  aInfo.AddDeveloper( new CONTRIBUTOR( "Henner Zeller" ) );
242  aInfo.AddDeveloper( new CONTRIBUTOR( "Andrew Zonenberg" ) );
243  aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Nick Østergaard" ) ) );
244 
245  // The document writers
246  aInfo.AddDocWriter( new CONTRIBUTOR( "Jean-Pierre Charras" ) );
247  aInfo.AddDocWriter( new CONTRIBUTOR( "Marco Ciampa" ) );
248  aInfo.AddDocWriter( new CONTRIBUTOR( "Dick Hollenbeck" ) );
249  aInfo.AddDocWriter( new CONTRIBUTOR( "Igor Plyatov" ) );
250  aInfo.AddDocWriter( new CONTRIBUTOR( "Wayne Stambaugh" ) );
251  aInfo.AddDocWriter( new CONTRIBUTOR( "Fabrizio Tappero" ) );
252 
253  /* The translators
254  * As category the language to which the translation was done is used
255  * and as icon the national flag of the corresponding country.
256  */
257  aInfo.AddTranslator( new CONTRIBUTOR( "Robert Buj",
258  wxEmptyString,
259  wxEmptyString,
260  "Catalan (CA)",
261  aInfo.CreateKiBitmap( lang_ca_xpm ) ) );
262  aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Martin Kratoška" ),
263  wxEmptyString,
264  wxEmptyString,
265  "Czech (CZ)",
266  aInfo.CreateKiBitmap( lang_cs_xpm ) ) );
267  aInfo.AddTranslator( new CONTRIBUTOR( "Jerry Jacobs",
268  wxEmptyString,
269  wxEmptyString,
270  "Dutch (NL)",
271  aInfo.CreateKiBitmap( lang_nl_xpm ) ) );
272  aInfo.AddTranslator( new CONTRIBUTOR( "Vesa Solonen",
273  wxEmptyString,
274  wxEmptyString,
275  "Finnish (FI)",
276  aInfo.CreateKiBitmap( lang_fi_xpm ) ) );
277  aInfo.AddTranslator( new CONTRIBUTOR( "Jean-Pierre Charras",
278  wxEmptyString,
279  wxEmptyString,
280  "French (FR)",
281  aInfo.CreateKiBitmap( lang_fr_xpm ) ) );
282  aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Mateusz Skowroński" ),
283  wxEmptyString,
284  wxEmptyString,
285  "Polish (PL)",
286  aInfo.CreateKiBitmap( lang_pl_xpm ) ) );
287  aInfo.AddTranslator( new CONTRIBUTOR( "Kerusey Karyu",
288  wxEmptyString,
289  wxEmptyString,
290  "Polish (PL)",
291  aInfo.CreateKiBitmap( lang_pl_xpm ) ) );
292  aInfo.AddTranslator( new CONTRIBUTOR( "Renie Marquet",
293  wxEmptyString,
294  wxEmptyString,
295  "Portuguese (PT)",
296  aInfo.CreateKiBitmap( lang_pt_xpm ) ) );
297  aInfo.AddTranslator( new CONTRIBUTOR( "Igor Plyatov",
298  wxEmptyString,
299  wxEmptyString,
300  "Russian (RU)",
301  aInfo.CreateKiBitmap( lang_ru_xpm ) ) );
302  aInfo.AddTranslator( new CONTRIBUTOR( "Andrey Fedorushkov",
303  wxEmptyString,
304  wxEmptyString,
305  "Russian (RU)",
306  aInfo.CreateKiBitmap( lang_ru_xpm ) ) );
307  aInfo.AddTranslator( new CONTRIBUTOR( "Eldar Khayrullin",
308  wxEmptyString,
309  wxEmptyString,
310  "Russian (RU)",
311  aInfo.CreateKiBitmap( lang_ru_xpm ) ) );
312  aInfo.AddTranslator( new CONTRIBUTOR( "Pedro Martin del Valle",
313  wxEmptyString,
314  wxEmptyString,
315  "Spanish (ES)",
316  aInfo.CreateKiBitmap( lang_es_xpm ) ) );
317  aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Iñigo Zuluaga" ),
318  wxEmptyString,
319  wxEmptyString,
320  "Spanish (ES)",
321  aInfo.CreateKiBitmap( lang_es_xpm ) ) );
322  aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Iñigo Figuero" ),
323  wxEmptyString,
324  wxEmptyString,
325  "Spanish (ES)",
326  aInfo.CreateKiBitmap( lang_es_xpm ) ) );
327  aInfo.AddTranslator( new CONTRIBUTOR( "Rafael Sokolowski",
328  wxEmptyString,
329  wxEmptyString,
330  "German (DE)",
331  aInfo.CreateKiBitmap( lang_de_xpm ) ) );
332  aInfo.AddTranslator( new CONTRIBUTOR( "Kenta Yonekura",
333  wxEmptyString,
334  wxEmptyString,
335  "Japanese (JA)",
336  aInfo.CreateKiBitmap( lang_jp_xpm ) ) );
337  aInfo.AddTranslator( new CONTRIBUTOR( "Manolis Stefanis",
338  wxEmptyString,
339  wxEmptyString,
340  "Greek (el_GR)",
341  aInfo.CreateKiBitmap( lang_gr_xpm ) ) );
342  aInfo.AddTranslator( new CONTRIBUTOR( "Athanasios Vlastos",
343  wxEmptyString,
344  wxEmptyString,
345  "Greek (el_GR)",
346  aInfo.CreateKiBitmap( lang_gr_xpm ) ) );
347  aInfo.AddTranslator( new CONTRIBUTOR( "Milonas Kostas",
348  wxEmptyString,
349  wxEmptyString,
350  "Greek (el_GR)",
351  aInfo.CreateKiBitmap( lang_gr_xpm ) ) );
352  aInfo.AddTranslator( new CONTRIBUTOR( "Michail Misirlis",
353  wxEmptyString,
354  wxEmptyString,
355  "Greek (el_GR)",
356  aInfo.CreateKiBitmap( lang_gr_xpm ) ) );
357  aInfo.AddTranslator( new CONTRIBUTOR( "Massimo Cioce",
358  wxEmptyString,
359  wxEmptyString,
360  "Italian (IT)",
361  aInfo.CreateKiBitmap( lang_it_xpm ) ) );
362  aInfo.AddTranslator( new CONTRIBUTOR( "Marco Ciampa",
363  wxEmptyString,
364  wxEmptyString,
365  "Italian (IT)",
366  aInfo.CreateKiBitmap( lang_it_xpm ) ) );
367  aInfo.AddTranslator( new CONTRIBUTOR( "Evgeniy Ivanov",
368  wxEmptyString,
369  wxEmptyString,
370  "Bulgarian (BG)",
371  aInfo.CreateKiBitmap( lang_bg_xpm ) ) );
372  aInfo.AddTranslator( new CONTRIBUTOR( "Liu Guang",
373  wxEmptyString,
374  wxEmptyString,
375  "Simplified Chinese (zh_CN)",
376  aInfo.CreateKiBitmap( lang_zh_xpm ) ) );
377 
378  // Maintainer who helper in translations, but not in a specific translation
379  #define OTHERS_IN_TRANSLATION _( "Others" )
380  aInfo.AddTranslator( new CONTRIBUTOR( "Remy Halvick",
381  wxEmptyString,
382  wxEmptyString,
384  aInfo.AddTranslator( new CONTRIBUTOR( "David Briscoe",
385  wxEmptyString,
386  wxEmptyString,
388  aInfo.AddTranslator( new CONTRIBUTOR( "Dominique Laigle",
389  wxEmptyString,
390  wxEmptyString,
392  aInfo.AddTranslator( new CONTRIBUTOR( "Paul Burke",
393  wxEmptyString,
394  wxEmptyString,
396 
397  // Programm credits for icons
398  #define ICON_CONTRIBUTION _( "Icons by" )
399  aInfo.AddArtist( new CONTRIBUTOR( wxT( "Iñigo Zuluaga" ),
400  wxEmptyString,
401  wxEmptyString,
403  aInfo.CreateKiBitmap( svg_file_xpm ) ) );
404  aInfo.AddArtist( new CONTRIBUTOR( "Konstantin Baranovskiy",
405  wxEmptyString,
406  wxEmptyString,
408  aInfo.CreateKiBitmap( svg_file_xpm ) ) );
409  aInfo.AddArtist( new CONTRIBUTOR( "Fabrizio Tappero",
410  wxEmptyString,
411  wxEmptyString,
413  aInfo.CreateKiBitmap( svg_file_xpm ) ) );
414 
415  // Program credits for 3d models
416  #define MODELS_3D_CONTRIBUTION _( "3D models by" )
417  aInfo.AddArtist( new CONTRIBUTOR( "GitHub contributors",
418  wxEmptyString,
419  "https://github.com/KiCad/kicad-packages3D/graphs/contributors",
421  aInfo.CreateKiBitmap( three_d_xpm ) ) );
422  aInfo.AddArtist( new CONTRIBUTOR( "Christophe Boschat",
423  wxEmptyString,
424  wxEmptyString,
426  aInfo.CreateKiBitmap( three_d_xpm ) ) );
427  aInfo.AddArtist( new CONTRIBUTOR( "Renie Marquet",
428  wxEmptyString,
429  wxEmptyString,
431  aInfo.CreateKiBitmap( three_d_xpm ) ) );
432 
433  #define SYMBOL_LIB_CONTRIBUTION _( "Symbols by" )
434  aInfo.AddArtist( new CONTRIBUTOR( "GitHub contributors",
435  wxEmptyString,
436  "https://github.com/KiCad/kicad-symbols/graphs/contributors",
438  aInfo.CreateKiBitmap( new_component_xpm ) ) );
439 
440  #define FOOTPRINT_LIB_CONTRIBUTION _( "Footprints by" )
441  aInfo.AddArtist( new CONTRIBUTOR( "GitHub contributors",
442  wxEmptyString,
443  "https://github.com/KiCad/kicad-footprints/graphs/contributors",
445  aInfo.CreateKiBitmap( edit_module_xpm ) ) );
446 
447  // Program credits for package developers.
448  aInfo.AddPackager( new CONTRIBUTOR( "Jean-Samuel Reynaud" ) );
449  aInfo.AddPackager( new CONTRIBUTOR( "Bernhard Stegmaier" ) );
450  aInfo.AddPackager( new CONTRIBUTOR( "Adam Wolf" ) );
451  aInfo.AddPackager( new CONTRIBUTOR( wxT( "Nick Østergaard" ) ) );
452 }
453 
454 
456 {
457  ABOUT_APP_INFO info;
458  buildKicadAboutBanner( aParent, info );
459 
460  DIALOG_ABOUT dlg( aParent, info );
461  dlg.ShowModal();
462 }
463 
464 
468 
478 static wxString HtmlHyperlink( const wxString& aUrl, const wxString& aDescription )
479 {
480  wxString hyperlink = wxEmptyString;
481 
482  if( aDescription.IsEmpty() )
483  hyperlink << "<a href='" << aUrl << "'>" << aUrl << "</a>";
484  else
485  hyperlink << "<a href='" << aUrl << "'>" << aDescription << "</a>";
486 
487  return hyperlink;
488 }
489 
490 
498 static wxString HtmlNewline( const unsigned int aCount )
499 {
500  wxString newlineTags = wxEmptyString;
501 
502  for( size_t i = 0; i<aCount; ++i )
503  newlineTags << "<br>";
504 
505  return newlineTags;
506 }
#define ICON_CONTRIBUTION
#define OTHERS_IN_TRANSLATION
static wxString HtmlNewline(const unsigned int amount=1)
Create an HTML newline character sequence of aCount.
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
An object of this class is meant to be used to store application specific information like who has co...
Definition: aboutinfo.h:44
static void buildKicadAboutBanner(EDA_BASE_FRAME *aParent, ABOUT_APP_INFO &aInfo)
Initializes the ABOUT_APP_INFO object with application specific information.
#define SYMBOL_LIB_CONTRIBUTION
void ShowAboutDialog(EDA_BASE_FRAME *aParent)
wxString GetBuildVersion()
Function GetBuildVersion Return the build version string.
#define MODELS_3D_CONTRIBUTION
Base window classes and related definitions.
static wxString HtmlHyperlink(const wxString &url, const wxString &description=wxEmptyString)
Helper functions.
see class PGM_BASE
A contributor, a person which was involved in the development of the application or which has contrib...
Definition: aboutinfo.h:148
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
size_t i
Definition: json11.cpp:597
The common library.
#define FOOTPRINT_LIB_CONTRIBUTION
About dialog to show application specific information.
Definition: dialog_about.h:40