KiCad PCB EDA Suite
dialog_about Class Reference

About dialog to show application specific information. More...

#include <dialog_about.h>

Inheritance diagram for dialog_about:
dialog_about_base

Public Member Functions

 dialog_about (wxWindow *dlg, AboutAppInfo &appInfo)
 
 ~dialog_about ()
 

Protected Attributes

wxStaticBitmap * m_bitmapApp
 
wxStaticText * m_staticTextAppTitle
 
wxStaticText * m_staticTextCopyright
 
wxStaticText * m_staticTextBuildVersion
 
wxStaticText * m_staticTextLibVersion
 
wxAuiNotebook * m_auiNotebook
 
wxButton * copyVersionInfo
 
wxButton * ok
 

Private Member Functions

void initDialog ()
 
virtual void OnClose (wxCloseEvent &event)
 Event handlers. More...
 
virtual void OnOkClick (wxCommandEvent &event)
 
virtual void OnHtmlLinkClicked (wxHtmlLinkEvent &event)
 
virtual void OnCopyVersionInfo (wxCommandEvent &event)
 
wxFlexGridSizer * CreateFlexGridSizer ()
 
void DeleteNotebooks ()
 
void CreateNotebooks ()
 
void CreateNotebookPage (wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const Contributors &aContributors)
 
void CreateNotebookPageByCategory (wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const Contributors &aContributors)
 
void CreateNotebookHtmlPage (wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const wxString &aHtmlMessage)
 
wxHyperlinkCtrl * CreateHyperlink (wxScrolledWindow *aParent, const wxString &email)
 
wxStaticBitmap * CreateStaticBitmap (wxScrolledWindow *aParent, wxBitmap *icon)
 

Private Attributes

wxBitmap picInformation
 
wxBitmap picDevelopers
 
wxBitmap picDocWriters
 
wxBitmap picArtists
 
wxBitmap picTranslators
 
wxBitmap picPackagers
 
wxBitmap picLicense
 
AboutAppInfo info
 

Detailed Description

About dialog to show application specific information.

Needs an AboutAppInfo object that contains the data to be displayed.

Definition at line 40 of file dialog_about.h.

Constructor & Destructor Documentation

dialog_about::dialog_about ( wxWindow *  dlg,
AboutAppInfo appInfo 
)

Definition at line 60 of file dialog_about.cpp.

References CreateNotebooks(), DeleteNotebooks(), AboutAppInfo::GetAppName(), AboutAppInfo::GetBuildVersion(), AboutAppInfo::GetCopyright(), AboutAppInfo::GetIcon(), AboutAppInfo::GetLibVersion(), info, KiBitmap(), dialog_about_base::m_auiNotebook, dialog_about_base::m_bitmapApp, dialog_about_base::m_staticTextAppTitle, dialog_about_base::m_staticTextBuildVersion, dialog_about_base::m_staticTextCopyright, dialog_about_base::m_staticTextLibVersion, OnCopyVersionInfo(), picArtists, picDevelopers, picDocWriters, picInformation, picLicense, picPackagers, and picTranslators.

