Refactor About dialog:

Code refactor
Fix coding style issues
Add a button to display the build version info, and add a tooltip to the copy button.
This commit is contained in:
jean-pierre charras 2017-08-18 08:06:45 +02:00
parent 6ff065fa63
commit 4c9d0b9c0a
8 changed files with 531 additions and 448 deletions

View File

@ -515,8 +515,10 @@ void EDA_BASE_FRAME::GetKicadContribute( wxCommandEvent& event )
{
if( !wxLaunchDefaultBrowser( URL_GET_INVOLVED ) )
{
wxString msg = _( "Could not launch the default browser. For information on how to help the KiCad project, visit " );
msg.Append( URL_GET_INVOLVED );
wxString msg;
msg.Printf( _( "Could not launch the default browser.\n"
"For information on how to help the KiCad project, visit %s" ),
URL_GET_INVOLVED );
wxMessageBox( msg, _( "Get involved with KiCad" ), wxOK, this );
}
}
@ -524,7 +526,7 @@ void EDA_BASE_FRAME::GetKicadContribute( wxCommandEvent& event )
void EDA_BASE_FRAME::GetKicadAbout( wxCommandEvent& event )
{
bool ShowAboutDialog(wxWindow * parent);
void ShowAboutDialog(EDA_BASE_FRAME * aParent); // See AboutDialog_main.cpp
ShowAboutDialog( this );
}

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2010 Rafael Sokolowski <Rafael.Sokolowski@web.de>
* Copyright (C) 2010-2015 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2010-2017 KiCad Developers, see CHANGELOG.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
@ -29,10 +29,10 @@
#include <wx/utils.h>
/* Used icons:
* lang_xx_xpm[]; // Icons of various national flags
* show_3d_xpm[]; // 3D icon
* edit_module_xpm[];
* icon_kicad_xpm[]; // Icon of the application
* lang_xx_xpm; // Icons of various national flags
* show_3d_xpm; // 3D icon
* edit_module_xpm;
* icon_kicad_xpm; // Icon of the application
*/
#include <bitmaps.h>
#include <build_version.h>
@ -44,7 +44,7 @@
#include "dialog_about.h"
WX_DEFINE_OBJARRAY( Contributors )
WX_DEFINE_OBJARRAY( CONTRIBUTORS )
// Helper functions:
static wxString HtmlHyperlink( const wxString& url, const wxString& description = wxEmptyString );
@ -52,33 +52,19 @@ static wxString HtmlNewline( const unsigned int amount = 1 );
/**
* Initializes the <code>AboutAppInfo</code> object with application specific information.
*
* This the object which holds all information about the application
* Initializes the <code>ABOUT_APP_INFO</code> object with application specific information.
* This is the object which holds all information about the application
*/
static void InitKiCadAboutNew( AboutAppInfo& info )
static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInfo )
{
// Set application specific icon
const wxTopLevelWindow* const tlw = wxDynamicCast( Pgm().App().GetTopWindow(),
wxTopLevelWindow );
if( tlw )
info.SetIcon( tlw->GetIcon() );
else
{
wxBitmap bitmap = KiBitmap( icon_kicad_xpm );
wxIcon icon;
icon.CopyFromBitmap( bitmap );
info.SetIcon( icon );
}
aInfo.SetAppIcon( aParent->GetIcon() );
/* Set title */
info.SetAppName( Pgm().App().GetAppName() );
aInfo.SetAppName( Pgm().App().GetAppName() );
/* Copyright information */
info.SetCopyright( wxT( "(C) 1992-2016 KiCad Developers Team" ) );
aInfo.SetCopyright( wxT( "(C) 1992-2017 KiCad Developers Team" ) );
/* KiCad build version */
wxString version;
@ -90,7 +76,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
#endif
<< wxT( " build" );
info.SetBuildVersion( version );
aInfo.SetBuildVersion( version );
/* wxWidgets version */
wxString libVersion;
@ -116,7 +102,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
libVersion << wxT( "Platform: " ) << wxGetOsDescription() << wxT( ", " )
<< platformInfo.GetArchName();
info.SetLibVersion( libVersion );
aInfo.SetLibVersion( libVersion );
/* info/description part HTML formatted */
@ -205,7 +191,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
description << wxT( "</ul></p>" );
info.SetDescription( description );
aInfo.SetDescription( description );
// License information also HTML formatted:
@ -218,7 +204,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
_( "GNU General Public License (GPL) version 3 or any later version" ) )
<< wxT( "</div>" );
info.SetLicense( license );
aInfo.SetLicense( license );
/* A contributor consists of the following information:
@ -234,244 +220,240 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
*/
// The core developers
info.AddDeveloper( new Contributor( wxT( "Jean-Pierre Charras" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Jean-Pierre Charras" ),
wxT( "jp.charras@wanadoo.fr" ) ) );
info.AddDeveloper( new Contributor( wxT( "Dick Hollenbeck" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Dick Hollenbeck" ),
wxT( "dick@softplc.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Wayne Stambaugh" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Wayne Stambaugh" ),
wxT( "stambaughw@gmail.com" ) ) );
// alphabetically by last name after main 3 above:
info.AddDeveloper( new Contributor( wxT( "Frank Bennett" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Frank Bennett" ),
wxT( "bennett78@lpbroadband.net" ) ) );
info.AddDeveloper( new Contributor( wxT( "Cirilo Bernardo" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Cirilo Bernardo" ),
wxT( "cirilo_bernardo@yahoo.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Jonas Diemer" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Jonas Diemer" ),
wxT( "diemer@gmx.de" ) ) );
info.AddDeveloper( new Contributor( wxT( "Torsten Hüter" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Torsten Hüter" ),
wxT( "torstenhtr@gmx.de" ) ) );
info.AddDeveloper( new Contributor( wxT( "Jerry Jacobs" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Jerry Jacobs" ),
wxT( "xor.gate.engineering@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Mario Luzeiro" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Mario Luzeiro" ),
wxT( "mrluzeiro@ua.pt" ) ) );
info.AddDeveloper( new Contributor( wxT( "Daniel Majewski" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Daniel Majewski" ),
wxT( "lordblick@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Lorenzo Marcantonio" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Lorenzo Marcantonio" ),
wxT( "lomarcan@tin.it" ) ) );
info.AddDeveloper( new Contributor( wxT( "Marco Mattila" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Marco Mattila" ),
wxT( "marcom99@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Chris Pavlina" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Chris Pavlina" ),
wxT( "pavlina.chris@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Miguel Angel Ajo Pelayo" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Miguel Angel Ajo Pelayo" ),
wxT( "miguelangel@nbee.es" ) ) );
info.AddDeveloper( new Contributor( wxT( "Jacobo Aragunde Perez" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Jacobo Aragunde Perez" ),
wxT( "jaragunde@igalia.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Simon Richter" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Simon Richter" ),
wxT( "Simon.Richter@hogyros.de" ) ) );
info.AddDeveloper( new Contributor( wxT( "Mark Roszko" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Mark Roszko" ),
wxT( "mark.roszko@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Marco Serantoni" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Marco Serantoni" ),
wxT( "marco.serantoni@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Brian Sidebotham" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Brian Sidebotham" ),
wxT( "brian.sidebotham@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Mateusz Skowroński" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Mateusz Skowroński" ),
wxT( "skowri@gmail.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Rafael Sokolowski" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Rafael Sokolowski" ),
wxT( "rafael.sokolowski@web.de" ) ) );
info.AddDeveloper( new Contributor( wxT( "Vesa Solonen" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Vesa Solonen" ),
wxT( "vesa.solonen@hut.fi" ) ) );
info.AddDeveloper( new Contributor( wxT( "Bernhard Stegmaier" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Bernhard Stegmaier" ),
wxT( "stegmaier@sw-systems.de" ) ) );
info.AddDeveloper( new Contributor( wxT( "Orson (Maciej Sumiński)" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Orson (Maciej Sumiński)" ),
wxT( "maciej.suminski@cern.ch" ) ) );
info.AddDeveloper( new Contributor( wxT( "Tomasz Wlostowski" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Tomasz Wlostowski" ),
wxT( "tomasz.wlostowski@cern.ch" ) ) );
info.AddDeveloper( new Contributor( wxT( "Adam Wolf" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Adam Wolf" ),
wxT( "adamwolf@feelslikeburning.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Alexander Zakamaldin" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Alexander Zakamaldin" ),
wxT( "zaka62@mail.ru" ) ) );
info.AddDeveloper( new Contributor( wxT( "Henner Zeller" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Henner Zeller" ),
wxT( "h.zeller@acm.org" ) ) );
info.AddDeveloper( new Contributor( wxT( "Andrew Zonenberg" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Andrew Zonenberg" ),
wxT( "azonenberg@drawersteak.com" ) ) );
info.AddDeveloper( new Contributor( wxT( "Nick Østergaard" ),
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Nick Østergaard" ),
wxT( "oe.nick@gmail.com" ) ) );
// The document writers
info.AddDocWriter( new Contributor( wxT( "Jean-Pierre Charras" ),
aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Jean-Pierre Charras" ),
wxT( "jp.charras@wanadoo.fr" ) ) );
info.AddDocWriter( new Contributor( wxT( "Marco Ciampa" ),
aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Marco Ciampa" ),
wxT( "ciampix@libero.it" ) ) );
info.AddDocWriter( new Contributor( wxT( "Dick Hollenbeck" ),
aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Dick Hollenbeck" ),
wxT( "dick@softplc.com" ) ) );
info.AddDocWriter( new Contributor( wxT( "Igor Plyatov" ),
aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Igor Plyatov" ),
wxT( "plyatov@gmail.com" ) ) );
info.AddDocWriter( new Contributor( wxT( "Wayne Stambaugh" ),
aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Wayne Stambaugh" ),
wxT( "stambaughw@gmail.com" ) ) );
info.AddDocWriter( new Contributor( wxT( "Fabrizio Tappero" ),
aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Fabrizio Tappero" ),
wxT( "fabrizio.tappero@gmail.com" ) ) );
/* The translators
* As category the language to which the translation was done is used
* and as icon the national flag of the corresponding country.
*/
info.AddTranslator( new Contributor( wxT( "Robert Buj" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Robert Buj" ),
wxT( "rbuj@fedoraproject.org" ),
wxT( "Catalan (CA)" ),
KiBitmapNew( lang_catalan_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Martin Kratoška" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Martin Kratoška" ),
wxT( "martin@ok1rr.com" ),
wxT( "Czech (CZ)" ),
KiBitmapNew( lang_cs_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Jerry Jacobs" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Jerry Jacobs" ),
wxT( "xor.gate.engineering@gmail.com" ),
wxT( "Dutch (NL)" ),
KiBitmapNew( lang_nl_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Vesa Solonen" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Vesa Solonen" ),
wxT( "vesa.solonen@hut.fi" ),
wxT( "Finnish (FI)" ),
KiBitmapNew( lang_fi_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Jean-Pierre Charras" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Jean-Pierre Charras" ),
wxT( "jp.charras@wanadoo.fr" ),
wxT( "French (FR)" ),
KiBitmapNew( lang_fr_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Mateusz Skowroński" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Mateusz Skowroński" ),
wxT( "skowri@gmail.com" ),
wxT( "Polish (PL)" ),
KiBitmapNew( lang_pl_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Kerusey Karyu" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Kerusey Karyu" ),
wxT( "keruseykaryu@o2.pl" ),
wxT( "Polish (PL)" ),
KiBitmapNew( lang_pl_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Renie Marquet" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Renie Marquet" ),
wxT( "reniemarquet@uol.com.br" ),
wxT( "Portuguese (PT)" ),
KiBitmapNew( lang_pt_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Igor Plyatov" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Igor Plyatov" ),
wxT( "plyatov@gmail.com" ),
wxT( "Russian (RU)" ),
KiBitmapNew( lang_ru_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Andrey Fedorushkov" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Andrey Fedorushkov" ),
wxT( "andrf@mail.ru" ),
wxT( "Russian (RU)" ),
KiBitmapNew( lang_ru_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Eldar Khayrullin" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Eldar Khayrullin" ),
wxT( "eldar.khayrullin@mail.ru" ),
wxT( "Russian (RU)" ),
KiBitmapNew( lang_ru_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Pedro Martin del Valle" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Pedro Martin del Valle" ),
wxT( "pkicad@yahoo.es" ),
wxT( "Spanish (ES)" ),
KiBitmapNew( lang_es_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Iñigo Zuluaga" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Iñigo Zuluaga" ),
wxT( "inigo_zuluaga@yahoo.es" ),
wxT( "Spanish (ES)" ),
KiBitmapNew( lang_es_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Iñigo Figuero" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Iñigo Figuero" ),
wxT( "ifs@elektroquark.com" ),
wxT( "Spanish (ES)" ),
KiBitmapNew( lang_es_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Rafael Sokolowski" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Rafael Sokolowski" ),
wxT( "rafael.sokolowski@web.de" ),
wxT( "German (DE)" ),
KiBitmapNew( lang_de_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Kenta Yonekura" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Kenta Yonekura" ),
wxT( "yoneken@kicad.jp" ),
wxT( "Japanese (JA)" ),
KiBitmapNew( lang_jp_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Manolis Stefanis" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Manolis Stefanis" ),
wxT( "" ),
wxT( "Greek (el_GR)" ),
KiBitmapNew( lang_gr_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Athanasios Vlastos" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Athanasios Vlastos" ),
wxT( "" ),
wxT( "Greek (el_GR)" ),
KiBitmapNew( lang_gr_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Milonas Kostas" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Milonas Kostas" ),
wxT( "milonas.ko@gmail.com" ),
wxT( "Greek (el_GR)" ),
KiBitmapNew( lang_gr_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Michail Misirlis" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Michail Misirlis" ),
wxT( "mmisirlis@gmail.com" ),
wxT( "Greek (el_GR)" ),
KiBitmapNew( lang_gr_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Massimo Cioce" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Massimo Cioce" ),
wxT( "ciocemax@alice.it" ),
wxT( "Italian (IT)" ),
KiBitmapNew( lang_it_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Marco Ciampa" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Marco Ciampa" ),
wxT( "ciampix@libero.it" ),
wxT( "Italian (IT)" ),
KiBitmapNew( lang_it_xpm ) ) );
info.AddTranslator( new Contributor( wxT( "Evgeniy Ivanov" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Evgeniy Ivanov" ),
wxT( "evgeniy_p_ivanov@yahoo.ca" ),
wxT( "Bulgarian (BG)" ),
KiBitmapNew( lang_bg_xpm ) ) );
// Maintainer who helper in translations, but not in a specific translation
#define OTHERS_IN_TRANSLATION _( "Others" )
info.AddTranslator( new Contributor( wxT( "Remy Halvick" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Remy Halvick" ),
wxEmptyString,
OTHERS_IN_TRANSLATION ) );
info.AddTranslator( new Contributor( wxT( "David Briscoe" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "David Briscoe" ),
wxEmptyString,
OTHERS_IN_TRANSLATION ) );
info.AddTranslator( new Contributor( wxT( "Dominique Laigle" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Dominique Laigle" ),
wxEmptyString,
OTHERS_IN_TRANSLATION ) );
info.AddTranslator( new Contributor( wxT( "Paul Burke" ),
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Paul Burke" ),
wxEmptyString,
OTHERS_IN_TRANSLATION ) );
// Programm credits for icons
#define ICON_CONTRIBUTION _( "Icons by" )
info.AddArtist( new Contributor( wxT( "Iñigo Zuluaga" ),
aInfo.AddArtist( new CONTRIBUTOR( wxT( "Iñigo Zuluaga" ),
wxT( "inigo_zuluaga@yahoo.es" ),
ICON_CONTRIBUTION,
KiBitmapNew( edit_module_xpm ) ) );
info.AddArtist( new Contributor( wxT( "Konstantin Baranovskiy" ),
aInfo.AddArtist( new CONTRIBUTOR( wxT( "Konstantin Baranovskiy" ),
wxT( "baranovskiykonstantin@gmail.com" ),
ICON_CONTRIBUTION,
KiBitmapNew( edit_module_xpm ) ) );
info.AddArtist( new Contributor( wxT( "Fabrizio Tappero" ),
aInfo.AddArtist( new CONTRIBUTOR( wxT( "Fabrizio Tappero" ),
wxT( "fabrizio.tappero@gmail.com" ),
ICON_CONTRIBUTION,
KiBitmapNew( edit_module_xpm ) ) );
// Programm credits for 3d models
#define MODELS_3D_CONTRIBUTION _( "3D models by" )
info.AddArtist( new Contributor( wxT( "Christophe Boschat" ),
aInfo.AddArtist( new CONTRIBUTOR( wxT( "Christophe Boschat" ),
wxT( "nox454@hotmail.fr" ),
MODELS_3D_CONTRIBUTION,
KiBitmapNew( three_d_xpm ) ) );
info.AddArtist( new Contributor( wxT( "Renie Marquet" ),
aInfo.AddArtist( new CONTRIBUTOR( wxT( "Renie Marquet" ),
wxT( "reniemarquet@uol.com.br" ),
MODELS_3D_CONTRIBUTION,
KiBitmapNew( three_d_xpm ) ) );
// Programm credits for package developers.
info.AddPackager( new Contributor( wxT( "Jean-Samuel Reynaud" ),
aInfo.AddPackager( new CONTRIBUTOR( wxT( "Jean-Samuel Reynaud" ),
wxT( "js.reynaud@gmail.com" ) ) );
info.AddPackager( new Contributor( wxT( "Bernhard Stegmaier" ),
aInfo.AddPackager( new CONTRIBUTOR( wxT( "Bernhard Stegmaier" ),
wxT( "stegmaier@sw-systems.de" ) ) );
info.AddPackager( new Contributor( wxT( "Adam Wolf" ),
aInfo.AddPackager( new CONTRIBUTOR( wxT( "Adam Wolf" ),
wxT( "adamwolf@feelslikeburning.com" ) ) );
info.AddPackager( new Contributor( wxT( "Nick Østergaard" ),
aInfo.AddPackager( new CONTRIBUTOR( wxT( "Nick Østergaard" ),
wxT( "oe.nick@gmail.com" ) ) );
}
bool ShowAboutDialog( wxWindow* parent )
void ShowAboutDialog( EDA_BASE_FRAME* aParent )
{
AboutAppInfo info;
ABOUT_APP_INFO info;
buildKicadAboutBanner( aParent, info );
InitKiCadAboutNew( info );
dialog_about* dlg = new dialog_about( parent, info );
dlg->SetIcon( info.GetIcon() );
dlg->Show();
return true;
DIALOG_ABOUT dlg( aParent, info );
dlg.ShowModal();
}

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 Rafael Sokolowski <Rafael.Sokolowski@web.de>
* Copyright (C) 2014-2015 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2014-2017 KiCad Developers, see CHANGELOG.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
@ -29,9 +29,9 @@
#include <wx/bitmap.h>
#include <wx/dynarray.h>
class Contributor;
class CONTRIBUTOR;
WX_DECLARE_OBJARRAY( Contributor, Contributors );
WX_DECLARE_OBJARRAY( CONTRIBUTOR, CONTRIBUTORS );
/**
@ -39,47 +39,47 @@ WX_DECLARE_OBJARRAY( Contributor, Contributors );
* like who has contributed in which area of the application, the license, copyright
* and other descriptive information.
*/
class AboutAppInfo
class ABOUT_APP_INFO
{
public:
AboutAppInfo() {};
virtual ~AboutAppInfo() {};
ABOUT_APP_INFO() {};
virtual ~ABOUT_APP_INFO() {};
void AddDeveloper( const Contributor* developer )
void AddDeveloper( const CONTRIBUTOR* developer )
{
if( developer != NULL )
developers.Add( developer );
}
void AddDocWriter( const Contributor* docwriter )
void AddDocWriter( const CONTRIBUTOR* docwriter )
{
if( docwriter != NULL )
docwriters.Add( docwriter );
}
void AddArtist( const Contributor* artist )
void AddArtist( const CONTRIBUTOR* artist )
{
if( artist != NULL )
artists.Add( artist );
}
void AddTranslator( const Contributor* translator )
void AddTranslator( const CONTRIBUTOR* translator )
{
if( translator != NULL )
translators.Add( translator );
}
void AddPackager( const Contributor* packager )
void AddPackager( const CONTRIBUTOR* packager )
{
if( packager != NULL )
packagers.Add( packager );
}
Contributors GetDevelopers() { return developers; }
Contributors GetDocWriters() { return docwriters; }
Contributors GetArtists() { return artists; }
Contributors GetTranslators() { return translators; }
Contributors GetPackagers() { return packagers; }
CONTRIBUTORS GetDevelopers() { return developers; }
CONTRIBUTORS GetDocWriters() { return docwriters; }
CONTRIBUTORS GetArtists() { return artists; }
CONTRIBUTORS GetTranslators() { return translators; }
CONTRIBUTORS GetPackagers() { return packagers; }
void SetDescription( const wxString& text ) { description = text; }
wxString& GetDescription() { return description; }
@ -88,18 +88,7 @@ public:
wxString& GetLicense() { return license; }
void SetCopyright( const wxString& text ) { copyright = text; }
wxString GetCopyright()
{
wxString copyrightText = copyright;
#if wxUSE_UNICODE
const wxString utf8_copyrightSign = wxString::FromUTF8( "\xc2\xa9" );
copyrightText.Replace( "(c)", utf8_copyrightSign );
copyrightText.Replace( "(C)", utf8_copyrightSign );
#endif // wxUSE_UNICODE
return copyrightText;
}
wxString GetCopyright() { return copyright; }
void SetAppName( const wxString& name ) { appName = name; }
wxString& GetAppName() { return appName; }
@ -110,25 +99,25 @@ public:
void SetLibVersion( const wxString& version ) { libVersion = version; }
wxString& GetLibVersion() { return libVersion; }
void SetIcon( const wxIcon& icon ) { appIcon = icon; }
wxIcon& GetIcon() { return appIcon; }
void SetAppIcon( const wxIcon& aIcon ) { m_appIcon = aIcon; }
wxIcon& GetAppIcon() { return m_appIcon; }
private:
Contributors developers;
Contributors docwriters;
Contributors artists;
Contributors translators;
Contributors packagers;
CONTRIBUTORS developers;
CONTRIBUTORS docwriters;
CONTRIBUTORS artists;
CONTRIBUTORS translators;
CONTRIBUTORS packagers;
wxString description;
wxString license;
wxString copyright; // Todo: copyright sign in unicode
wxString copyright;
wxString appName;
wxString buildVersion;
wxString libVersion;
wxIcon appIcon;
wxIcon m_appIcon;
};
@ -144,17 +133,22 @@ private:
* - A category
* - A category specific icon
*/
class Contributor
class CONTRIBUTOR
{
public:
Contributor( const wxString& name,
const wxString& email,
const wxString& category = wxEmptyString,
wxBitmap* icon = NULL ) :
m_checked( false )
{ m_name = name; m_email = email; m_category = category; m_icon = icon; }
CONTRIBUTOR( const wxString& aName,
const wxString& aEmail,
const wxString& aCategory = wxEmptyString,
wxBitmap* aIcon = NULL )
{
m_checked = false;
m_name = aName;
m_email = aEmail;
m_category = aCategory;
m_icon = aIcon;
}
virtual ~Contributor() {}
virtual ~CONTRIBUTOR() {}
wxString& GetName() { return m_name; }
wxString& GetEMail() { return m_email; }

View File

@ -36,100 +36,100 @@
#include <wx/clipbrd.h>
#include <wx/msgdlg.h>
/* Pixel information of icons in XPM format.
* All KiCad icons are linked into shared library 'libbitmaps.a'.
/* All KiCad icons are linked into shared library 'libbitmaps.a'.
* Icons:
* preference_xpm[]; // Icon for 'Developers' tab
* editor_xpm[]; // Icon for 'Doc Writers' tab
* palette_xpm[]; // Icon for 'Artists' tab
* language_xpm[]; // Icon for 'Translators' tab
* right_xpm[]; // Right arrow icon for list items
* info_xpm[]; // Bulb for description tab
* tools_xpm[]; // Sheet of paper icon for license info tab
* preference_xpm; // Icon for 'Developers' tab
* editor_xpm; // Icon for 'Doc Writers' tab
* palette_xpm; // Icon for 'Artists' tab
* language_xpm; // Icon for 'Translators' tab
* right_xpm; // Right arrow icon for list items
* info_xpm; // Bulb for description tab
* tools_xpm; // Sheet of paper icon for license info tab
*/
#include <bitmaps.h>
#include <build_version.h>
#include <html_messagebox.h>
#include "dialog_about.h"
#include "DIALOG_ABOUT.h"
/*
* Class dialog_about methods
* Class DIALOG_ABOUT methods
*/
dialog_about::dialog_about(wxWindow *aParent, AboutAppInfo& appInfo)
: dialog_about_base(aParent), info(appInfo)
DIALOG_ABOUT::DIALOG_ABOUT( EDA_BASE_FRAME *aParent, ABOUT_APP_INFO& aAppInfo )
: DIALOG_ABOUT_BASE( aParent ), m_info( aAppInfo )
{
picInformation = KiBitmap( info_xpm );
picDevelopers = KiBitmap( preference_xpm );
picDocWriters = KiBitmap( editor_xpm );
picArtists = KiBitmap( palette_xpm );
picTranslators = KiBitmap( language_xpm );
picLicense = KiBitmap( tools_xpm );
picPackagers = KiBitmap( zip_xpm );
m_picInformation = KiBitmap( info_xpm );
m_picDevelopers = KiBitmap( preference_xpm );
m_picDocWriters = KiBitmap( editor_xpm );
m_picArtists = KiBitmap( palette_xpm );
m_picTranslators = KiBitmap( language_xpm );
m_picLicense = KiBitmap( tools_xpm );
m_picPackagers = KiBitmap( zip_xpm );
m_bitmapApp->SetBitmap( info.GetIcon() );
if( m_info.GetAppIcon().IsOk() )
{
SetIcon( m_info.GetAppIcon() );
m_bitmapApp->SetBitmap( m_info.GetAppIcon() );
}
else
{
wxIcon icon;
icon.CopyFromBitmap( KiBitmap( icon_kicad_xpm ) );
SetIcon( icon );
m_bitmapApp->SetBitmap( icon );
}
m_staticTextAppTitle->SetLabel( info.GetAppName() );
m_staticTextCopyright->SetLabel( info.GetCopyright() );
m_staticTextBuildVersion->SetLabel( "Version: " + info.GetBuildVersion() );
m_staticTextLibVersion->SetLabel( info.GetLibVersion() );
m_staticTextAppTitle->SetLabel( m_info.GetAppName() );
m_staticTextCopyright->SetLabel( m_info.GetCopyright() );
m_staticTextBuildVersion->SetLabel( "Version: " + m_info.GetBuildVersion() );
m_staticTextLibVersion->SetLabel( m_info.GetLibVersion() );
DeleteNotebooks();
CreateNotebooks();
createNotebooks();
GetSizer()->SetSizeHints( this );
m_auiNotebook->Update();
SetFocus();
Centre();
Connect( wxID_COPY, wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler( dialog_about::OnCopyVersionInfo ) );
}
dialog_about::~dialog_about()
DIALOG_ABOUT::~DIALOG_ABOUT()
{
}
wxFlexGridSizer* dialog_about::CreateFlexGridSizer()
wxFlexGridSizer* DIALOG_ABOUT::createFlexGridSizer()
{
// three columns with vertical and horizontal extra space of two pixels
wxFlexGridSizer* fgSizer1 = new wxFlexGridSizer( 3, 2, 2 );
fgSizer1->SetFlexibleDirection( wxHORIZONTAL );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxFlexGridSizer* fgSizer = new wxFlexGridSizer( 3, 2, 2 );
fgSizer->SetFlexibleDirection( wxHORIZONTAL );
fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
return fgSizer1;
return fgSizer;
}
void dialog_about::DeleteNotebooks()
void DIALOG_ABOUT::createNotebooks()
{
for( size_t i=0; i<m_auiNotebook->GetPageCount(); ++i )
m_auiNotebook->DeletePage( i );
createNotebookHtmlPage( m_auiNotebook, _( "Information" ), m_picInformation,
m_info.GetDescription() );
createNotebookPage( m_auiNotebook, _( "Developers" ) , m_picDevelopers, m_info.GetDevelopers() );
createNotebookPage( m_auiNotebook, _( "Doc Writers" ), m_picDocWriters, m_info.GetDocWriters() );
createNotebookPageByCategory( m_auiNotebook, _( "Artists" ), m_picArtists, m_info.GetArtists() );
createNotebookPageByCategory( m_auiNotebook, _( "Translators" ), m_picTranslators,
m_info.GetTranslators() );
createNotebookPageByCategory( m_auiNotebook, _( "Packagers" ), m_picPackagers,
m_info.GetPackagers() );
createNotebookHtmlPage( m_auiNotebook, _( "License" ), m_picLicense, m_info.GetLicense() );
}
void dialog_about::CreateNotebooks()
{
CreateNotebookHtmlPage( m_auiNotebook, _( "Information" ), picInformation,
info.GetDescription() );
CreateNotebookPage( m_auiNotebook, _( "Developers" ) , picDevelopers, info.GetDevelopers() );
CreateNotebookPage( m_auiNotebook, _( "Doc Writers" ), picDocWriters, info.GetDocWriters() );
CreateNotebookPageByCategory( m_auiNotebook, _( "Artists" ), picArtists, info.GetArtists() );
CreateNotebookPageByCategory( m_auiNotebook, _( "Translators" ), picTranslators,
info.GetTranslators() );
CreateNotebookPageByCategory( m_auiNotebook, _( "Packagers" ), picPackagers,
info.GetPackagers() );
CreateNotebookHtmlPage( m_auiNotebook, _( "License" ), picLicense, info.GetLicense() );
}
void dialog_about::CreateNotebookPage( wxAuiNotebook* aParent, const wxString& aCaption,
const wxBitmap& aIcon, const Contributors& aContributors )
void DIALOG_ABOUT::createNotebookPage( wxAuiNotebook* aParent, const wxString& aCaption,
const wxBitmap& aIcon, const CONTRIBUTORS& aContributors )
{
wxBoxSizer* bSizer = new wxBoxSizer( wxHORIZONTAL );
@ -144,14 +144,14 @@ void dialog_about::CreateNotebookPage( wxAuiNotebook* aParent, const wxString& a
*/
wxPanel* panel1 = new wxPanel( m_scrolledWindow1 );
wxFlexGridSizer* fgSizer1 = CreateFlexGridSizer();
wxFlexGridSizer* fgSizer1 = createFlexGridSizer();
for( size_t i=0; i<aContributors.GetCount(); ++i )
{
Contributor* contributor = &aContributors.Item( i );
CONTRIBUTOR* contributor = &aContributors.Item( i );
// Icon at first column
wxStaticBitmap* m_bitmap1 = CreateStaticBitmap( m_scrolledWindow1, contributor->GetIcon() );
wxStaticBitmap* m_bitmap1 = createStaticBitmap( m_scrolledWindow1, contributor->GetIcon() );
fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
// Name of contributor at second column
@ -171,8 +171,8 @@ void dialog_about::CreateNotebookPage( wxAuiNotebook* aParent, const wxString& a
// Email address of contributor at third column
if ( contributor->GetEMail() != wxEmptyString )
{
wxHyperlinkCtrl* hyperlink = CreateHyperlink( m_scrolledWindow1,
contributor->GetEMail() );
wxStaticText* hyperlink = wxStaticTextMail( m_scrolledWindow1,
contributor->GetEMail() );
fgSizer1->Add( hyperlink, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
}
else
@ -190,9 +190,9 @@ void dialog_about::CreateNotebookPage( wxAuiNotebook* aParent, const wxString& a
}
void dialog_about::CreateNotebookPageByCategory(wxAuiNotebook* aParent, const wxString& aCaption,
void DIALOG_ABOUT::createNotebookPageByCategory(wxAuiNotebook* aParent, const wxString& aCaption,
const wxBitmap& aIcon,
const Contributors& aContributors)
const CONTRIBUTORS& aContributors)
{
wxBoxSizer* bSizer = new wxBoxSizer( wxHORIZONTAL );
@ -207,11 +207,11 @@ void dialog_about::CreateNotebookPageByCategory(wxAuiNotebook* aParent, const wx
*/
wxPanel* panel1 = new wxPanel( m_scrolledWindow1 );
wxFlexGridSizer* fgSizer1 = CreateFlexGridSizer();
wxFlexGridSizer* fgSizer1 = createFlexGridSizer();
for( size_t i=0; i < aContributors.GetCount(); ++i )
{
Contributor* contributor = &aContributors.Item( i );
CONTRIBUTOR* contributor = &aContributors.Item( i );
wxBitmap* icon = contributor->GetIcon();
wxString category = contributor->GetCategory();
@ -222,7 +222,7 @@ void dialog_about::CreateNotebookPageByCategory(wxAuiNotebook* aParent, const wx
if( ( category != wxEmptyString ) && !( contributor->IsChecked() ) )
{
// Icon at first column
wxStaticBitmap* m_bitmap1 = CreateStaticBitmap( m_scrolledWindow1, icon );
wxStaticBitmap* m_bitmap1 = createStaticBitmap( m_scrolledWindow1, icon );
fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
// Category name at second column
@ -240,7 +240,7 @@ void dialog_about::CreateNotebookPageByCategory(wxAuiNotebook* aParent, const wx
// Now, all contributors of the same category will follow
for( size_t j=0; j < aContributors.GetCount(); ++j )
{
Contributor* sub_contributor = &aContributors.Item( j );
CONTRIBUTOR* sub_contributor = &aContributors.Item( j );
if ( sub_contributor->GetCategory() == category )
{
@ -258,9 +258,9 @@ void dialog_about::CreateNotebookPageByCategory(wxAuiNotebook* aParent, const wx
// Email address of contributor at third column
if( sub_contributor->GetEMail() != wxEmptyString )
{
wxHyperlinkCtrl* hyperlink = CreateHyperlink( m_scrolledWindow1,
sub_contributor->GetEMail() );
fgSizer1->Add( hyperlink, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
wxStaticText* mail = wxStaticTextMail( m_scrolledWindow1,
sub_contributor->GetEMail() );
fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
}
else
{
@ -285,13 +285,13 @@ void dialog_about::CreateNotebookPageByCategory(wxAuiNotebook* aParent, const wx
*/
for ( size_t k=0; k < aContributors.GetCount(); ++k )
{
Contributor* contributor = &aContributors.Item( k );
CONTRIBUTOR* contributor = &aContributors.Item( k );
if ( contributor->IsChecked() )
continue;
// Icon at first column
wxStaticBitmap* m_bitmap1 = CreateStaticBitmap( m_scrolledWindow1, contributor->GetIcon() );
wxStaticBitmap* m_bitmap1 = createStaticBitmap( m_scrolledWindow1, contributor->GetIcon() );
fgSizer1->Add( m_bitmap1, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, 5 );
// Name of contributor at second column
@ -311,9 +311,9 @@ void dialog_about::CreateNotebookPageByCategory(wxAuiNotebook* aParent, const wx
// Email address of contributor at third column
if ( contributor->GetEMail() != wxEmptyString )
{
wxHyperlinkCtrl* hyperlink = CreateHyperlink( m_scrolledWindow1,
contributor->GetEMail() );
fgSizer1->Add( hyperlink, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
wxStaticText* mail = wxStaticTextMail( m_scrolledWindow1,
contributor->GetEMail() );
fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
}
else
{
@ -330,7 +330,7 @@ void dialog_about::CreateNotebookPageByCategory(wxAuiNotebook* aParent, const wx
}
void dialog_about::CreateNotebookHtmlPage( wxAuiNotebook* aParent, const wxString& aCaption,
void DIALOG_ABOUT::createNotebookHtmlPage( wxAuiNotebook* aParent, const wxString& aCaption,
const wxBitmap& aIcon, const wxString& html )
{
wxPanel* panel = new wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
@ -365,7 +365,7 @@ void dialog_about::CreateNotebookHtmlPage( wxAuiNotebook* aParent, const wxStrin
// the HTML window shall not be used to open external links, thus this task is delegated
// to users default browser
htmlWindow->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED,
wxHtmlLinkEventHandler( dialog_about::OnHtmlLinkClicked ), NULL, this );
wxHtmlLinkEventHandler( DIALOG_ABOUT::onHtmlLinkClicked ), NULL, this );
// no additional space around the HTML window as it is also the case by the other notebook pages
bSizer->Add( htmlWindow, 1, wxALL|wxEXPAND, 0 );
@ -376,22 +376,16 @@ void dialog_about::CreateNotebookHtmlPage( wxAuiNotebook* aParent, const wxStrin
}
wxHyperlinkCtrl* dialog_about::CreateHyperlink(wxScrolledWindow* aParent, const wxString& email)
wxStaticText* DIALOG_ABOUT::wxStaticTextMail(wxScrolledWindow* aParent, const wxString& aEmail)
{
wxHyperlinkCtrl* hyperlink = new wxHyperlinkCtrl(
aParent, wxID_ANY,
wxT( "<" ) + email + wxT( ">" ), /* the label */
wxT( "mailto:" ) + email
+ wxT( "?subject=KiCad - " )
+ info.GetBuildVersion()
+ wxT( " , " ) + info.GetLibVersion()
); /* the url */
wxStaticText* text = new wxStaticText( aParent, wxID_ANY,
wxT( "<" ) + aEmail + wxT( ">" ) );
return hyperlink;
return text;
}
wxStaticBitmap* dialog_about::CreateStaticBitmap(wxScrolledWindow* aParent, wxBitmap* aIcon)
wxStaticBitmap* DIALOG_ABOUT::createStaticBitmap(wxScrolledWindow* aParent, wxBitmap* aIcon)
{
wxStaticBitmap* bitmap = new wxStaticBitmap( aParent, wxID_ANY, wxNullBitmap,
wxDefaultPosition, wxDefaultSize, 0 );
@ -409,28 +403,142 @@ wxStaticBitmap* dialog_about::CreateStaticBitmap(wxScrolledWindow* aParent, wxBi
}
///////////////////////////////////////////////////////////////////////////////
/// Event handlers
///////////////////////////////////////////////////////////////////////////////
void dialog_about::OnClose( wxCloseEvent &event )
{
Destroy();
}
void dialog_about::OnOkClick( wxCommandEvent &event )
{
Destroy();
}
void dialog_about::OnHtmlLinkClicked( wxHtmlLinkEvent& event )
void DIALOG_ABOUT::onHtmlLinkClicked( wxHtmlLinkEvent& event )
{
::wxLaunchDefaultBrowser( event.GetLinkInfo().GetHref() );
}
void dialog_about::OnCopyVersionInfo( wxCommandEvent& event )
void DIALOG_ABOUT::buildVersionInfoData( wxString& aMsg, bool aFormatHtml )
{
// DO NOT translate information in the msg_version string
wxString eol = aFormatHtml ? "<br>" : "\n";
wxString indent4 = aFormatHtml ? "&nbsp;&nbsp;&nbsp;&nbsp;" : " ";
#define ON "ON" << eol
#define OFF "OFF" << eol
wxPlatformInfo platform;
aMsg << "Application: " << m_info.GetAppName() << eol;
aMsg << "Version: " << m_info.GetBuildVersion() << eol;
aMsg << "Libraries:" << eol;
aMsg << indent4 << wxGetLibraryVersionInfo().GetVersionString() << eol;
#ifdef BUILD_GITHUB_PLUGIN
aMsg << indent4 << KICAD_CURL::GetVersion() << eol;
#endif
aMsg << "Platform: " << wxGetOsDescription() << ", "
<< platform.GetArchName() << ", "
<< platform.GetEndiannessName() << ", "
<< platform.GetPortIdName() << eol;
aMsg << "Build Info:" << eol;
aMsg << indent4 << "wxWidgets: " << wxVERSION_NUM_DOT_STRING << " (";
aMsg << __WX_BO_UNICODE __WX_BO_STL __WX_BO_WXWIN_COMPAT_2_8 ")" << eol;
aMsg << indent4 << "Boost: " << ( BOOST_VERSION / 100000 ) << wxT( "." )
<< ( BOOST_VERSION / 100 % 1000 ) << wxT( "." )
<< ( BOOST_VERSION % 100 ) << eol;
#ifdef BUILD_GITHUB_PLUGIN
aMsg << indent4 << "Curl: " << LIBCURL_VERSION << eol;
#endif
aMsg << indent4 << "KiCad compiler: ";
#if defined(__clang__)
aMsg << "Clang " << __clang_major__ << "." << __clang_minor__ << "." << __clang_patchlevel__;
#elif defined(__GNUG__)
aMsg << "GCC " << __GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__;
#elif defined(_MSC_VER)
aMsg << "Visual C++ " << _MSC_VER;
#elif defined(__INTEL_COMPILER)
aMsg << "Intel C++ " << __INTEL_COMPILER;
#else
aMsg << "Other Compiler ";
#endif
#if defined(__GXX_ABI_VERSION)
aMsg << " with C++ ABI " << __GXX_ABI_VERSION << eol;
#else
aMsg << " without C++ ABI\n";
#endif
// Add build settings config (build options):
aMsg << "Build settings:" << eol;
aMsg << indent4 << "USE_WX_GRAPHICS_CONTEXT=";
#ifdef USE_WX_GRAPHICS_CONTEXT
aMsg << ON;
#else
aMsg << OFF;
#endif
aMsg << indent4 << "USE_WX_OVERLAY=";
#ifdef USE_WX_OVERLAY
aMsg << ON;
#else
aMsg << OFF;
#endif
aMsg << indent4 << "KICAD_SCRIPTING=";
#ifdef KICAD_SCRIPTING
aMsg << ON;
#else
aMsg << OFF;
#endif
aMsg << indent4 << "KICAD_SCRIPTING_MODULES=";
#ifdef KICAD_SCRIPTING_MODULES
aMsg << ON;
#else
aMsg << OFF;
#endif
aMsg << indent4 << "KICAD_SCRIPTING_WXPYTHON=";
#ifdef KICAD_SCRIPTING_WXPYTHON
aMsg << ON;
#else
aMsg << OFF;
#endif
aMsg << indent4 << "KICAD_SCRIPTING_ACTION_MENU=";
#ifdef KICAD_SCRIPTING_ACTION_MENU
aMsg << ON;
#else
aMsg << OFF;
#endif
aMsg << indent4 << "BUILD_GITHUB_PLUGIN=";
#ifdef BUILD_GITHUB_PLUGIN
aMsg << ON;
#else
aMsg << OFF;
#endif
aMsg << indent4 << "KICAD_USE_OCE=";
#ifdef KICAD_USE_OCE
aMsg << ON;
#else
aMsg << OFF;
#endif
}
void DIALOG_ABOUT::onShowVersionInfo( wxCommandEvent& event )
{
wxString msg_version;
buildVersionInfoData( msg_version, true );
HTML_MESSAGE_BOX dlg( this, _( "Version Info" ), wxDefaultPosition,
wxSize( 550, 500 ) );
dlg.AddHTML_Text( msg_version );
dlg.ShowModal();
}
void DIALOG_ABOUT::onCopyVersionInfo( wxCommandEvent& event )
{
if( !wxTheClipboard->Open() )
{
@ -439,114 +547,10 @@ void dialog_about::OnCopyVersionInfo( wxCommandEvent& event )
return;
}
wxPlatformInfo platform;
// DO NOT translate information in the msg_version string
wxString msg_version;
msg_version << "Application: " << info.GetAppName() << "\n";
msg_version << "Version: " << info.GetBuildVersion() << "\n";
msg_version << "Libraries: " << wxGetLibraryVersionInfo().GetVersionString() << "\n";
#ifdef BUILD_GITHUB_PLUGIN
msg_version << " " << KICAD_CURL::GetVersion() << "\n";
#endif
msg_version << "Platform: " << wxGetOsDescription() << ", "
<< platform.GetArchName() << ", "
<< platform.GetEndiannessName() << ", "
<< platform.GetPortIdName() << "\n";
msg_version << "- Build Info -\n";
msg_version << "wxWidgets: " << wxVERSION_NUM_DOT_STRING << " (";
msg_version << __WX_BO_UNICODE __WX_BO_STL __WX_BO_WXWIN_COMPAT_2_8 ")\n";
msg_version << "Boost: " << ( BOOST_VERSION / 100000 ) << wxT( "." )
<< ( BOOST_VERSION / 100 % 1000 ) << wxT( "." )
<< ( BOOST_VERSION % 100 ) << wxT( "\n" );
#ifdef BUILD_GITHUB_PLUGIN
msg_version << "Curl: " << LIBCURL_VERSION << "\n";
#endif
msg_version << "KiCad - Compiler: ";
#if defined(__clang__)
msg_version << "Clang " << __clang_major__ << "." << __clang_minor__ << "." << __clang_patchlevel__;
#elif defined(__GNUG__)
msg_version << "GCC " << __GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__;
#elif defined(_MSC_VER)
msg_version << "Visual C++ " << _MSC_VER;
#elif defined(__INTEL_COMPILER)
msg_version << "Intel C++ " << __INTEL_COMPILER;
#else
msg_version << "Other Compiler ";
#endif
#if defined(__GXX_ABI_VERSION)
msg_version << " with C++ ABI " << __GXX_ABI_VERSION << "\n";
#else
msg_version << " without C++ ABI\n";
#endif
msg_version << " Settings: ";
#define ON "ON\n"
#define OFF "OFF\n"
msg_version << "USE_WX_GRAPHICS_CONTEXT=";
#ifdef USE_WX_GRAPHICS_CONTEXT
msg_version << ON;
#else
msg_version << OFF;
#endif
msg_version << " USE_WX_OVERLAY=";
#ifdef USE_WX_OVERLAY
msg_version << ON;
#else
msg_version << OFF;
#endif
msg_version << " KICAD_SCRIPTING=";
#ifdef KICAD_SCRIPTING
msg_version << ON;
#else
msg_version << OFF;
#endif
msg_version << " KICAD_SCRIPTING_MODULES=";
#ifdef KICAD_SCRIPTING_MODULES
msg_version << ON;
#else
msg_version << OFF;
#endif
msg_version << " KICAD_SCRIPTING_WXPYTHON=";
#ifdef KICAD_SCRIPTING_WXPYTHON
msg_version << ON;
#else
msg_version << OFF;
#endif
msg_version << " KICAD_SCRIPTING_ACTION_MENU=";
#ifdef KICAD_SCRIPTING_ACTION_MENU
msg_version << ON;
#else
msg_version << OFF;
#endif
msg_version << " BUILD_GITHUB_PLUGIN=";
#ifdef BUILD_GITHUB_PLUGIN
msg_version << ON;
#else
msg_version << OFF;
#endif
msg_version << " KICAD_USE_OCE=";
#ifdef KICAD_USE_OCE
msg_version << ON;
#else
msg_version << OFF;
#endif
buildVersionInfoData( msg_version, false );
wxTheClipboard->SetData( new wxTextDataObject( msg_version ) );
wxTheClipboard->Close();
copyVersionInfo->SetLabel( _( "Copied..." ) );
m_btCopyVersionInfo->SetLabel( _( "Copied..." ) );
}

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2010 Rafael Sokolowski <Rafael.Sokolowski@web.de>
* Copyright (C) 2010-2015 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2010-2017 KiCad Developers, see CHANGELOG.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
@ -35,53 +35,60 @@
/**
* About dialog to show application specific information.
* Needs an <code>AboutAppInfo</code> object that contains the data to be displayed.
* Needs a <code>ABOUT_APP_INFO</code> object that contains the data to be displayed.
*/
class dialog_about : public dialog_about_base
class DIALOG_ABOUT : public DIALOG_ABOUT_BASE
{
private:
// Icons for the various tabs of wxAuiNotebook
wxBitmap picInformation;
wxBitmap picDevelopers;
wxBitmap picDocWriters;
wxBitmap picArtists;
wxBitmap picTranslators;
wxBitmap picPackagers;
wxBitmap picLicense;
wxBitmap m_picInformation;
wxBitmap m_picDevelopers;
wxBitmap m_picDocWriters;
wxBitmap m_picArtists;
wxBitmap m_picTranslators;
wxBitmap m_picPackagers;
wxBitmap m_picLicense;
AboutAppInfo info;
ABOUT_APP_INFO m_info;
public:
dialog_about( wxWindow* dlg, AboutAppInfo& appInfo );
~dialog_about();
DIALOG_ABOUT( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aAppInfo );
~DIALOG_ABOUT();
private:
void initDialog();
virtual void OnClose( wxCloseEvent& event );
virtual void OnOkClick( wxCommandEvent& event );
virtual void OnHtmlLinkClicked( wxHtmlLinkEvent& event );
virtual void OnCopyVersionInfo( wxCommandEvent &event );
void initDialog();
/** build the version info message
* @param aMsg is the result
* @param aFormatHtml = true to use a minimal HTML format
* false to use a plain text
*/
void buildVersionInfoData( wxString& aMsg, bool aFormatHtml );
void onHtmlLinkClicked( wxHtmlLinkEvent& event );
virtual void onCopyVersionInfo( wxCommandEvent& event ) override;
virtual void onShowVersionInfo( wxCommandEvent& event ) override;
// Notebook pages
wxFlexGridSizer* CreateFlexGridSizer();
void DeleteNotebooks();
void CreateNotebooks();
void CreateNotebookPage( wxAuiNotebook* aParent,
wxFlexGridSizer* createFlexGridSizer();
void createNotebooks();
void createNotebookPage( wxAuiNotebook* aParent,
const wxString& aCaption,
const wxBitmap& aIcon,
const Contributors& aContributors );
void CreateNotebookPageByCategory( wxAuiNotebook* aParent,
const CONTRIBUTORS& aContributors );
void createNotebookPageByCategory( wxAuiNotebook* aParent,
const wxString& aCaption,
const wxBitmap& aIcon,
const Contributors& aContributors );
void CreateNotebookHtmlPage( wxAuiNotebook* aParent,
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 );
wxStaticText* wxStaticTextMail( wxScrolledWindow* aParent, const wxString& email );
wxStaticBitmap* createStaticBitmap( wxScrolledWindow* aParent, wxBitmap* icon );
};
#endif // DIALOG_ABOUT_H

View File

@ -9,21 +9,21 @@
///////////////////////////////////////////////////////////////////////////
dialog_about_base::dialog_about_base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
DIALOG_ABOUT_BASE::DIALOG_ABOUT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizerTitle;
bSizerTitle = new wxBoxSizer( wxHORIZONTAL );
bSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
bSizerTitle->Add( 0, 0, 1, wxEXPAND, 5 );
m_bitmapApp = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
bSizer3->Add( m_bitmapApp, 1, wxALIGN_CENTER|wxALL, 5 );
bSizerTitle->Add( m_bitmapApp, 1, wxALIGN_CENTER|wxALL, 5 );
wxBoxSizer* b_apptitleSizer;
b_apptitleSizer = new wxBoxSizer( wxVERTICAL );
@ -47,41 +47,51 @@ dialog_about_base::dialog_about_base( wxWindow* parent, wxWindowID id, const wxS
b_apptitleSizer->Add( m_staticTextLibVersion, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 );
bSizer3->Add( b_apptitleSizer, 10, wxALL|wxEXPAND, 5 );
bSizerTitle->Add( b_apptitleSizer, 10, wxALL|wxEXPAND, 5 );
bSizer3->Add( 0, 0, 2, wxEXPAND, 5 );
bSizerTitle->Add( 0, 0, 2, wxEXPAND, 5 );
bSizer1->Add( bSizer3, 0, wxEXPAND, 5 );
bSizerMain->Add( bSizerTitle, 0, wxEXPAND, 5 );
m_auiNotebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_SCROLL_BUTTONS|wxAUI_NB_TAB_FIXED_WIDTH );
m_auiNotebook->SetMinSize( wxSize( 750,350 ) );
bSizer1->Add( m_auiNotebook, 2, wxALL|wxEXPAND, 5 );
bSizerMain->Add( m_auiNotebook, 2, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizer4;
bSizer4 = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizerButtons;
bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
m_btShowVersionInfo = new wxButton( this, wxID_COPY, _("Show Version Info"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_btShowVersionInfo, 0, wxALL, 5 );
m_btCopyVersionInfo = new wxButton( this, wxID_COPY, _("Copy Version Info"), wxDefaultPosition, wxDefaultSize, 0 );
m_btCopyVersionInfo->SetToolTip( _("Copy KiCad version info to the clipboard") );
bSizerButtons->Add( m_btCopyVersionInfo, 0, wxALL, 5 );
m_btOk = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_btOk->SetDefault();
bSizerButtons->Add( m_btOk, 0, wxALL, 5 );
bSizer4->Add( 0, 0, 1, wxEXPAND, 5 );
copyVersionInfo = new wxButton( this, wxID_COPY, _("Copy Version Info"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer4->Add( copyVersionInfo, 0, wxALL, 5 );
ok = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
ok->SetDefault();
bSizer4->Add( ok, 0, wxALL, 5 );
bSizerMain->Add( bSizerButtons, 0, wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
bSizer1->Add( bSizer4, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
this->SetSizer( bSizer1 );
this->SetSizer( bSizerMain );
this->Layout();
// Connect Events
m_btShowVersionInfo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ABOUT_BASE::onShowVersionInfo ), NULL, this );
m_btCopyVersionInfo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ABOUT_BASE::onCopyVersionInfo ), NULL, this );
}
dialog_about_base::~dialog_about_base()
DIALOG_ABOUT_BASE::~DIALOG_ABOUT_BASE()
{
// Disconnect Events
m_btShowVersionInfo->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ABOUT_BASE::onShowVersionInfo ), NULL, this );
m_btCopyVersionInfo->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ABOUT_BASE::onCopyVersionInfo ), NULL, this );
}

View File

@ -42,7 +42,7 @@
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size">-1,-1</property>
<property name="name">dialog_about_base</property>
<property name="name">DIALOG_ABOUT_BASE</property>
<property name="pos"></property>
<property name="size">750,471</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
@ -90,7 +90,7 @@
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer1</property>
<property name="name">bSizerMain</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
@ -99,7 +99,7 @@
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer3</property>
<property name="name">bSizerTitle</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
@ -641,21 +641,99 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="flag">wxALIGN_RIGHT|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer4</property>
<property name="name">bSizerButtons</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_COPY</property>
<property name="label">Show Version Info</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_btShowVersionInfo</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="width">0</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">onShowVersionInfo</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
@ -699,7 +777,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">copyVersionInfo</property>
<property name="name">m_btCopyVersionInfo</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -712,7 +790,7 @@
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="tooltip">Copy KiCad version info to the clipboard</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
@ -720,7 +798,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick"></event>
<event name="OnButtonClick">onCopyVersionInfo</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -787,7 +865,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">ok</property>
<property name="name">m_btOk</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>

View File

@ -29,9 +29,9 @@
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class dialog_about_base
/// Class DIALOG_ABOUT_BASE
///////////////////////////////////////////////////////////////////////////////
class dialog_about_base : public wxDialog
class DIALOG_ABOUT_BASE : public wxDialog
{
private:
@ -42,13 +42,19 @@ class dialog_about_base : public wxDialog
wxStaticText* m_staticTextBuildVersion;
wxStaticText* m_staticTextLibVersion;
wxAuiNotebook* m_auiNotebook;
wxButton* copyVersionInfo;
wxButton* ok;
wxButton* m_btShowVersionInfo;
wxButton* m_btCopyVersionInfo;
wxButton* m_btOk;
// Virtual event handlers, overide them in your derived class
virtual void onShowVersionInfo( wxCommandEvent& event ) { event.Skip(); }
virtual void onCopyVersionInfo( wxCommandEvent& event ) { event.Skip(); }
public:
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 );
~dialog_about_base();
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 );
~DIALOG_ABOUT_BASE();
};