KiCad PCB EDA Suite
dialog_about.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) 2017-2019 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 
26 #include <config.h>
27 #include <string>
28 
29 // kicad_curl.h must be included before wx headers, to avoid
30 // conflicts for some defines, at least on Windows
31 #ifdef BUILD_GITHUB_PLUGIN
32 // kicad_curl.h can create conflicts for some defines, at least on Windows
33 // so we are using here 2 proxy functions to know Curl version to avoid
34 // including kicad_curl.h to know Curl version
35 extern std::string GetKicadCurlVersion();
36 extern std::string GetCurlLibVersion();
37 #endif
38 #if defined( KICAD_USE_OCC ) | defined( KICAD_USE_OCE )
39 #include <Standard_Version.hxx>
40 #endif
41 
42 #include <boost/version.hpp>
43 #include <wx/clipbrd.h>
44 #include <wx/msgdlg.h>
45 #include <wx/hyperlink.h>
46 
47 /* All KiCad icons are linked into shared library 'libbitmaps.a'.
48  * Icons:
49  * preference_xpm; // Icon for 'Developers' tab
50  * editor_xpm; // Icon for 'Doc Writers' tab
51  * palette_xpm; // Icon for 'Artists' tab
52  * language_xpm; // Icon for 'Translators' tab
53  * right_xpm; // Right arrow icon for list items
54  * info_xpm; // Bulb for description tab
55  * tools_xpm; // Sheet of paper icon for license info tab
56  */
57 #include <bitmaps.h>
58 #include <build_version.h>
59 #include <html_messagebox.h>
60 
61 #include "dialog_about.h"
62 
63 
64 /*
65  * Class DIALOG_ABOUT methods
66  */
67 
69  : DIALOG_ABOUT_BASE( aParent ), m_info( aAppInfo )
70 {
71  wxASSERT( aParent != nullptr );
72 
73  m_picInformation = KiBitmap( info_xpm );
74  m_picDevelopers = KiBitmap( preference_xpm );
75  m_picDocWriters = KiBitmap( editor_xpm );
76  m_picArtists = KiBitmap( palette_xpm );
77  m_picTranslators = KiBitmap( language_xpm );
78  m_picLicense = KiBitmap( tools_xpm );
79  m_picPackagers = KiBitmap( zip_xpm );
80 
81  if( m_info.GetAppIcon().IsOk() )
82  {
83  SetIcon( m_info.GetAppIcon() );
84  m_bitmapApp->SetBitmap( m_info.GetAppIcon() );
85  }
86  else
87  {
88  wxIcon icon;
89  icon.CopyFromBitmap( KiBitmap( icon_kicad_xpm ) );
90  SetIcon( icon );
91  m_bitmapApp->SetBitmap( icon );
92  }
93 
94  m_titleName = aParent->GetAboutTitle();
95  m_staticTextAppTitle->SetLabel( m_titleName );
97  m_staticTextBuildVersion->SetLabel( "Version: " + m_info.GetBuildVersion() );
99 
100  SetTitle( wxString::Format( _( "About %s" ), m_titleName ) );
101  createNotebooks();
102 
103  GetSizer()->SetSizeHints( this );
104  m_auiNotebook->Update();
105  SetFocus();
106  Centre();
107 }
108 
109 
111 {
112 }
113 
114 
116 {
117  // three columns with vertical and horizontal extra space of two pixels
118  wxFlexGridSizer* fgSizer = new wxFlexGridSizer( 3, 2, 2 );
119  fgSizer->SetFlexibleDirection( wxHORIZONTAL );
120  fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
121 
122  return fgSizer;
123 }
124 
125 
127 {
130 
132  m_info.GetDevelopers() );
134  m_info.GetDocWriters() );
135 
137  m_info.GetArtists() );
141  m_info.GetPackagers() );
142 
144 }
145 
146 void DIALOG_ABOUT::createNotebookPage( wxAuiNotebook* aParent, const wxString& aCaption,
147  const wxBitmap& aIcon, const CONTRIBUTORS& aContributors )
148 {
149  wxBoxSizer* bSizer = new wxBoxSizer( wxHORIZONTAL );
150 
151  wxScrolledWindow* m_scrolledWindow1 = new wxScrolledWindow( aParent, wxID_ANY,
152  wxDefaultPosition,
153  wxDefaultSize,
154  wxHSCROLL|wxVSCROLL );
155  m_scrolledWindow1->SetScrollRate( 5, 5 );
156 
157  /* Panel for additional space at the left,
158  * but can also be used to show an additional bitmap.
159  */
160  wxPanel* panel1 = new wxPanel( m_scrolledWindow1 );
161 
162  wxFlexGridSizer* fgSizer1 = createFlexGridSizer();
163 
164  for( size_t i=0; i<aContributors.GetCount(); ++i )
165  {
166  CONTRIBUTOR* contributor = &aContributors.Item( i );
167 
168  // Icon at first column
169  wxStaticBitmap* m_bitmap1 = createStaticBitmap( m_scrolledWindow1, contributor->GetIcon() );
170  fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
171 
172  // Name of contributor at second column
173  if ( contributor->GetName() != wxEmptyString )
174  {
175  wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
176  contributor->GetName(),
177  wxDefaultPosition, wxDefaultSize, 0 );
178  m_staticText1->Wrap( -1 );
179  fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
180  }
181  else
182  {
183  fgSizer1->AddSpacer( 5 );
184  }
185 
186  // Email address of contributor at third column
187  if ( contributor->GetEMail() != wxEmptyString )
188  {
189  wxStaticText* hyperlink = wxStaticTextMail( m_scrolledWindow1,
190  contributor->GetEMail() );
191  fgSizer1->Add( hyperlink, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
192  }
193  else
194  {
195  fgSizer1->AddSpacer( 5 );
196  }
197  }
198 
199  bSizer->Add( panel1, 1, wxEXPAND|wxALL, 10 );
200  bSizer->Add( fgSizer1, 7, wxEXPAND|wxALL, 10 ); // adjust width of panel with first int value
201  m_scrolledWindow1->SetSizer( bSizer );
202  m_scrolledWindow1->Layout();
203  bSizer->Fit( m_scrolledWindow1 );
204  aParent->AddPage( m_scrolledWindow1, aCaption, false, aIcon );
205 }
206 
207 
208 void DIALOG_ABOUT::createNotebookPageByCategory(wxAuiNotebook* aParent, const wxString& aCaption,
209  const wxBitmap& aIcon,
210  const CONTRIBUTORS& aContributors)
211 {
212  wxBoxSizer* bSizer = new wxBoxSizer( wxHORIZONTAL );
213 
214  wxScrolledWindow* m_scrolledWindow1 = new wxScrolledWindow( aParent, wxID_ANY,
215  wxDefaultPosition,
216  wxDefaultSize,
217  wxHSCROLL|wxVSCROLL );
218  m_scrolledWindow1->SetScrollRate( 5, 5 );
219 
220  /* Panel for additional space at the left,
221  * but can also be used to show an additional bitmap.
222  */
223  wxPanel* panel1 = new wxPanel( m_scrolledWindow1 );
224 
225  wxFlexGridSizer* fgSizer1 = createFlexGridSizer();
226 
227  for( size_t i=0; i < aContributors.GetCount(); ++i )
228  {
229  CONTRIBUTOR* contributor = &aContributors.Item( i );
230 
231  wxBitmap* icon = contributor->GetIcon();
232  wxString category = contributor->GetCategory();
233 
234  /* to construct the next row we expect to have
235  * a category and a contributor that was not considered up to now
236  */
237  if( ( category != wxEmptyString ) && !( contributor->IsChecked() ) )
238  {
239  // Icon at first column
240  wxStaticBitmap* m_bitmap1 = createStaticBitmap( m_scrolledWindow1, icon );
241  fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
242 
243  // Category name at second column
244  wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
245  contributor->GetCategory() + wxT( ":" ),
246  wxDefaultPosition, wxDefaultSize, 0 );
247  m_staticText1->SetFont( wxFont( -1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
248  wxFONTWEIGHT_BOLD, false,
249  wxEmptyString ) ); // bold font
250  m_staticText1->Wrap( -1 );
251  fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
252 
253  // Nothing at third column
254  fgSizer1->AddSpacer( 5 );
255 
256  // Now, all contributors of the same category will follow
257  for( size_t j=0; j < aContributors.GetCount(); ++j )
258  {
259  CONTRIBUTOR* sub_contributor = &aContributors.Item( j );
260 
261  if ( sub_contributor->GetCategory() == category )
262  {
263  // First column is empty
264  fgSizer1->AddSpacer(5);
265 
266  wxControl* ctrl;
267 
268  // No URL supplied, display normal text control
269  if( sub_contributor->GetUrl().IsEmpty() )
270  {
271  ctrl = new wxStaticText( m_scrolledWindow1, wxID_ANY,
272  wxT( " • " ) + sub_contributor->GetName(),
273  wxDefaultPosition,
274  wxDefaultSize, 0 );
275  }
276  else
277  {
278  // Display a hyperlink control instead
279  ctrl = new wxHyperlinkCtrl( m_scrolledWindow1, wxID_ANY,
280  wxT( "• " ) + sub_contributor->GetName(),
281  sub_contributor->GetUrl(),
282  wxDefaultPosition,
283  wxDefaultSize, wxHL_ALIGN_LEFT );
284  }
285 
286  m_staticText1->Wrap( -1 );
287 
288  fgSizer1->Add( ctrl, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
289 
290  // Email address of contributor at third column
291  if( sub_contributor->GetEMail() != wxEmptyString )
292  {
293  wxStaticText* mail = wxStaticTextMail( m_scrolledWindow1,
294  sub_contributor->GetEMail() );
295  fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
296  }
297  else
298  {
299  fgSizer1->AddSpacer( 5 );
300  }
301 
302  /* this contributor was added to the GUI,
303  * thus can be ignored next time
304  */
305  sub_contributor->SetChecked( true );
306  }
307  }
308  }
309  else
310  {
311  continue;
312  }
313  }
314 
315  /* Now, lets list the remaining contributors that have not been considered
316  * because they were not assigned to any category.
317  */
318  for ( size_t k=0; k < aContributors.GetCount(); ++k )
319  {
320  CONTRIBUTOR* contributor = &aContributors.Item( k );
321 
322  if ( contributor->IsChecked() )
323  continue;
324 
325  // Icon at first column
326  wxStaticBitmap* m_bitmap1 = createStaticBitmap( m_scrolledWindow1, contributor->GetIcon() );
327  fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
328 
329  // Name of contributor at second column
330  if( contributor->GetName() != wxEmptyString )
331  {
332  wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
333  contributor->GetName(),
334  wxDefaultPosition, wxDefaultSize, 0 );
335  m_staticText1->Wrap( -1 );
336  fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
337  }
338  else
339  {
340  fgSizer1->AddSpacer( 5 );
341  }
342 
343  // Email address of contributor at third column
344  if ( contributor->GetEMail() != wxEmptyString )
345  {
346  wxStaticText* mail = wxStaticTextMail( m_scrolledWindow1,
347  contributor->GetEMail() );
348  fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
349  }
350  else
351  {
352  fgSizer1->AddSpacer( 5 );
353  }
354  }
355 
356  bSizer->Add( panel1, 1, wxEXPAND|wxALL, 10 );
357  bSizer->Add( fgSizer1, 7, wxEXPAND|wxALL, 10 ); // adjust width of panel with first int value
358  m_scrolledWindow1->SetSizer( bSizer );
359  m_scrolledWindow1->Layout();
360  bSizer->Fit( m_scrolledWindow1 );
361  aParent->AddPage( m_scrolledWindow1, aCaption, false, aIcon );
362 }
363 
364 
365 void DIALOG_ABOUT::createNotebookHtmlPage( wxAuiNotebook* aParent, const wxString& aCaption,
366  const wxBitmap& aIcon, const wxString& html )
367 {
368  wxPanel* panel = new wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
369  wxTAB_TRAVERSAL );
370 
371  wxBoxSizer* bSizer = new wxBoxSizer( wxVERTICAL );
372 
373  wxString htmlPage = wxEmptyString, htmlContent = html;
374 
375  // to have a unique look background color for HTML pages is set to the default as it is
376  // used for all the other widgets
377  wxString htmlColor = ( this->GetBackgroundColour() ).GetAsString( wxC2S_HTML_SYNTAX );
378 
379  // beginning of HTML structure
380  htmlPage.Append( wxT( "<html><body bgcolor='" ) + htmlColor + wxT( "'>" ) );
381 
382  htmlPage.Append( htmlContent );
383 
384  // end of HTML structure indicated by closing tags
385  htmlPage.Append( wxT( "</body></html>" ) );
386 
387  // the HTML page is going to be created with previously created HTML content
388  wxHtmlWindow* htmlWindow = new wxHtmlWindow( panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
389  wxHW_SCROLLBAR_AUTO|wxHW_NO_SELECTION );
390 
391  // HTML font set to font properties as they are used for widgets to have an unique look
392  // under different platforms with HTML
393  wxFont font = this->GetFont();
394  htmlWindow->SetStandardFonts( font.GetPointSize(), font.GetFaceName(), font.GetFaceName() );
395  htmlWindow->SetPage( htmlPage );
396 
397  // the HTML window shall not be used to open external links, thus this task is delegated
398  // to users default browser
399  htmlWindow->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED,
400  wxHtmlLinkEventHandler( DIALOG_ABOUT::onHtmlLinkClicked ), NULL, this );
401 
402  // no additional space around the HTML window as it is also the case by the other notebook pages
403  bSizer->Add( htmlWindow, 1, wxALL|wxEXPAND, 0 );
404  panel->SetSizer( bSizer );
405  panel->Layout();
406  bSizer->Fit( panel );
407  aParent->AddPage( panel, aCaption, false, aIcon );
408 }
409 
410 
411 wxStaticText* DIALOG_ABOUT::wxStaticTextMail(wxScrolledWindow* aParent, const wxString& aEmail)
412 {
413  wxStaticText* text = new wxStaticText( aParent, wxID_ANY,
414  wxT( "<" ) + aEmail + wxT( ">" ) );
415 
416  return text;
417 }
418 
419 
420 wxStaticBitmap* DIALOG_ABOUT::createStaticBitmap(wxScrolledWindow* aParent, wxBitmap* aIcon)
421 {
422  wxStaticBitmap* bitmap = new wxStaticBitmap( aParent, wxID_ANY, wxNullBitmap,
423  wxDefaultPosition, wxDefaultSize, 0 );
424 
425  if( aIcon )
426  {
427  bitmap->SetBitmap( *aIcon );
428  }
429  else
430  {
431  bitmap->SetBitmap( KiBitmap( right_xpm ) );
432  }
433 
434  return bitmap;
435 }
436 
437 
438 void DIALOG_ABOUT::onHtmlLinkClicked( wxHtmlLinkEvent& event )
439 {
440  ::wxLaunchDefaultBrowser( event.GetLinkInfo().GetHref() );
441 }
442 
443 
444 void DIALOG_ABOUT::buildVersionInfoData( wxString& aMsg, bool aFormatHtml )
445 {
446  // DO NOT translate information in the msg_version string
447 
448  wxString eol = aFormatHtml ? "<br>" : "\n";
449  wxString indent4 = aFormatHtml ? "&nbsp;&nbsp;&nbsp;&nbsp;" : " ";
450 
451  #define ON "ON" << eol
452  #define OFF "OFF" << eol
453 
454  wxPlatformInfo platform;
455  aMsg << "Application: " << m_titleName << eol;
456  aMsg << "Version: " << m_info.GetBuildVersion() << eol;
457  aMsg << "Libraries:" << eol;
458  aMsg << indent4 << wxGetLibraryVersionInfo().GetVersionString() << eol;
459 
460 #ifdef BUILD_GITHUB_PLUGIN
461  aMsg << indent4 << GetKicadCurlVersion() << eol;
462 #endif
463  aMsg << "Platform: " << wxGetOsDescription() << ", "
464  << platform.GetArchName() << ", "
465  << platform.GetEndiannessName() << ", "
466  << platform.GetPortIdName() << eol;
467 
468  aMsg << "Build Info:" << eol;
469  aMsg << indent4 << "wxWidgets: " << wxVERSION_NUM_DOT_STRING << " (";
470  aMsg << __WX_BO_UNICODE __WX_BO_STL __WX_BO_WXWIN_COMPAT_2_8 ")";
471 
472  // Get the GTK+ version where possible.
473 #ifdef __WXGTK__
474  int major, minor;
475 
476  major = wxPlatformInfo().Get().GetToolkitMajorVersion();
477  minor = wxPlatformInfo().Get().GetToolkitMinorVersion();
478  aMsg << " GTK+ " << major << "." << minor;
479 #endif
480 
481  aMsg << eol;
482 
483  aMsg << indent4 << "Boost: " << ( BOOST_VERSION / 100000 ) << wxT( "." )
484  << ( BOOST_VERSION / 100 % 1000 ) << wxT( "." )
485  << ( BOOST_VERSION % 100 ) << eol;
486 
487 #ifdef KICAD_USE_OCC
488  aMsg << indent4 << "OpenCASCADE Technology: " << OCC_VERSION_COMPLETE << eol;
489 #endif
490 
491 #ifdef KICAD_USE_OCE
492  aMsg << indent4 << "OpenCASCADE Community Edition: " << OCC_VERSION_COMPLETE << eol;
493 #endif
494 
495 #ifdef BUILD_GITHUB_PLUGIN
496  aMsg << indent4 << "Curl: " << GetCurlLibVersion() << eol;
497 #endif
498 
499  aMsg << indent4 << "Compiler: ";
500 #if defined(__clang__)
501  aMsg << "Clang " << __clang_major__ << "." << __clang_minor__ << "." << __clang_patchlevel__;
502 #elif defined(__GNUG__)
503  aMsg << "GCC " << __GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__;
504 #elif defined(_MSC_VER)
505  aMsg << "Visual C++ " << _MSC_VER;
506 #elif defined(__INTEL_COMPILER)
507  aMsg << "Intel C++ " << __INTEL_COMPILER;
508 #else
509  aMsg << "Other Compiler ";
510 #endif
511 
512 #if defined(__GXX_ABI_VERSION)
513  aMsg << " with C++ ABI " << __GXX_ABI_VERSION << eol;
514 #else
515  aMsg << " without C++ ABI";
516 #endif
517 
518  aMsg << eol;
519 
520  // Add build settings config (build options):
521  aMsg << "Build settings:" << eol;
522 
523  aMsg << indent4 << "KICAD_SCRIPTING=";
524 #ifdef KICAD_SCRIPTING
525  aMsg << ON;
526 #else
527  aMsg << OFF;
528 #endif
529 
530  aMsg << indent4 << "KICAD_SCRIPTING_MODULES=";
531 #ifdef KICAD_SCRIPTING_MODULES
532  aMsg << ON;
533 #else
534  aMsg << OFF;
535 #endif
536 
537  aMsg << indent4 << "KICAD_SCRIPTING_PYTHON3=";
538 #ifdef KICAD_SCRIPTING_PYTHON3
539  aMsg << ON;
540 #else
541  aMsg << OFF;
542 #endif
543 
544  aMsg << indent4 << "KICAD_SCRIPTING_WXPYTHON=";
545 #ifdef KICAD_SCRIPTING_WXPYTHON
546  aMsg << ON;
547 #else
548  aMsg << OFF;
549 #endif
550 
551  aMsg << indent4 << "KICAD_SCRIPTING_WXPYTHON_PHOENIX=";
552 #ifdef KICAD_SCRIPTING_WXPYTHON_PHOENIX
553  aMsg << ON;
554 #else
555  aMsg << OFF;
556 #endif
557 
558  aMsg << indent4 << "KICAD_SCRIPTING_ACTION_MENU=";
559 #ifdef KICAD_SCRIPTING_ACTION_MENU
560  aMsg << ON;
561 #else
562  aMsg << OFF;
563 #endif
564 
565  aMsg << indent4 << "BUILD_GITHUB_PLUGIN=";
566 #ifdef BUILD_GITHUB_PLUGIN
567  aMsg << ON;
568 #else
569  aMsg << OFF;
570 #endif
571 
572  aMsg << indent4 << "KICAD_USE_OCE=";
573 #ifdef KICAD_USE_OCE
574  aMsg << ON;
575 #else
576  aMsg << OFF;
577 #endif
578 
579  aMsg << indent4 << "KICAD_USE_OCC=";
580 #ifdef KICAD_USE_OCC
581  aMsg << ON;
582 #else
583  aMsg << OFF;
584 #endif
585 
586  aMsg << indent4 << "KICAD_SPICE=";
587 #ifdef KICAD_SPICE
588  aMsg << ON;
589 #else
590  aMsg << OFF;
591 #endif
592 
593 #ifndef NDEBUG
594  aMsg << indent4 << "KICAD_STDLIB_DEBUG=";
595  #ifdef KICAD_STDLIB_DEBUG
596  aMsg << ON;
597  #else
598  aMsg << OFF;
599  aMsg << indent4 << "KICAD_STDLIB_LIGHT_DEBUG=";
600  #ifdef KICAD_STDLIB_LIGHT_DEBUG
601  aMsg << ON;
602  #else
603  aMsg << OFF;
604  #endif
605  #endif
606 
607  aMsg << indent4 << "KICAD_SANITIZE=";
608  #ifdef KICAD_SANITIZE
609  aMsg << ON;
610  #else
611  aMsg << OFF;
612  #endif
613 #endif
614 }
615 
616 
617 void DIALOG_ABOUT::onShowVersionInfo( wxCommandEvent& event )
618 {
619  wxString msg_version;
620  buildVersionInfoData( msg_version, true );
621 
622  HTML_MESSAGE_BOX dlg( this, _( "Version Info" ));
623  dlg.SetDialogSizeInDU( 400, 350 );
624 
625  dlg.AddHTML_Text( msg_version );
626  dlg.ShowModal();
627 }
628 
629 
630 void DIALOG_ABOUT::onCopyVersionInfo( wxCommandEvent& event )
631 {
632  if( !wxTheClipboard->Open() )
633  {
634  wxMessageBox( _( "Could not open clipboard to write version information." ),
635  _( "Clipboard Error" ), wxOK | wxICON_EXCLAMATION, this );
636  return;
637  }
638 
639  wxString msg_version;
640  buildVersionInfoData( msg_version, false );
641 
642  wxTheClipboard->SetData( new wxTextDataObject( msg_version ) );
643  wxTheClipboard->Close();
644  m_btCopyVersionInfo->SetLabel( _( "Copied..." ) );
645 }
wxFlexGridSizer * createFlexGridSizer()
wxAuiNotebook * m_auiNotebook
wxBitmap m_picDevelopers
Definition: dialog_about.h:46
wxString & GetUrl()
Definition: aboutinfo.h:169
CONTRIBUTORS GetTranslators()
Definition: aboutinfo.h:83
wxString & GetLibVersion()
Definition: aboutinfo.h:102
DIALOG_ABOUT(EDA_BASE_FRAME *aParent, ABOUT_APP_INFO &aAppInfo)
wxStaticText * m_staticTextAppTitle
void SetChecked(bool status)
Definition: aboutinfo.h:172
wxString & GetCategory()
Definition: aboutinfo.h:170
wxString & GetName()
Definition: aboutinfo.h:167
void createNotebookPageByCategory(wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const CONTRIBUTORS &aContributors)
wxBitmap m_picPackagers
Definition: dialog_about.h:50
#define OFF
void createNotebooks()
wxString & GetBuildVersion()
Definition: aboutinfo.h:99
wxStaticText * m_staticTextLibVersion
wxIcon & GetAppIcon()
Definition: aboutinfo.h:105
An object of this class is meant to be used to store application specific information like who has co...
Definition: aboutinfo.h:44
wxStaticBitmap * m_bitmapApp
wxString & GetLicense()
Definition: aboutinfo.h:90
void buildVersionInfoData(wxString &aMsg, bool aFormatHtml)
build the version info message
wxStaticText * wxStaticTextMail(wxScrolledWindow *aParent, const wxString &email)
wxBitmap m_picDocWriters
Definition: dialog_about.h:47
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
wxBitmap m_picArtists
Definition: dialog_about.h:48
CONTRIBUTORS GetDocWriters()
Definition: aboutinfo.h:81
wxStaticText * m_staticTextBuildVersion
virtual void onCopyVersionInfo(wxCommandEvent &event) override
void onHtmlLinkClicked(wxHtmlLinkEvent &event)
CONTRIBUTORS GetArtists()
Definition: aboutinfo.h:82
wxBitmap m_picTranslators
Definition: dialog_about.h:49
Subclass of DIALOG_DISPLAY_HTML_TEXT_BASE, which is generated by wxFormBuilder.
std::string GetKicadCurlVersion()
Definition: kicad_curl.cpp:241
void createNotebookHtmlPage(wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const wxString &aHtmlMessage)
wxString GetCopyright()
Definition: aboutinfo.h:93
wxStaticText * m_staticTextCopyright
wxBitmap m_picInformation
Definition: dialog_about.h:45
Class HTML_MESSAGE_BOX.
wxBitmap m_picLicense
Definition: dialog_about.h:51
std::string GetCurlLibVersion()
Definition: kicad_curl.cpp:246
#define _(s)
wxString & GetEMail()
Definition: aboutinfo.h:168
wxStaticBitmap * createStaticBitmap(wxScrolledWindow *aParent, wxBitmap *icon)
void SetDialogSizeInDU(int aWidth, int aHeight)
set the dialog size, using a "logical value.
CONTRIBUTORS GetPackagers()
Definition: aboutinfo.h:84
wxBitmap * GetIcon()
Definition: aboutinfo.h:171
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
CONTRIBUTORS GetDevelopers()
Definition: aboutinfo.h:80
Class DIALOG_ABOUT_BASE.
const wxString & GetAboutTitle() const
void AddHTML_Text(const wxString &message)
Function AddHTML_Text adds html text (without any change) to message list.
A contributor, a person which was involved in the development of the application or which has contrib...
Definition: aboutinfo.h:148
The base frame for deriving all KiCad main window classes.
wxString m_titleName
Definition: dialog_about.h:52
size_t i
Definition: json11.cpp:597
virtual void onShowVersionInfo(wxCommandEvent &event) override
wxString & GetDescription()
Definition: aboutinfo.h:87
wxButton * m_btCopyVersionInfo
#define ON
bool IsChecked()
Definition: aboutinfo.h:173
ABOUT_APP_INFO & m_info
Definition: dialog_about.h:54
void createNotebookPage(wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const CONTRIBUTORS &aContributors)