61  : dialog_about_base(aParent), info(appInfo)
62 {
63  picInformation = KiBitmap( info_xpm );
64  picDevelopers = KiBitmap( preference_xpm );
65  picDocWriters = KiBitmap( editor_xpm );
66  picArtists = KiBitmap( palette_xpm );
67  picTranslators = KiBitmap( language_xpm );
68  picLicense = KiBitmap( tools_xpm );
69  picPackagers = KiBitmap( zip_xpm );
70 
71  m_bitmapApp->SetBitmap( info.GetIcon() );
72 
73  m_staticTextAppTitle->SetLabel( info.GetAppName() );
75  m_staticTextBuildVersion->SetLabel( "Version: " + info.GetBuildVersion() );
77 
80 
81  GetSizer()->SetSizeHints( this );
82  m_auiNotebook->Update();
83  SetFocus();
84  Centre();
85 
86  Connect( wxID_COPY, wxEVT_COMMAND_BUTTON_CLICKED,
87  wxCommandEventHandler( dialog_about::OnCopyVersionInfo ) );
88 }
wxStaticText * m_staticTextBuildVersion
wxBitmap picDocWriters
Definition: dialog_about.h:47
wxAuiNotebook * m_auiNotebook
wxBitmap picPackagers
Definition: dialog_about.h:50
wxBitmap picDevelopers
Definition: dialog_about.h:46
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
void CreateNotebooks()
wxStaticText * m_staticTextLibVersion
wxIcon & GetIcon()
Definition: aboutinfo.h:114
dialog_about_base(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("About"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(750, 471), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void DeleteNotebooks()
wxBitmap picTranslators
Definition: dialog_about.h:49
wxStaticBitmap * m_bitmapApp
wxString GetCopyright()
Definition: aboutinfo.h:91
wxString & GetBuildVersion()
Definition: aboutinfo.h:108
wxStaticText * m_staticTextAppTitle
wxStaticText * m_staticTextCopyright
wxString & GetLibVersion()
Definition: aboutinfo.h:111
wxString & GetAppName()
Definition: aboutinfo.h:105
virtual void OnCopyVersionInfo(wxCommandEvent &event)
wxBitmap picArtists
Definition: dialog_about.h:48
AboutAppInfo info
Definition: dialog_about.h:53
wxBitmap picLicense
Definition: dialog_about.h:51
wxBitmap picInformation
Definition: dialog_about.h:45
dialog_about::~dialog_about ( )

Definition at line 91 of file dialog_about.cpp.

92 {
93 }

Member Function Documentation

wxFlexGridSizer * dialog_about::CreateFlexGridSizer ( )
private

Definition at line 96 of file dialog_about.cpp.

Referenced by CreateNotebookPage(), and CreateNotebookPageByCategory().

97 {
98  // three columns with vertical and horizontal extra space of two pixels
99  wxFlexGridSizer* fgSizer1 = new wxFlexGridSizer( 3, 2, 2 );
100  fgSizer1->SetFlexibleDirection( wxHORIZONTAL );
101  fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
102 
103  return fgSizer1;
104 }
wxHyperlinkCtrl * dialog_about::CreateHyperlink ( wxScrolledWindow *  aParent,
const wxString &  email 
)
private

Definition at line 379 of file dialog_about.cpp.

References AboutAppInfo::GetBuildVersion(), AboutAppInfo::GetLibVersion(), and info.

Referenced by CreateNotebookPage(), and CreateNotebookPageByCategory().

380 {
381  wxHyperlinkCtrl* hyperlink = new wxHyperlinkCtrl(
382  aParent, wxID_ANY,
383  wxT( "<" ) + email + wxT( ">" ), /* the label */
384  wxT( "mailto:" ) + email
385  + wxT( "?subject=KiCad - " )
387  + wxT( " , " ) + info.GetLibVersion()
388  ); /* the url */
389 
390  return hyperlink;
391 }
wxString & GetBuildVersion()
Definition: aboutinfo.h:108
wxString & GetLibVersion()
Definition: aboutinfo.h:111
AboutAppInfo info
Definition: dialog_about.h:53
void dialog_about::CreateNotebookHtmlPage ( wxAuiNotebook *  aParent,
const wxString &  aCaption,
const wxBitmap &  aIcon,
const wxString &  aHtmlMessage 
)
private

Definition at line 333 of file dialog_about.cpp.

References OnHtmlLinkClicked().

Referenced by CreateNotebooks().

335 {
336  wxPanel* panel = new wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
337  wxTAB_TRAVERSAL );
338 
339  wxBoxSizer* bSizer = new wxBoxSizer( wxVERTICAL );
340 
341  wxString htmlPage = wxEmptyString, htmlContent = html;
342 
343  // to have a unique look background color for HTML pages is set to the default as it is
344  // used for all the other widgets
345  wxString htmlColor = ( this->GetBackgroundColour() ).GetAsString( wxC2S_HTML_SYNTAX );
346 
347  // beginning of HTML structure
348  htmlPage.Append( wxT( "<html><body bgcolor='" ) + htmlColor + wxT( "'>" ) );
349 
350  htmlPage.Append( htmlContent );
351 
352  // end of HTML structure indicated by closing tags
353  htmlPage.Append( wxT( "</body></html>" ) );
354 
355  // the HTML page is going to be created with previously created HTML content
356  wxHtmlWindow* htmlWindow = new wxHtmlWindow( panel, wxID_ANY, wxDefaultPosition, wxDefaultSize,
357  wxHW_SCROLLBAR_AUTO|wxHW_NO_SELECTION );
358 
359  // HTML font set to font properties as they are used for widgets to have an unique look
360  // under different platforms with HTML
361  wxFont font = this->GetFont();
362  htmlWindow->SetStandardFonts( font.GetPointSize(), font.GetFaceName(), font.GetFaceName() );
363  htmlWindow->SetPage( htmlPage );
364 
365  // the HTML window shall not be used to open external links, thus this task is delegated
366  // to users default browser
367  htmlWindow->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED,
368  wxHtmlLinkEventHandler( dialog_about::OnHtmlLinkClicked ), NULL, this );
369 
370  // no additional space around the HTML window as it is also the case by the other notebook pages
371  bSizer->Add( htmlWindow, 1, wxALL|wxEXPAND, 0 );
372  panel->SetSizer( bSizer );
373  panel->Layout();
374  bSizer->Fit( panel );
375  aParent->AddPage( panel, aCaption, false, aIcon );
376 }
virtual void OnHtmlLinkClicked(wxHtmlLinkEvent &event)
void dialog_about::CreateNotebookPage ( wxAuiNotebook *  aParent,
const wxString &  aCaption,
const wxBitmap &  aIcon,
const Contributors &  aContributors 
)
private

