From 8fd4401e1262172fd5cb42050d252e0341cee438 Mon Sep 17 00:00:00 2001 From: jerryjacobs Date: Fri, 15 Aug 2008 16:38:05 +0000 Subject: [PATCH] all-programs: about dialog improved --- CMakeLists.txt | 1 + CMakeModules/CreateSVNVersionHeader.cmake | 2 + CMakeModules/config.h.cmake | 1 + common/CMakeLists.txt | 2 +- common/about_kicad.cpp | 51 ++++++++++++++++++ common/basicframe.cpp | 16 ++++-- common/common.cpp | 9 ++++ common/infospgm.cpp | 65 ----------------------- cvpcb/cvframe.cpp | 2 +- eeschema/schframe.cpp | 2 +- gerbview/gerberframe.cpp | 2 +- include/build_version.h | 12 +++++ include/common.h | 23 ++++---- kicad/mainframe.cpp | 2 +- pcbnew/pcbframe.cpp | 18 +------ 15 files changed, 106 insertions(+), 102 deletions(-) create mode 100644 common/about_kicad.cpp delete mode 100644 common/infospgm.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index f5816138b0..887e860aa0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,6 +117,7 @@ if(UNIX) create_svn_version_header() endif(UNIX) + # Include paths. include_directories(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/share diff --git a/CMakeModules/CreateSVNVersionHeader.cmake b/CMakeModules/CreateSVNVersionHeader.cmake index 3aa921f249..62ef2d861b 100644 --- a/CMakeModules/CreateSVNVersionHeader.cmake +++ b/CMakeModules/CreateSVNVersionHeader.cmake @@ -7,6 +7,8 @@ macro(create_svn_version_header) _kicad_svn_date ${Kicad_WC_LAST_CHANGED_DATE}) set(KICAD_SVN_VERSION "(${_kicad_svn_date} SVN-R${Kicad_WC_LAST_CHANGED_REV})") + set(KICAD_ABOUT_VERSION + "SVN-R${Kicad_WC_LAST_CHANGED_REV} (${_kicad_svn_date})") # Definition to conditionally use date and revision returned from the # Subversion info command instead of hand coded date and revision in diff --git a/CMakeModules/config.h.cmake b/CMakeModules/config.h.cmake index 82df4201d7..2e947323bc 100644 --- a/CMakeModules/config.h.cmake +++ b/CMakeModules/config.h.cmake @@ -4,5 +4,6 @@ #define __KICAD_SVN_VERSION_H__ #cmakedefine KICAD_SVN_VERSION "@KICAD_SVN_VERSION@" +#cmakedefine KICAD_ABOUT_VERSION "@KICAD_ABOUT_VERSION@" #endif /* __KICAD_SVN_VERSION_H__ */ diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 469d04ab4b..f3d644af30 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -1,4 +1,5 @@ set(COMMON_SRCS + about_kicad.cpp base_screen.cpp base_struct.cpp basicframe.cpp @@ -20,7 +21,6 @@ set(COMMON_SRCS get_component_dialog.cpp gr_basic.cpp hotkeys_basic.cpp - infospgm.cpp msgpanel.cpp projet_config.cpp # pyhandler.cpp diff --git a/common/about_kicad.cpp b/common/about_kicad.cpp new file mode 100644 index 0000000000..757d45b91c --- /dev/null +++ b/common/about_kicad.cpp @@ -0,0 +1,51 @@ +/* wxWidgets about dialog */ +#include +#include "wx/statline.h" +#include "wx/generic/aboutdlgg.h" + +#include "fctsys.h" +#include "gr_basic.h" +#include "common.h" + +extern wxString g_Main_Title; // Import program title + + + +/**************************************************/ +void InitKiCadAbout(wxAboutDialogInfo& info) +/**************************************************/ +{ + /* Set name and title */ + info.SetName(g_Main_Title); + + /* Set description */ + wxString description; + + description << (_T("Build: ")) << GetAboutBuildVersion(); +#if wxUSE_UNICODE + description << (_T( " Unicode" )); +#else + description << (_T( " Ansi" )); +#endif + + info.SetDescription(description); + + /* Set copyright */ + info.SetCopyright(_T("(C) 1992-2008 KiCad Developers Team")); + + /* Set license */ + info.SetLicence(wxString::FromAscii + ( + "GNU GPLv3" + )); + + /* Add developers */ + info.AddDeveloper(_T("Jean-Pierre Charras ")); + + /* Add document writers */ + info.AddDocWriter(_T("Jean-Pierre Charras ")); + + /* Add translators */ + info.AddTranslator(_T("Dutch (NL) Jerry Jacobs ")); + info.AddTranslator(_T("French (FR) Jean-Pierre Charras ")); +} diff --git a/common/basicframe.cpp b/common/basicframe.cpp index c9839bfd98..625e9e790b 100644 --- a/common/basicframe.cpp +++ b/common/basicframe.cpp @@ -6,6 +6,11 @@ #pragma implementation #endif +/* wxWidgets about dialog */ +#include +#include "wx/statline.h" +#include "wx/generic/aboutdlgg.h" + #include "fctsys.h" #include #include "common.h" @@ -254,12 +259,13 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event ) #endif } - -/***********************************************************/ -void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& event ) -/**********************************************************/ +/***********************************************************************/ +void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) ) +/***********************************************************************/ { - Print_Kicad_Infos( this, m_AboutTitle, wxEmptyString ); + wxAboutDialogInfo info; + InitKiCadAbout(info); + wxAboutBox(info); } diff --git a/common/common.cpp b/common/common.cpp index 33ee9c8e8a..3fc481bd5d 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -25,6 +25,15 @@ wxString GetBuildVersion() } +/*********************************************/ +/* Return custom build date for about dialog */ +/*********************************************/ +wxString GetAboutBuildVersion() +/*********************************************/ +{ + return g_BuildAboutVersion; +} + /********************************/ void SetLocaleTo_C_standard(void) /********************************/ diff --git a/common/infospgm.cpp b/common/infospgm.cpp deleted file mode 100644 index 7d982abe20..0000000000 --- a/common/infospgm.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************/ -/* Display a generic info about kikac (copyright..) */ -/* Common tp CVPCB, EESCHEMA, PCBNEW and GERBVIEW */ -/****************************************************/ - -#include "fctsys.h" -#include "gr_basic.h" -#include "common.h" - -#ifdef KICAD_PYTHON -#include -#endif - -// Import: -extern wxString g_Main_Title; - -/* Program title strings used in about dialog. They are kept here to make - * it easy to update the copyright dates. */ -wxString g_KicadAboutTitle = wxT( "** KICAD (jul 2000 .. 2008) **" ); -wxString g_CvpcbAboutTitle = wxT( "** CVPCB (sept 1992 .. 2008) **" ); -wxString g_EeschemaAboutTitle = wxT( "** EESCHEMA (sept 1994 .. 2008) **" ); -wxString g_PcbnewAboutTitle = wxT( "** PCBNEW (sept 1992 .. 2008) **" ); -wxString g_GerbviewAboutTitle = wxT( "** GERBVIEW (jul 2001 .. 2008) **" ); - -/**************************************************************/ -void Print_Kicad_Infos( wxWindow* frame, const wxString& title, - const wxString& aExtra_infos ) -/**************************************************************/ -{ - wxString AboutCaption = wxT( "About " ); - wxString Msg = title; - - Msg << wxT( "\n\n" ) << _( "Build Version:" ) << wxT( "\n" ); - - Msg << g_Main_Title << wxT( " " ) << GetBuildVersion(); -#if wxUSE_UNICODE - Msg << wxT( " - Unicode version" ); -#else - Msg << wxT( " - Ansi version" ); -#endif - -#ifdef KICAD_PYTHON - Msg << wxT( "\n" ); - Msg << wxT( "python : " ); - Msg << wxString::FromAscii( PyHandler::GetInstance()->GetVersion() ); -#endif - - Msg << wxT( "\n\n" ) << _( "Author:" ); - Msg << wxT( " JP CHARRAS\n\n" ) << _( "Based on wxWidgets " ); - Msg << wxMAJOR_VERSION << wxT( "." ) << - wxMINOR_VERSION << wxT( "." ) << wxRELEASE_NUMBER; - if( wxSUBRELEASE_NUMBER ) - Msg << wxT( "." ) << wxSUBRELEASE_NUMBER; - Msg << _( "\n\nGPL License" ); - Msg << _( "\n\nAuthor's sites:\n" ); - Msg << wxT( "http://iut-tice.ujf-grenoble.fr/kicad/\n" ); - Msg << wxT( "http://www.gipsa-lab.inpg.fr/realise_au_lis/kicad/" ); - Msg << _( "\n\nInternational wiki:\n" ); - Msg << wxT( "http://kicad.sourceforge.net/\n" ); - Msg << aExtra_infos; - - AboutCaption << g_Main_Title << wxT( " " ) << GetBuildVersion(); - - wxMessageBox( Msg, AboutCaption, wxICON_INFORMATION, frame ); -} diff --git a/cvpcb/cvframe.cpp b/cvpcb/cvframe.cpp index 5829fa762d..438bbbca11 100644 --- a/cvpcb/cvframe.cpp +++ b/cvpcb/cvframe.cpp @@ -25,7 +25,7 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( WinEDA_App* parent, const wxString& title, WinEDA_BasicFrame( NULL, CVPCB_FRAME, parent, title, wxDefaultPosition, wxDefaultSize, style ) { m_FrameName = wxT( "CvpcbFrame" ); - m_AboutTitle = g_CvpcbAboutTitle; + //m_AboutTitle = g_CvpcbAboutTitle; m_ListCmp = NULL; m_FootprintList = NULL; DrawFrame = NULL; diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index 1e26a297d5..2b3e052f72 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -137,7 +137,7 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father, WinEDA_DrawFrame( father, SCHEMATIC_FRAME, parent, title, pos, size, style ) { m_FrameName = wxT( "SchematicFrame" ); - m_AboutTitle = g_EeschemaAboutTitle; + //m_AboutTitle = g_EeschemaAboutTitle; m_Draw_Axis = FALSE; // TRUE to show axis m_Draw_Grid = g_ShowGrid; // TRUE to show a grid m_Draw_Sheet_Ref = TRUE; // TRUE to show sheet references diff --git a/gerbview/gerberframe.cpp b/gerbview/gerberframe.cpp index 9faabbc5fe..4be8217c0b 100644 --- a/gerbview/gerberframe.cpp +++ b/gerbview/gerberframe.cpp @@ -131,7 +131,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father, WinEDA_BasePcbFrame( father, parent, GERBER_FRAME, title, pos, size, style ) { m_FrameName = wxT( "GerberFrame" ); - m_AboutTitle = g_GerbviewAboutTitle; + //m_AboutTitle = g_GerbviewAboutTitle; m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines m_Draw_Grid = TRUE; // TRUE pour avoir la axes dessinee m_Draw_Sheet_Ref = FALSE; // TRUE pour avoir le cartouche dessin� diff --git a/include/build_version.h b/include/build_version.h index 655c199a12..7f19dc580f 100644 --- a/include/build_version.h +++ b/include/build_version.h @@ -14,4 +14,16 @@ COMMON_GLOBL wxString g_BuildVersion #endif ; +COMMON_GLOBL wxString g_BuildAboutVersion +#ifdef EDA_BASE +# ifdef HAVE_SVN_VERSION +# include "config.h" + (wxT(KICAD_ABOUT_VERSION)) +# else + (wxT("(20080811.r1188)")) +# endif +#endif +; + + #endif // KICAD_BUILD_VERSION diff --git a/include/common.h b/include/common.h index f476a0de46..8e5bc7dde2 100644 --- a/include/common.h +++ b/include/common.h @@ -5,6 +5,12 @@ #ifndef COMMON_H #define COMMON_H +/* wxWidgets about dialog */ +#include +#include "wx/statline.h" +#include "wx/generic/aboutdlgg.h" +/**************************/ + #include "wx/confbase.h" #include "wx/fileconf.h" @@ -598,23 +604,18 @@ char* to_point( char* Text ); /* convertit les , en . dans une chaine. utilise pour compenser la fct printf * qui genere les flottants avec une virgule au lieu du point en mode international */ -/****************/ -/* infospgm.cpp */ -/****************/ -extern wxString g_KicadAboutTitle; -extern wxString g_CvpcbAboutTitle; -extern wxString g_EeschemaAboutTitle; -extern wxString g_PcbnewAboutTitle; -extern wxString g_GerbviewAboutTitle; -void Print_Kicad_Infos( wxWindow* frame, - const wxString& title, - const wxString& aExtra_infos ); +/*******************/ +/* about_kicad.cpp */ +/*******************/ +void InitKiCadAbout( wxAboutDialogInfo& info); + /**************/ /* common.cpp */ /**************/ wxString GetBuildVersion(); /* Return the build date */ +wxString GetAboutBuildVersion(); /* Return custom build date for about dialog */ void Affiche_1_Parametre( WinEDA_DrawFrame* frame, int pos_X, diff --git a/kicad/mainframe.cpp b/kicad/mainframe.cpp index ef87e78a2d..81725b0721 100644 --- a/kicad/mainframe.cpp +++ b/kicad/mainframe.cpp @@ -34,7 +34,7 @@ WinEDA_MainFrame::WinEDA_MainFrame( WinEDA_App* eda_app, wxSize clientsize; m_FrameName = wxT( "KicadFrame" ); - m_AboutTitle = g_KicadAboutTitle; + //m_AboutTitle = g_KicadAboutTitle; m_VToolBar = NULL; m_LeftWin = NULL; m_BottomWin = NULL; diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 0fd2597d07..d865d0221b 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -98,7 +98,7 @@ EVT_MENU( ID_MENU_PCB_SWAP_LAYERS, WinEDA_PcbFrame::Process_Special_Functions ) // Menu Help EVT_MENU( ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp ) -EVT_MENU( ID_KICAD_ABOUT, WinEDA_PcbFrame::GetKicadAbout ) +EVT_MENU( ID_KICAD_ABOUT, WinEDA_BasicFrame::GetKicadAbout ) // Menu 3D Frame EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, WinEDA_PcbFrame::Show3D_Frame ) @@ -186,7 +186,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent, WinEDA_BasePcbFrame( father, parent, PCB_FRAME, title, pos, size, style ) { m_FrameName = wxT( "PcbFrame" ); - m_AboutTitle = g_PcbnewAboutTitle; + //m_AboutTitle = g_PcbnewAboutTitle; m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines m_Draw_Grid = g_ShowGrid; // TRUE pour avoir la grille dessinee m_Draw_Sheet_Ref = TRUE; // TRUE pour avoir le cartouche dessine @@ -568,17 +568,3 @@ void WinEDA_PcbFrame::SetToolbars() DisplayUnitsMsg(); } - - -/***********************************************************/ -void WinEDA_PcbFrame::GetKicadAbout( wxCommandEvent& event ) -/**********************************************************/ -{ - wxString extra_message; - - extra_message << wxT( "\nPcbnew uses the kbool library version " ) - << wxT( KBOOL_VERSION ) - << wxT( "\nsee http://boolean.klaasholwerda.nl/bool.html\n" ); - - Print_Kicad_Infos( this, m_AboutTitle, extra_message ); -}