From b2745c4b00ab19884153ba4ee66dac4807af8176 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Mon, 11 May 2015 12:25:33 -0400 Subject: [PATCH] Unify platform information code in about dialog and version information. --- common/basicframe.cpp | 8 ++-- common/dialog_about/AboutDialog_main.cpp | 59 +++++++++--------------- 2 files changed, 27 insertions(+), 40 deletions(-) diff --git a/common/basicframe.cpp b/common/basicframe.cpp index b9d8896573..e86ab99991 100644 --- a/common/basicframe.cpp +++ b/common/basicframe.cpp @@ -551,7 +551,7 @@ static inline const char* KICAD_BUILD_OPTIONS_SIGNATURE() " (release," #endif __WX_BO_UNICODE __ABI_VERSION __BO_COMPILER __WX_BO_STL - __WX_BO_WXWIN_COMPAT_2_4 __WX_BO_WXWIN_COMPAT_2_6 ")" + __WX_BO_WXWIN_COMPAT_2_6 __WX_BO_WXWIN_COMPAT_2_8 ")" ; } @@ -572,9 +572,9 @@ void EDA_BASE_FRAME::CopyVersionInfoToClipboard( wxCommandEvent& event ) tmp = wxT( "Application: " ) + Pgm().App().GetAppName() + wxT( "\n" ); tmp << wxT( "Version: " ) << GetBuildVersion() #ifdef DEBUG - << wxT( " Debug" ) + << wxT( " debug" ) #else - << wxT( " Release" ) + << wxT( " release" ) #endif << wxT( " build\n" ); tmp << wxT( "wxWidgets: Version " ) << FROM_UTF8( wxVERSION_NUM_DOT_STRING ) @@ -632,7 +632,7 @@ void EDA_BASE_FRAME::CopyVersionInfoToClipboard( wxCommandEvent& event ) tmp << wxT( "OFF\n" ); #endif - wxMessageBox( tmp, _("Version Information (copied to the clipboard)") ); + wxMessageBox( tmp, _( "Version Information (copied to the clipboard)" ) ); wxTheClipboard->SetData( new wxTextDataObject( tmp ) ); wxTheClipboard->Close(); diff --git a/common/dialog_about/AboutDialog_main.cpp b/common/dialog_about/AboutDialog_main.cpp index 07b491b9e2..5f6ba354a9 100644 --- a/common/dialog_about/AboutDialog_main.cpp +++ b/common/dialog_about/AboutDialog_main.cpp @@ -26,6 +26,7 @@ #include #include #include +#include /* Used icons: @@ -50,7 +51,7 @@ static wxString HtmlNewline( const unsigned int amount = 1 ); /** - * Initializes the AboutAppInfo object with applicaion specific information. + * Initializes the AboutAppInfo object with application specific information. * * This the object which holds all information about the application */ @@ -79,7 +80,14 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) /* KiCad build version */ wxString version; - version << wxT( "Build: " ) << GetBuildVersion(); + version << wxT( "Version: " ) << GetBuildVersion() +#ifdef DEBUG + << wxT( ", debug" ) +#else + << wxT( ", release" ) +#endif + << wxT( " build" ); + info.SetBuildVersion( version ); /* wxWidgets version */ @@ -90,46 +98,25 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) << wxMINOR_VERSION << wxT( "." ) << wxRELEASE_NUMBER - /* Unicode or Ansi version */ + /* Unicode or ANSI version */ #if wxUSE_UNICODE << wxT( " Unicode " ); #else - << wxT( " Ansi " ); + << wxT( " ANSI " ); #endif - libVersion << wxT( "and boost C++ libraries" ); + // Just in case someone builds KiCad with the platform native of Boost instead of + // the version included with the KiCad source. + libVersion << wxT( "and Boost " ) << ( BOOST_VERSION / 100000 ) << wxT( "." ) + << ( BOOST_VERSION / 100 % 1000 ) << wxT( "." ) << ( BOOST_VERSION % 100 ) + << wxT( "\n" ); - libVersion << wxT( "\n" ); + // Operating System Information - /* Operating System Information */ + wxPlatformInfo platformInfo; -#if defined __WIN64__ - libVersion << wxT( "on 64 Bits Windows" ); - -# elif defined __WINDOWS__ - libVersion << wxT( "on 32 Bits Windows" ); - - /* Check for wxMAC */ -# elif defined __WXMAC__ - libVersion << wxT( "on Macintosh" ); - - /* Linux 64 bits */ -# elif defined _LP64 && __LINUX__ - libVersion << wxT( "on 64 Bits GNU/Linux" ); - - /* Linux 32 bits */ -# elif defined __LINUX__ - libVersion << wxT( "on 32 Bits GNU/Linux" ); - - /* OpenBSD */ -# elif defined __OpenBSD__ - libVersion << wxT( "on OpenBSD" ); - - /* FreeBSD */ -# elif defined __FreeBSD__ - libVersion << wxT( "on FreeBSD" ); - -#endif + libVersion << wxT( "Platform: " ) << wxGetOsDescription() << wxT( ", " ) + << platformInfo.GetArchName(); info.SetLibVersion( libVersion ); @@ -153,7 +140,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) description << wxT( "

" ); description << wxT( "" ) << _( "KiCad on the web" ) << wxT( "" ); // bold & underlined font for caption - // bulletet list with some http links + // bullet-ed list with some http links description << wxT( "

    " ); description << wxT( "
  • " ) << HtmlHyperlink( wxT( "http://iut-tice.ujf-grenoble.fr/kicad" ), @@ -175,7 +162,7 @@ static void InitKiCadAboutNew( AboutAppInfo& info ) description << wxT( "

    " ); description << wxT( "" ) << _( "Contribute to KiCad" ) << wxT( "" ); // bold & underlined font caption - // bulletet list with some http links + // bullet-ed list with some http links description << wxT( "

      " ); description << wxT( "
    • " ) << HtmlHyperlink( wxT( "https://bugs.launchpad.net/kicad" ),