Definition at line 131 of file dialog_about.cpp.

References CreateFlexGridSizer(), CreateHyperlink(), CreateStaticBitmap(), Contributor::GetEMail(), Contributor::GetIcon(), and Contributor::GetName().

Referenced by CreateNotebooks().

133 {
134  wxBoxSizer* bSizer = new wxBoxSizer( wxHORIZONTAL );
135 
136  wxScrolledWindow* m_scrolledWindow1 = new wxScrolledWindow( aParent, wxID_ANY,
137  wxDefaultPosition,
138  wxDefaultSize,
139  wxHSCROLL|wxVSCROLL );
140  m_scrolledWindow1->SetScrollRate( 5, 5 );
141 
142  /* Panel for additional space at the left,
143  * but can also be used to show an additional bitmap.
144  */
145  wxPanel* panel1 = new wxPanel( m_scrolledWindow1 );
146 
147  wxFlexGridSizer* fgSizer1 = CreateFlexGridSizer();
148 
149  for( size_t i=0; i<aContributors.GetCount(); ++i )
150  {
151  Contributor* contributor = &aContributors.Item( i );
152 
153  // Icon at first column
154  wxStaticBitmap* m_bitmap1 = CreateStaticBitmap( m_scrolledWindow1, contributor->GetIcon() );
155  fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
156 
157  // Name of contributor at second column
158  if ( contributor->GetName() != wxEmptyString )
159  {
160  wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
161  contributor->GetName(),
162  wxDefaultPosition, wxDefaultSize, 0 );
163  m_staticText1->Wrap( -1 );
164  fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
165  }
166  else
167  {
168  fgSizer1->AddSpacer( 5 );
169  }
170 
171  // Email address of contributor at third column
172  if ( contributor->GetEMail() != wxEmptyString )
173  {
174  wxHyperlinkCtrl* hyperlink = CreateHyperlink( m_scrolledWindow1,
175  contributor->GetEMail() );
176  fgSizer1->Add( hyperlink, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
177  }
178  else
179  {
180  fgSizer1->AddSpacer( 5 );
181  }
182  }
183 
184  bSizer->Add( panel1, 1, wxEXPAND|wxALL, 10 );
185  bSizer->Add( fgSizer1, 7, wxEXPAND|wxALL, 10 ); // adjust width of panel with first int value
186  m_scrolledWindow1->SetSizer( bSizer );
187  m_scrolledWindow1->Layout();
188  bSizer->Fit( m_scrolledWindow1 );
189  aParent->AddPage( m_scrolledWindow1, aCaption, false, aIcon );
190 }
wxString & GetName()
Definition: aboutinfo.h:159
wxBitmap * GetIcon()
Definition: aboutinfo.h:162
wxHyperlinkCtrl * CreateHyperlink(wxScrolledWindow *aParent, const wxString &email)
A contributor, a person which was involved in the development of the application or which has contrib...
Definition: aboutinfo.h:147
wxFlexGridSizer * CreateFlexGridSizer()
wxStaticBitmap * CreateStaticBitmap(wxScrolledWindow *aParent, wxBitmap *icon)
wxString & GetEMail()
Definition: aboutinfo.h:160
void dialog_about::CreateNotebookPageByCategory ( wxAuiNotebook *  aParent,
const wxString &  aCaption,
const wxBitmap &  aIcon,
const Contributors &  aContributors 
)
private

