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-2017 KiCad Developers, see CHANGELOG.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 <wxstruct.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-2017 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://github.com/KiCad/" )
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( "Jonas Diemer" ) );
214  aInfo.AddDeveloper( new CONTRIBUTOR( "Jon Evans" ) );
215  aInfo.AddDeveloper( new CONTRIBUTOR( "Seth Hillbrand" ) );
216  aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Torsten Hüter" ) ) );
217  aInfo.AddDeveloper( new CONTRIBUTOR( "Jerry Jacobs" ) );
218  aInfo.AddDeveloper( new CONTRIBUTOR( "Mario Luzeiro" ) );
219  aInfo.AddDeveloper( new CONTRIBUTOR( "Daniel Majewski" ) );
220  aInfo.AddDeveloper( new CONTRIBUTOR( "Lorenzo Marcantonio" ) );
221  aInfo.AddDeveloper( new CONTRIBUTOR( "Marco Mattila" ) );
222  aInfo.AddDeveloper( new CONTRIBUTOR( "Russell Oliver" ) );
223  aInfo.AddDeveloper( new CONTRIBUTOR( "Chris Pavlina" ) );
224  aInfo.AddDeveloper( new CONTRIBUTOR( "Miguel Angel Ajo Pelayo" ) );
225  aInfo.AddDeveloper( new CONTRIBUTOR( "Jacobo Aragunde Perez" ) );
226  aInfo.AddDeveloper( new CONTRIBUTOR( "Simon Richter" ) );
227  aInfo.AddDeveloper( new CONTRIBUTOR( "Mark Roszko" ) );
228  aInfo.AddDeveloper( new CONTRIBUTOR( "Marco Serantoni" ) );
229  aInfo.AddDeveloper( new CONTRIBUTOR( "Brian Sidebotham" ) );
230  aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Mateusz Skowroński" ) ) );
231  aInfo.AddDeveloper( new CONTRIBUTOR( "Rafael Sokolowski" ) );
232  aInfo.AddDeveloper( new CONTRIBUTOR( "Vesa Solonen" ) );
233  aInfo.AddDeveloper( new CONTRIBUTOR( "Bernhard Stegmaier" ) );
234  aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Orson (Maciej Sumiński)" ) ) );
235  aInfo.AddDeveloper( new CONTRIBUTOR( "Oliver Walters" ) );
236  aInfo.AddDeveloper( new CONTRIBUTOR( "Tomasz Wlostowski" ) );
237  aInfo.AddDeveloper( new CONTRIBUTOR( "Adam Wolf" ) );
238  aInfo.AddDeveloper( new CONTRIBUTOR( "Alexander Zakamaldin" ) );
239  aInfo.AddDeveloper( new CONTRIBUTOR( "Henner Zeller" ) );
240  aInfo.AddDeveloper( new CONTRIBUTOR( "Andrew Zonenberg" ) );
241  aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Nick Østergaard" ) ) );
242 
243  // The document writers
244  aInfo.AddDocWriter( new CONTRIBUTOR( "Jean-Pierre Charras" ) );
245  aInfo.AddDocWriter( new CONTRIBUTOR( "Marco Ciampa" ) );
246  aInfo.AddDocWriter( new CONTRIBUTOR( "Dick Hollenbeck" ) );
247  aInfo.AddDocWriter( new CONTRIBUTOR( "Igor Plyatov" ) );
248  aInfo.AddDocWriter( new CONTRIBUTOR( "Wayne Stambaugh" ) );
249  aInfo.AddDocWriter( new CONTRIBUTOR( "Fabrizio Tappero" ) );
250 
251  /* The translators
252  * As category the language to which the translation was done is used
253  * and as icon the national flag of the corresponding country.
254  */
255  aInfo.AddTranslator( new CONTRIBUTOR( "Robert Buj",
256  wxEmptyString,
257  wxEmptyString,
258  "Catalan (CA)",
259  KiBitmapNew( lang_catalan_xpm ) ) );
260  aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Martin Kratoška" ),
261  wxEmptyString,
262  wxEmptyString,
263  "Czech (CZ)",
264  KiBitmapNew( lang_cs_xpm ) ) );
265  aInfo.AddTranslator( new CONTRIBUTOR( "Jerry Jacobs",
266  wxEmptyString,
267  wxEmptyString,
268  "Dutch (NL)",
269  KiBitmapNew( lang_nl_xpm ) ) );
270  aInfo.AddTranslator( new CONTRIBUTOR( "Vesa Solonen",
271  wxEmptyString,
272  wxEmptyString,
273  "Finnish (FI)",
274  KiBitmapNew( lang_fi_xpm ) ) );
275  aInfo.AddTranslator( new CONTRIBUTOR( "Jean-Pierre Charras",
276  wxEmptyString,
277  wxEmptyString,
278  "French (FR)",
279  KiBitmapNew( lang_fr_xpm ) ) );
280  aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Mateusz Skowroński" ),
281  wxEmptyString,
282  wxEmptyString,
283  "Polish (PL)",
284  KiBitmapNew( lang_pl_xpm ) ) );
285  aInfo.AddTranslator( new CONTRIBUTOR( "Kerusey Karyu",
286  wxEmptyString,
287  wxEmptyString,
288  "Polish (PL)",
289  KiBitmapNew( lang_pl_xpm ) ) );
290  aInfo.AddTranslator( new CONTRIBUTOR( "Renie Marquet",
291  wxEmptyString,
292  wxEmptyString,
293  "Portuguese (PT)",
294  KiBitmapNew( lang_pt_xpm ) ) );
295  aInfo.AddTranslator( new CONTRIBUTOR( "Igor Plyatov",
296  wxEmptyString,
297  wxEmptyString,
298  "Russian (RU)",
299  KiBitmapNew( lang_ru_xpm ) ) );
300  aInfo.AddTranslator( new CONTRIBUTOR( "Andrey Fedorushkov",
301  wxEmptyString,
302  wxEmptyString,
303  "Russian (RU)",
304  KiBitmapNew( lang_ru_xpm ) ) );
305  aInfo.AddTranslator( new CONTRIBUTOR( "Eldar Khayrullin",
306  wxEmptyString,
307  wxEmptyString,
308  "Russian (RU)",
309  KiBitmapNew( lang_ru_xpm ) ) );
310  aInfo.AddTranslator( new CONTRIBUTOR( "Pedro Martin del Valle",
311  wxEmptyString,
312  wxEmptyString,
313  "Spanish (ES)",
314  KiBitmapNew( lang_es_xpm ) ) );
315  aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Iñigo Zuluaga" ),
316  wxEmptyString,
317  wxEmptyString,
318  "Spanish (ES)",
319  KiBitmapNew( lang_es_xpm ) ) );
320  aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Iñigo Figuero" ),
321  wxEmptyString,
322  wxEmptyString,
323  "Spanish (ES)",
324  KiBitmapNew( lang_es_xpm ) ) );
325  aInfo.AddTranslator( new CONTRIBUTOR( "Rafael Sokolowski",
326  wxEmptyString,
327  wxEmptyString,
328  "German (DE)",
329  KiBitmapNew( lang_de_xpm ) ) );
330  aInfo.AddTranslator( new CONTRIBUTOR( "Kenta Yonekura",
331  wxEmptyString,
332  wxEmptyString,
333  "Japanese (JA)",
334  KiBitmapNew( lang_jp_xpm ) ) );
335  aInfo.AddTranslator( new CONTRIBUTOR( "Manolis Stefanis",
336  wxEmptyString,
337  wxEmptyString,
338  "Greek (el_GR)",
339  KiBitmapNew( lang_gr_xpm ) ) );
340  aInfo.AddTranslator( new CONTRIBUTOR( "Athanasios Vlastos",
341  wxEmptyString,
342  wxEmptyString,
343  "Greek (el_GR)",
344  KiBitmapNew( lang_gr_xpm ) ) );
345  aInfo.AddTranslator( new CONTRIBUTOR( "Milonas Kostas",
346  wxEmptyString,
347  wxEmptyString,
348  "Greek (el_GR)",
349  KiBitmapNew( lang_gr_xpm ) ) );
350  aInfo.AddTranslator( new CONTRIBUTOR( "Michail Misirlis",
351  wxEmptyString,
352  wxEmptyString,
353  "Greek (el_GR)",
354  KiBitmapNew( lang_gr_xpm ) ) );
355  aInfo.AddTranslator( new CONTRIBUTOR( "Massimo Cioce",
356  wxEmptyString,
357  wxEmptyString,
358  "Italian (IT)",
359  KiBitmapNew( lang_it_xpm ) ) );
360  aInfo.AddTranslator( new CONTRIBUTOR( "Marco Ciampa",
361  wxEmptyString,
362  wxEmptyString,
363  "Italian (IT)",
364  KiBitmapNew( lang_it_xpm ) ) );
365  aInfo.AddTranslator( new CONTRIBUTOR( "Evgeniy Ivanov",
366  wxEmptyString,
367  wxEmptyString,
368  "Bulgarian (BG)",
369  KiBitmapNew( lang_bg_xpm ) ) );
370 
371  // Maintainer who helper in translations, but not in a specific translation
372  #define OTHERS_IN_TRANSLATION _( "Others" )
373  aInfo.AddTranslator( new CONTRIBUTOR( "Remy Halvick",
374  wxEmptyString,
375  wxEmptyString,
377  aInfo.AddTranslator( new CONTRIBUTOR( "David Briscoe",
378  wxEmptyString,
379  wxEmptyString,
381  aInfo.AddTranslator( new CONTRIBUTOR( "Dominique Laigle",
382  wxEmptyString,
383  wxEmptyString,
385  aInfo.AddTranslator( new CONTRIBUTOR( "Paul Burke",
386  wxEmptyString,
387  wxEmptyString,
389 
390  // Programm credits for icons
391  #define ICON_CONTRIBUTION _( "Icons by" )
392  aInfo.AddArtist( new CONTRIBUTOR( wxT( "Iñigo Zuluaga" ),
393  wxEmptyString,
394  wxEmptyString,
396  KiBitmapNew( svg_file_xpm ) ) );
397  aInfo.AddArtist( new CONTRIBUTOR( "Konstantin Baranovskiy",
398  wxEmptyString,
399  wxEmptyString,
401  KiBitmapNew( svg_file_xpm ) ) );
402  aInfo.AddArtist( new CONTRIBUTOR( "Fabrizio Tappero",
403  wxEmptyString,
404  wxEmptyString,
406  KiBitmapNew( svg_file_xpm ) ) );
407 
408  // Program credits for 3d models
409  #define MODELS_3D_CONTRIBUTION _( "3D models by" )
410  aInfo.AddArtist( new CONTRIBUTOR( "GitHub contributors",
411  wxEmptyString,
412  "https://github.com/KiCad/kicad-packages3D/graphs/contributors",
414  KiBitmapNew( three_d_xpm ) ) );
415  aInfo.AddArtist( new CONTRIBUTOR( "Christophe Boschat",
416  wxEmptyString,
417  wxEmptyString,
419  KiBitmapNew( three_d_xpm ) ) );
420  aInfo.AddArtist( new CONTRIBUTOR( "Renie Marquet",
421  wxEmptyString,
422  wxEmptyString,
424  KiBitmapNew( three_d_xpm ) ) );
425 
426  #define SYMBOL_LIB_CONTRIBUTION _( "Symbols by" )
427  aInfo.AddArtist( new CONTRIBUTOR( "GitHub contributors",
428  wxEmptyString,
429  "https://github.com/KiCad/kicad-symbols/graphs/contributors",
431  KiBitmapNew( edit_component_xpm ) ) );
432 
433  #define FOOTPRINT_LIB_CONTRIBUTION _( "Footprints by" )
434  aInfo.AddArtist( new CONTRIBUTOR( "GitHub contributors",
435  wxEmptyString,
436  "https://github.com/KiCad/kicad-footprints/graphs/contributors",
438  KiBitmapNew( edit_module_xpm ) ) );
439 
440  // Program credits for package developers.
441  aInfo.AddPackager( new CONTRIBUTOR( "Jean-Samuel Reynaud" ) );
442  aInfo.AddPackager( new CONTRIBUTOR( "Bernhard Stegmaier" ) );
443  aInfo.AddPackager( new CONTRIBUTOR( "Adam Wolf" ) );
444  aInfo.AddPackager( new CONTRIBUTOR( wxT( "Nick Østergaard" ) ) );
445 }
446 
447 
449 {
450  ABOUT_APP_INFO info;
451  buildKicadAboutBanner( aParent, info );
452 
453  DIALOG_ABOUT dlg( aParent, info );
454  dlg.ShowModal();
455 }
456 
457 
461 
471 static wxString HtmlHyperlink( const wxString& aUrl, const wxString& aDescription )
472 {
473  wxString hyperlink = wxEmptyString;
474 
475  if( aDescription.IsEmpty() )
476  hyperlink << "<a href='" << aUrl << "'>" << aUrl << "</a>";
477  else
478  hyperlink << "<a href='" << aUrl << "'>" << aDescription << "</a>";
479 
480  return hyperlink;
481 }
482 
483 
491 static wxString HtmlNewline( const unsigned int aCount )
492 {
493  wxString newlineTags = wxEmptyString;
494 
495  for( size_t i = 0; i<aCount; ++i )
496  newlineTags << "<br>";
497 
498  return newlineTags;
499 }
#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:65
An object of this class is meant to be used to store application specific information like who has co...
Definition: aboutinfo.h:42
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
wxBitmap * KiBitmapNew(BITMAP_DEF aBitmap)
Function KiBitmapNew allocates a wxBitmap on heap from a memory record, held in a BITMAP_DEF...
Definition: bitmap.cpp:46
void ShowAboutDialog(EDA_BASE_FRAME *aParent)
wxString GetBuildVersion()
Function GetBuildVersion Return the build version string.
Base window classes and related definitions.
#define MODELS_3D_CONTRIBUTION
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:136
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
Definition: wxstruct.h:117
The common library.
#define FOOTPRINT_LIB_CONTRIBUTION
About dialog to show application specific information.
Definition: dialog_about.h:40