all-programs: about dialog improved

This commit is contained in:
jerryjacobs 2008-08-15 16:38:05 +00:00
parent ebeb2363a2
commit 8fd4401e12
15 changed files with 106 additions and 102 deletions

View File

@ -117,6 +117,7 @@ if(UNIX)
create_svn_version_header() create_svn_version_header()
endif(UNIX) endif(UNIX)
# Include paths. # Include paths.
include_directories(${CMAKE_SOURCE_DIR}/include include_directories(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/share ${CMAKE_SOURCE_DIR}/share

View File

@ -7,6 +7,8 @@ macro(create_svn_version_header)
_kicad_svn_date ${Kicad_WC_LAST_CHANGED_DATE}) _kicad_svn_date ${Kicad_WC_LAST_CHANGED_DATE})
set(KICAD_SVN_VERSION set(KICAD_SVN_VERSION
"(${_kicad_svn_date} SVN-R${Kicad_WC_LAST_CHANGED_REV})") "(${_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 # Definition to conditionally use date and revision returned from the
# Subversion info command instead of hand coded date and revision in # Subversion info command instead of hand coded date and revision in

View File

@ -4,5 +4,6 @@
#define __KICAD_SVN_VERSION_H__ #define __KICAD_SVN_VERSION_H__
#cmakedefine KICAD_SVN_VERSION "@KICAD_SVN_VERSION@" #cmakedefine KICAD_SVN_VERSION "@KICAD_SVN_VERSION@"
#cmakedefine KICAD_ABOUT_VERSION "@KICAD_ABOUT_VERSION@"
#endif /* __KICAD_SVN_VERSION_H__ */ #endif /* __KICAD_SVN_VERSION_H__ */

View File

@ -1,4 +1,5 @@
set(COMMON_SRCS set(COMMON_SRCS
about_kicad.cpp
base_screen.cpp base_screen.cpp
base_struct.cpp base_struct.cpp
basicframe.cpp basicframe.cpp
@ -20,7 +21,6 @@ set(COMMON_SRCS
get_component_dialog.cpp get_component_dialog.cpp
gr_basic.cpp gr_basic.cpp
hotkeys_basic.cpp hotkeys_basic.cpp
infospgm.cpp
msgpanel.cpp msgpanel.cpp
projet_config.cpp projet_config.cpp
# pyhandler.cpp # pyhandler.cpp

51
common/about_kicad.cpp Normal file
View File

@ -0,0 +1,51 @@
/* wxWidgets about dialog */
#include <wx/aboutdlg.h>
#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 <jean-pierre.charras@inpg.fr>"));
/* Add document writers */
info.AddDocWriter(_T("Jean-Pierre Charras <jean-pierre.charras@inpg.fr>"));
/* Add translators */
info.AddTranslator(_T("Dutch (NL) Jerry Jacobs <jerkejacobs@gmail.com>"));
info.AddTranslator(_T("French (FR) Jean-Pierre Charras <jean-pierre.charras@inpg.fr>"));
}

View File

@ -6,6 +6,11 @@
#pragma implementation #pragma implementation
#endif #endif
/* wxWidgets about dialog */
#include <wx/aboutdlg.h>
#include "wx/statline.h"
#include "wx/generic/aboutdlgg.h"
#include "fctsys.h" #include "fctsys.h"
#include <wx/fontdlg.h> #include <wx/fontdlg.h>
#include "common.h" #include "common.h"
@ -254,12 +259,13 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
#endif #endif
} }
/***********************************************************************/
/***********************************************************/ void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) )
void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& event ) /***********************************************************************/
/**********************************************************/
{ {
Print_Kicad_Infos( this, m_AboutTitle, wxEmptyString ); wxAboutDialogInfo info;
InitKiCadAbout(info);
wxAboutBox(info);
} }

View File

@ -25,6 +25,15 @@ wxString GetBuildVersion()
} }
/*********************************************/
/* Return custom build date for about dialog */
/*********************************************/
wxString GetAboutBuildVersion()
/*********************************************/
{
return g_BuildAboutVersion;
}
/********************************/ /********************************/
void SetLocaleTo_C_standard(void) void SetLocaleTo_C_standard(void)
/********************************/ /********************************/

View File

@ -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 <pyhandler.h>
#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 );
}

View File