Definition at line 193 of file dialog_about.cpp.

References CreateFlexGridSizer(), CreateHyperlink(), CreateStaticBitmap(), Contributor::GetCategory(), Contributor::GetEMail(), Contributor::GetIcon(), Contributor::GetName(), Contributor::IsChecked(), and Contributor::SetChecked().

Referenced by CreateNotebooks().

196 {
197  wxBoxSizer* bSizer = new wxBoxSizer( wxHORIZONTAL );
198 
199  wxScrolledWindow* m_scrolledWindow1 = new wxScrolledWindow( aParent, wxID_ANY,
200  wxDefaultPosition,
201  wxDefaultSize,
202  wxHSCROLL|wxVSCROLL );
203  m_scrolledWindow1->SetScrollRate( 5, 5 );
204 
205  /* Panel for additional space at the left,
206  * but can also be used to show an additional bitmap.
207  */
208  wxPanel* panel1 = new wxPanel( m_scrolledWindow1 );
209 
210  wxFlexGridSizer* fgSizer1 = CreateFlexGridSizer();
211 
212  for( size_t i=0; i < aContributors.GetCount(); ++i )
213  {
214  Contributor* contributor = &aContributors.Item( i );
215 
216  wxBitmap* icon = contributor->GetIcon();
217  wxString category = contributor->GetCategory();
218 
219  /* to construct the next row we expect to have
220  * a category and a contributor that was not considered up to now
221  */
222  if( ( category != wxEmptyString ) && !( contributor->IsChecked() ) )
223  {
224  // Icon at first column
225  wxStaticBitmap* m_bitmap1 = CreateStaticBitmap( m_scrolledWindow1, icon );
226  fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
227 
228  // Category name at second column
229  wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
230  contributor->GetCategory() + wxT( ":" ),
231  wxDefaultPosition, wxDefaultSize, 0 );
232  m_staticText1->SetFont( wxFont( -1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false,
233  wxEmptyString ) ); // bold font
234  m_staticText1->Wrap( -1 );
235  fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
236 
237  // Nothing at third column
238  fgSizer1->AddSpacer( 5 );
239 
240  // Now, all contributors of the same category will follow
241  for( size_t j=0; j < aContributors.GetCount(); ++j )
242  {
243  Contributor* sub_contributor = &aContributors.Item( j );
244 
245  if ( sub_contributor->GetCategory() == category )
246  {
247  // First column is empty
248  fgSizer1->AddSpacer(5);
249 
250  // Name of contributor at second column
251  wxStaticText* m_staticText2 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
252  wxT(" • ") + sub_contributor->GetName(),
253  wxDefaultPosition,
254  wxDefaultSize, 0 );
255  m_staticText1->Wrap( -1 );
256  fgSizer1->Add( m_staticText2, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
257 
258  // Email address of contributor at third column
259  if( sub_contributor->GetEMail() != wxEmptyString )
260  {
261  wxHyperlinkCtrl* hyperlink = CreateHyperlink( m_scrolledWindow1,
262  sub_contributor->GetEMail() );
263  fgSizer1->Add( hyperlink, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
264  }
265  else
266  {
267  fgSizer1->AddSpacer( 5 );
268  }
269 
270  /* this contributor was added to the GUI,
271  * thus can be ignored next time
272  */
273  sub_contributor->SetChecked( true );
274  }
275  }
276  }
277  else
278  {
279  continue;
280  }
281  }
282 
283  /* Now, lets list the remaining contributors that have not been considered
284  * because they were not assigned to any category.
285  */
286  for ( size_t k=0; k < aContributors.GetCount(); ++k )
287  {
288  Contributor* contributor = &aContributors.Item( k );
289 
290  if ( contributor->IsChecked() )
291  continue;
292 
293  // Icon at first column
294  wxStaticBitmap* m_bitmap1 = CreateStaticBitmap( m_scrolledWindow1, contributor->GetIcon() );
295  fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
296 
297  // Name of contributor at second column
298  if( contributor->GetName() != wxEmptyString )
299  {
300  wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
301  contributor->GetName(),
302  wxDefaultPosition, wxDefaultSize, 0 );
303  m_staticText1->Wrap( -1 );
304  fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
305  }
306  else
307  {
308  fgSizer1->AddSpacer( 5 );
309  }
310 
311  // Email address of contributor at third column
312  if ( contributor->GetEMail() != wxEmptyString )
313  {
314  wxHyperlinkCtrl* hyperlink = CreateHyperlink( m_scrolledWindow1,
315  contributor->GetEMail() );
316  fgSizer1->Add( hyperlink, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
317  }
318  else
319  {
320  fgSizer1->AddSpacer( 5 );
321  }
322  }
323 
324  bSizer->Add( panel1, 1, wxEXPAND|wxALL, 10 );
325  bSizer->Add( fgSizer1, 7, wxEXPAND|wxALL, 10 ); // adjust width of panel with first int value
326  m_scrolledWindow1->SetSizer( bSizer );
327  m_scrolledWindow1->Layout();
328  bSizer->Fit( m_scrolledWindow1 );
329  aParent->AddPage( m_scrolledWindow1, aCaption, false, aIcon );
330 }
wxString & GetName()
Definition: aboutinfo.h:159
bool IsChecked()
Definition: aboutinfo.h:164
wxBitmap * GetIcon()
Definition: aboutinfo.h:162
wxHyperlinkCtrl * CreateHyperlink(wxScrolledWindow *aParent, const wxString &email)
wxString & GetCategory()
Definition: aboutinfo.h:161
A contributor, a person which was involved in the development of the application or which has contrib...
Definition: aboutinfo.h:147
wxFlexGridSizer * CreateFlexGridSizer()
void SetChecked(bool status)
Definition: aboutinfo.h:163
wxStaticBitmap * CreateStaticBitmap(wxScrolledWindow *aParent, wxBitmap *icon)
wxString & GetEMail()
Definition: aboutinfo.h:160
void dialog_about::CreateNotebooks ( )
private

Definition at line 114 of file dialog_about.cpp.

References CreateNotebookHtmlPage(), CreateNotebookPage(), CreateNotebookPageByCategory(), AboutAppInfo::GetArtists(), AboutAppInfo::GetDescription(), AboutAppInfo::GetDevelopers(), AboutAppInfo::GetDocWriters(), AboutAppInfo::GetLicense(), AboutAppInfo::GetPackagers(), AboutAppInfo::GetTranslators(), info, dialog_about_base::m_auiNotebook, picArtists, picDevelopers, picDocWriters, picInformation, picLicense, picPackagers, and picTranslators.

Referenced by dialog_about().

115 {
117  info.GetDescription() );
118 
121 
124  info.GetTranslators() );
126  info.GetPackagers() );
127 
129 }
wxBitmap picDocWriters
Definition: dialog_about.h:47
wxAuiNotebook * m_auiNotebook
wxBitmap picPackagers
Definition: dialog_about.h:50
wxBitmap picDevelopers
Definition: dialog_about.h:46
wxString & GetDescription()
Definition: aboutinfo.h:85
Contributors GetDevelopers()
Definition: aboutinfo.h:78
wxString & GetLicense()
Definition: aboutinfo.h:88
wxBitmap picTranslators
Definition: dialog_about.h:49
void CreateNotebookPage(wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const Contributors &aContributors)
void CreateNotebookHtmlPage(wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const wxString &aHtmlMessage)
Contributors GetTranslators()
Definition: aboutinfo.h:81
Contributors GetPackagers()
Definition: aboutinfo.h:82
Contributors GetDocWriters()
Definition: aboutinfo.h:79
Contributors GetArtists()
Definition: aboutinfo.h:80
void CreateNotebookPageByCategory(wxAuiNotebook *aParent, const wxString &aCaption, const wxBitmap &aIcon, const Contributors &aContributors)
wxBitmap picArtists
Definition: dialog_about.h:48
AboutAppInfo info
Definition: dialog_about.h:53
wxBitmap picLicense
Definition: dialog_about.h:51
wxBitmap picInformation
Definition: dialog_about.h:45
wxStaticBitmap * dialog_about::CreateStaticBitmap ( wxScrolledWindow *  aParent,
wxBitmap *  icon 
)
private