@ -25,7 +25,7 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( WinEDA_App* parent, const wxString& title,
WinEDA_BasicFrame( NULL, CVPCB_FRAME, parent, title, wxDefaultPosition, wxDefaultSize, style ) WinEDA_BasicFrame( NULL, CVPCB_FRAME, parent, title, wxDefaultPosition, wxDefaultSize, style )
{ {
m_FrameName = wxT( "CvpcbFrame" ); m_FrameName = wxT( "CvpcbFrame" );
m_AboutTitle = g_CvpcbAboutTitle; //m_AboutTitle = g_CvpcbAboutTitle;
m_ListCmp = NULL; m_ListCmp = NULL;
m_FootprintList = NULL; m_FootprintList = NULL;
DrawFrame = NULL; DrawFrame = NULL;

View File

@ -137,7 +137,7 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
WinEDA_DrawFrame( father, SCHEMATIC_FRAME, parent, title, pos, size, style ) WinEDA_DrawFrame( father, SCHEMATIC_FRAME, parent, title, pos, size, style )
{ {
m_FrameName = wxT( "SchematicFrame" ); m_FrameName = wxT( "SchematicFrame" );
m_AboutTitle = g_EeschemaAboutTitle; //m_AboutTitle = g_EeschemaAboutTitle;
m_Draw_Axis = FALSE; // TRUE to show axis m_Draw_Axis = FALSE; // TRUE to show axis
m_Draw_Grid = g_ShowGrid; // TRUE to show a grid m_Draw_Grid = g_ShowGrid; // TRUE to show a grid
m_Draw_Sheet_Ref = TRUE; // TRUE to show sheet references m_Draw_Sheet_Ref = TRUE; // TRUE to show sheet references

View File

@ -131,7 +131,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
WinEDA_BasePcbFrame( father, parent, GERBER_FRAME, title, pos, size, style ) WinEDA_BasePcbFrame( father, parent, GERBER_FRAME, title, pos, size, style )
{ {
m_FrameName = wxT( "GerberFrame" ); m_FrameName = wxT( "GerberFrame" );
m_AboutTitle = g_GerbviewAboutTitle; //m_AboutTitle = g_GerbviewAboutTitle;
m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines
m_Draw_Grid = TRUE; // TRUE pour avoir la axes dessinee m_Draw_Grid = TRUE; // TRUE pour avoir la axes dessinee
m_Draw_Sheet_Ref = FALSE; // TRUE pour avoir le cartouche dessin<69> m_Draw_Sheet_Ref = FALSE; // TRUE pour avoir le cartouche dessin<69>

View File

@ -14,4 +14,16 @@ COMMON_GLOBL wxString g_BuildVersion
#endif #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 #endif // KICAD_BUILD_VERSION

View File

@ -5,6 +5,12 @@
#ifndef COMMON_H #ifndef COMMON_H
#define COMMON_H #define COMMON_H
/* wxWidgets about dialog */
#include <wx/aboutdlg.h>
#include "wx/statline.h"
#include "wx/generic/aboutdlgg.h"
/**************************/
#include "wx/confbase.h" #include "wx/confbase.h"
#include "wx/fileconf.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 /* 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 */ * 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, /* about_kicad.cpp */
const wxString& aExtra_infos ); /*******************/
void InitKiCadAbout( wxAboutDialogInfo& info);
/**************/ /**************/
/* common.cpp */ /* common.cpp */
/**************/ /**************/
wxString GetBuildVersion(); /* Return the build date */ wxString GetBuildVersion(); /* Return the build date */
wxString GetAboutBuildVersion(); /* Return custom build date for about dialog */
void Affiche_1_Parametre( WinEDA_DrawFrame* frame, void Affiche_1_Parametre( WinEDA_DrawFrame* frame,
int pos_X, int pos_X,

View File

@ -34,7 +34,7 @@ WinEDA_MainFrame::WinEDA_MainFrame( WinEDA_App* eda_app,
wxSize clientsize; wxSize clientsize;
m_FrameName = wxT( "KicadFrame" ); m_FrameName = wxT( "KicadFrame" );
m_AboutTitle = g_KicadAboutTitle; //m_AboutTitle = g_KicadAboutTitle;
m_VToolBar = NULL; m_VToolBar = NULL;
m_LeftWin = NULL; m_LeftWin = NULL;
m_BottomWin = NULL; m_BottomWin = NULL;

View File

@ -98,7 +98,7 @@ EVT_MENU( ID_MENU_PCB_SWAP_LAYERS, WinEDA_PcbFrame::Process_Special_Functions )
// Menu Help // Menu Help
EVT_MENU( ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp ) 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 // Menu 3D Frame
EVT_MENU( ID_MENU_PCB_SHOW_3D_FRAME, WinEDA_PcbFrame::Show3D_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 ) WinEDA_BasePcbFrame( father, parent, PCB_FRAME, title, pos, size, style )
{ {
m_FrameName = wxT( "PcbFrame" ); m_FrameName = wxT( "PcbFrame" );
m_AboutTitle = g_PcbnewAboutTitle; //m_AboutTitle = g_PcbnewAboutTitle;
m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines m_Draw_Axis = TRUE; // TRUE pour avoir les axes dessines
m_Draw_Grid = g_ShowGrid; // TRUE pour avoir la grille dessinee m_Draw_Grid = g_ShowGrid; // TRUE pour avoir la grille dessinee
m_Draw_Sheet_Ref = TRUE; // TRUE pour avoir le cartouche dessine m_Draw_Sheet_Ref = TRUE; // TRUE pour avoir le cartouche dessine
@ -568,17 +568,3 @@ void WinEDA_PcbFrame::SetToolbars()
DisplayUnitsMsg(); 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 );
}