Definition at line 394 of file dialog_about.cpp.

References KiBitmap().

Referenced by CreateNotebookPage(), and CreateNotebookPageByCategory().

395 {
396  wxStaticBitmap* bitmap = new wxStaticBitmap( aParent, wxID_ANY, wxNullBitmap,
397  wxDefaultPosition, wxDefaultSize, 0 );
398 
399  if( aIcon )
400  {
401  bitmap->SetBitmap( *aIcon );
402  }
403  else
404  {
405  bitmap->SetBitmap( KiBitmap( right_xpm ) );
406  }
407 
408  return bitmap;
409 }
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
void dialog_about::DeleteNotebooks ( )
private

Definition at line 107 of file dialog_about.cpp.

References dialog_about_base::m_auiNotebook.

Referenced by dialog_about().

108 {
109  for( size_t i=0; i<m_auiNotebook->GetPageCount(); ++i )
110  m_auiNotebook->DeletePage( i );
111 }
wxAuiNotebook * m_auiNotebook
void dialog_about::initDialog ( )
private
void dialog_about::OnClose ( wxCloseEvent &  event)
privatevirtual

Event handlers.

Definition at line 416 of file dialog_about.cpp.

417 {
418  Destroy();
419 }
void dialog_about::OnCopyVersionInfo ( wxCommandEvent &  event)
privatevirtual

Definition at line 433 of file dialog_about.cpp.

References dialog_about_base::copyVersionInfo, AboutAppInfo::GetAppName(), AboutAppInfo::GetBuildVersion(), KICAD_CURL::GetVersion(), info, OFF, and ON.

Referenced by dialog_about().

434 {
435  if( !wxTheClipboard->Open() )
436  {
437  wxMessageBox( _( "Could not open clipboard to write version information." ),
438  _( "Clipboard Error" ), wxOK | wxICON_EXCLAMATION, this );
439  return;
440  }
441 
442  wxPlatformInfo platform;
443 
444  // DO NOT translate information in the msg_version string
445  wxString msg_version;
446  msg_version << "Application: " << info.GetAppName() << "\n";
447  msg_version << "Version: " << info.GetBuildVersion() << "\n";
448  msg_version << "Libraries: " << wxGetLibraryVersionInfo().GetVersionString() << "\n";
449 #ifdef BUILD_GITHUB_PLUGIN
450  msg_version << " " << KICAD_CURL::GetVersion() << "\n";
451 #endif
452  msg_version << "Platform: " << wxGetOsDescription() << ", "
453  << platform.GetArchName() << ", "
454  << platform.GetEndiannessName() << ", "
455  << platform.GetPortIdName() << "\n";
456 
457  msg_version << "- Build Info -\n";
458  msg_version << "wxWidgets: " << wxVERSION_NUM_DOT_STRING << " (";
459  msg_version << __WX_BO_UNICODE __WX_BO_STL __WX_BO_WXWIN_COMPAT_2_8 ")\n";
460 
461  msg_version << "Boost: " << ( BOOST_VERSION / 100000 ) << wxT( "." )
462  << ( BOOST_VERSION / 100 % 1000 ) << wxT( "." )
463  << ( BOOST_VERSION % 100 ) << wxT( "\n" );
464 
465 #ifdef BUILD_GITHUB_PLUGIN
466  msg_version << "Curl: " << LIBCURL_VERSION << "\n";
467 #endif
468 
469  msg_version << "KiCad - Compiler: ";
470 #if defined(__clang__)
471  msg_version << "Clang " << __clang_major__ << "." << __clang_minor__ << "." << __clang_patchlevel__;
472 #elif defined(__GNUG__)
473  msg_version << "GCC " << __GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__;
474 #elif defined(_MSC_VER)
475  msg_version << "Visual C++ " << _MSC_VER;
476 #elif defined(__INTEL_COMPILER)
477  msg_version << "Intel C++ " << __INTEL_COMPILER;
478 #else
479  msg_version << "Other Compiler ";
480 #endif
481 
482 #if defined(__GXX_ABI_VERSION)
483  msg_version << " with C++ ABI " << __GXX_ABI_VERSION << "\n";
484 #else
485  msg_version << " without C++ ABI\n";
486 #endif
487 
488  msg_version << " Settings: ";
489 
490  #define ON "ON\n"
491  #define OFF "OFF\n"
492 
493  msg_version << "USE_WX_GRAPHICS_CONTEXT=";
494 #ifdef USE_WX_GRAPHICS_CONTEXT
495  msg_version << ON;
496 #else
497  msg_version << OFF;
498 #endif
499 
500  msg_version << " USE_WX_OVERLAY=";
501 #ifdef USE_WX_OVERLAY
502  msg_version << ON;
503 #else
504  msg_version << OFF;
505 #endif
506 
507  msg_version << " KICAD_SCRIPTING=";
508 #ifdef KICAD_SCRIPTING
509  msg_version << ON;
510 #else
511  msg_version << OFF;
512 #endif
513 
514  msg_version << " KICAD_SCRIPTING_MODULES=";
515 #ifdef KICAD_SCRIPTING_MODULES
516  msg_version << ON;
517 #else
518  msg_version << OFF;
519 #endif
520 
521  msg_version << " KICAD_SCRIPTING_WXPYTHON=";
522 #ifdef KICAD_SCRIPTING_WXPYTHON
523  msg_version << ON;
524 #else
525  msg_version << OFF;
526 #endif
527 
528  msg_version << " KICAD_SCRIPTING_ACTION_MENU=";
529 #ifdef KICAD_SCRIPTING_ACTION_MENU
530  msg_version << ON;
531 #else
532  msg_version << OFF;
533 #endif
534 
535  msg_version << " BUILD_GITHUB_PLUGIN=";
536 #ifdef BUILD_GITHUB_PLUGIN
537  msg_version << ON;
538 #else
539  msg_version << OFF;
540 #endif
541 
542  msg_version << " KICAD_USE_OCE=";
543 #ifdef KICAD_USE_OCE
544  msg_version << ON;
545 #else
546  msg_version << OFF;
547 #endif
548 
549  wxTheClipboard->SetData( new wxTextDataObject( msg_version ) );
550  wxTheClipboard->Close();
551  copyVersionInfo->SetLabel( _( "Copied..." ) );
552 }
wxButton * copyVersionInfo
#define OFF
wxString & GetBuildVersion()
Definition: aboutinfo.h:108
static const char * GetVersion()
Function GetVersion wrapper for curl_version().
Definition: kicad_curl.h:93
wxString & GetAppName()
Definition: aboutinfo.h:105
#define ON
AboutAppInfo info
Definition: dialog_about.h:53
void dialog_about::OnHtmlLinkClicked ( wxHtmlLinkEvent &  event)
privatevirtual

Definition at line 428 of file dialog_about.cpp.

Referenced by CreateNotebookHtmlPage().

429 {
430  ::wxLaunchDefaultBrowser( event.GetLinkInfo().GetHref() );
431 }
void dialog_about::OnOkClick ( wxCommandEvent &  event)
privatevirtual

Definition at line 422 of file dialog_about.cpp.

423 {
424  Destroy();
425 }

Member Data Documentation

wxButton* dialog_about_base::copyVersionInfo
protectedinherited

Definition at line 45 of file dialog_about_base.h.

Referenced by dialog_about_base::dialog_about_base(), and OnCopyVersionInfo().

AboutAppInfo dialog_about::info
private

Definition at line 53 of file dialog_about.h.

Referenced by CreateHyperlink(), CreateNotebooks(), dialog_about(), and OnCopyVersionInfo().

wxAuiNotebook* dialog_about_base::m_auiNotebook
protectedinherited
wxStaticBitmap* dialog_about_base::m_bitmapApp
protectedinherited

Definition at line 39 of file dialog_about_base.h.

Referenced by dialog_about(), and dialog_about_base::dialog_about_base().

wxStaticText* dialog_about_base::m_staticTextAppTitle
protectedinherited

Definition at line 40 of file dialog_about_base.h.

Referenced by dialog_about(), and dialog_about_base::dialog_about_base().

wxStaticText* dialog_about_base::m_staticTextBuildVersion
protectedinherited

Definition at line 42 of file dialog_about_base.h.

Referenced by dialog_about(), and dialog_about_base::dialog_about_base().

wxStaticText* dialog_about_base::m_staticTextCopyright
protectedinherited

Definition at line 41 of file dialog_about_base.h.

Referenced by dialog_about(), and dialog_about_base::dialog_about_base().

wxStaticText* dialog_about_base::m_staticTextLibVersion
protectedinherited

Definition at line 43 of file dialog_about_base.h.

Referenced by dialog_about(), and dialog_about_base::dialog_about_base().

wxButton* dialog_about_base::ok
protectedinherited

Definition at line 46 of file dialog_about_base.h.

Referenced by dialog_about_base::dialog_about_base().

wxBitmap dialog_about::picArtists
private

Definition at line 48 of file dialog_about.h.

Referenced by CreateNotebooks(), and dialog_about().

wxBitmap dialog_about::picDevelopers
private

Definition at line 46 of file dialog_about.h.

Referenced by CreateNotebooks(), and dialog_about().

wxBitmap dialog_about::picDocWriters
private

Definition at line 47 of file dialog_about.h.

Referenced by CreateNotebooks(), and dialog_about().

wxBitmap dialog_about::picInformation
private

Definition at line 45 of file dialog_about.h.

Referenced by CreateNotebooks(), and dialog_about().

wxBitmap dialog_about::picLicense
private

Definition at line 51 of file dialog_about.h.

Referenced by CreateNotebooks(), and dialog_about().

wxBitmap dialog_about::picPackagers
private

Definition at line 50 of file dialog_about.h.

Referenced by CreateNotebooks(), and dialog_about().

wxBitmap dialog_about::picTranslators
private

Definition at line 49 of file dialog_about.h.

Referenced by CreateNotebooks(), and dialog_about().


The documentation for this class was generated from the following files: