@ -65,8 +65,8 @@ static const wxChar* CommonConfigPath = wxT( "kicad_common" );
* the size of the array . */
# define LANGUAGE_DESCR_COUNT ( sizeof( s_Language_List ) / sizeof( struct LANGUAGE_DESCR ) )
/* Default font size */
# define FONT_DEFAULT_SIZE 10 /* Default font size. */
// Default font size
# define FONT_DEFAULT_SIZE 10 // Default font size.
static wxString languageCfgKey ( wxT ( " LanguageID " ) ) ;
@ -108,7 +108,7 @@ struct LANGUAGE_DESCR
*/
static struct LANGUAGE_DESCR s_Language_List [ ] =
{
/* Default language */
// Default language
{
wxLANGUAGE_DEFAULT ,
ID_LANGUAGE_DEFAULT ,
@ -116,7 +116,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " Default " )
} ,
/* English language */
// English language
{
wxLANGUAGE_ENGLISH ,
ID_LANGUAGE_ENGLISH ,
@ -125,7 +125,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
true
} ,
/* French language */
// French language
{
wxLANGUAGE_FRENCH ,
ID_LANGUAGE_FRENCH ,
@ -133,7 +133,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " French " )
} ,
/* Finnish language */
// Finnish language
{
wxLANGUAGE_FINNISH ,
ID_LANGUAGE_FINNISH ,
@ -141,7 +141,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " Finnish " )
} ,
/* Spanish language */
// Spanish language
{
wxLANGUAGE_SPANISH ,
ID_LANGUAGE_SPANISH ,
@ -149,7 +149,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " Spanish " )
} ,
/* Portuguese language */
// Portuguese language
{
wxLANGUAGE_PORTUGUESE ,
ID_LANGUAGE_PORTUGUESE ,
@ -157,7 +157,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " Portuguese " )
} ,
/* Italian language */
// Italian language
{
wxLANGUAGE_ITALIAN ,
ID_LANGUAGE_ITALIAN ,
@ -165,7 +165,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " Italian " )
} ,
/* German language */
// German language
{
wxLANGUAGE_GERMAN ,
ID_LANGUAGE_GERMAN ,
@ -173,7 +173,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " German " )
} ,
/* Greek language */
// Greek language
{
wxLANGUAGE_GREEK ,
ID_LANGUAGE_GREEK ,
@ -181,7 +181,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " Greek " )
} ,
/* Slovenian language */
// Slovenian language
{
wxLANGUAGE_SLOVENIAN ,
ID_LANGUAGE_SLOVENIAN ,
@ -189,7 +189,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " Slovenian " )
} ,
/* Hungarian language */
// Hungarian language
{
wxLANGUAGE_HUNGARIAN ,
ID_LANGUAGE_HUNGARIAN ,
@ -197,7 +197,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " Hungarian " )
} ,
/* Polish language */
// Polish language
{
wxLANGUAGE_POLISH ,
ID_LANGUAGE_POLISH ,
@ -205,7 +205,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " Polish " )
} ,
/* Czech language */
// Czech language
{
wxLANGUAGE_CZECH ,
ID_LANGUAGE_CZECH ,
@ -213,7 +213,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " Czech " )
} ,
/* Russian language */
// Russian language
{
wxLANGUAGE_RUSSIAN ,
ID_LANGUAGE_RUSSIAN ,
@ -221,7 +221,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " Russian " )
} ,
/* Korean language */
// Korean language
{
wxLANGUAGE_KOREAN ,
ID_LANGUAGE_KOREAN ,
@ -229,7 +229,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " Korean " )
} ,
/* Chinese simplified */
// Chinese simplified
{
wxLANGUAGE_CHINESE_SIMPLIFIED ,
ID_LANGUAGE_CHINESE_SIMPLIFIED ,
@ -237,7 +237,7 @@ static struct LANGUAGE_DESCR s_Language_List[] =
_ ( " Chinese simplified " )
} ,
/* Catalan language */
// Catalan language
{
wxLANGUAGE_CATALAN ,
ID_LANGUAGE_CATALAN ,
@ -286,7 +286,7 @@ EDA_APP::~EDA_APP()
{
SaveSettings ( ) ;
/* delete user datas */
// delete user datas
if ( m_projectSettings )
delete m_projectSettings ;
@ -309,10 +309,9 @@ void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
m_Id = aId ;
m_Checker = new wxSingleInstanceChecker ( aName . Lower ( ) + wxT ( " - " ) + wxGetUserId ( ) ) ;
/* Init KiCad environment
* the environment variable KICAD ( if exists ) gives the kicad path :
* something like set KICAD = d : \ kicad
*/
// Init KiCad environment
// the environment variable KICAD (if exists) gives the kicad path:
// something like set KICAD=d:\kicad
bool isDefined = wxGetEnv ( wxT ( " KICAD " ) , & m_KicadEnv ) ;
if ( isDefined ) // ensure m_KicadEnv ends by "/"
@ -323,8 +322,8 @@ void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
m_KicadEnv + = UNIX_STRING_DIR_SEP ;
}
/* Prepare On Line Help. Use only lower case for help file names, in order to
* avoid problems with upper / lower case file names under windows and unix */
// Prepare On Line Help. Use only lower case for help file names, in order to
// avoid problems with upper/lower case file names under windows and unix.
# if defined ONLINE_HELP_FILES_FORMAT_IS_HTML
m_HelpFileName = aName . Lower ( ) + wxT ( " .html " ) ;
# elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF
@ -333,7 +332,7 @@ void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
# error Help files format not defined
# endif
/* Init parameters for configuration */
// Init parameters for configuration
SetVendorName ( wxT ( " KiCad " ) ) ;
SetAppName ( aName . Lower ( ) ) ;
SetTitle ( aName ) ;
@ -342,7 +341,7 @@ void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
m_commonSettings = new wxConfig ( CommonConfigPath ) ;
wxASSERT ( m_commonSettings ! = NULL ) ;
/* Install some image handlers, mainly for help */
// Install some image handlers, mainly for help
wxImage : : AddHandler ( new wxPNGHandler ) ;
wxImage : : AddHandler ( new wxGIFHandler ) ;
wxImage : : AddHandler ( new wxJPEGHandler ) ;
@ -375,7 +374,7 @@ void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
{
}
/* Set locale option for separator used in float numbers */
// Set locale option for separator used in float numbers
SetLocaleTo_Default ( ) ;
}
@ -418,10 +417,10 @@ void EDA_APP::InitOnLineHelp()
bool EDA_APP : : SetBinDir ( )
{
/* Apple MacOSx */
// Apple MacOSx
# ifdef __APPLE__
/* Derive path from location of the app bundle */
// Derive path from location of the app bundle
CFBundleRef mainBundle = CFBundleGetMainBundle ( ) ;
if ( mainBundle = = NULL )
@ -446,12 +445,12 @@ bool EDA_APP::SetBinDir()
m_BinDir = FROM_UTF8 ( native_str ) ;
delete [ ] native_str ;
/* Linux and Unix */
// Linux and Unix
# elif defined(__UNIX__)
m_BinDir = wxStandardPaths ( ) . GetExecutablePath ( ) ;
# else
m_BinDir = argv [ 0 ] ;
# endif /* __UNIX__ */
# endif // __UNIX__
/* Use unix notation for paths. I am not sure this is a good idea,
* but it simplify compatibility between Windows and Unices
@ -493,16 +492,16 @@ void EDA_APP::SetDefaultSearchPaths( void )
if ( : : wxGetEnv ( wxT ( " KICAD " ) , NULL ) )
m_searchPaths . AddEnvList ( wxT ( " KICAD " ) ) ;
/* Add the user's home path. */
// Add the user's home path.
m_searchPaths . Add ( GetTraits ( ) - > GetStandardPaths ( ) . GetUserDataDir ( ) ) ;
/* Standard application data path if it is different from the binary path. */
// Standard application data path if it is different from the binary path.
if ( fn . GetPath ( ) ! = GetTraits ( ) - > GetStandardPaths ( ) . GetDataDir ( ) )
{
m_searchPaths . Add ( GetTraits ( ) - > GetStandardPaths ( ) . GetDataDir ( ) ) ;
}
/* Up one level relative to binary path with "share" appended for Windows. */
// Up one level relative to binary path with "share" appended for Windows.
fn . RemoveLastDir ( ) ;
m_searchPaths . Add ( fn . GetPath ( ) ) ;
fn . AppendDir ( wxT ( " share " ) ) ;
@ -511,10 +510,11 @@ void EDA_APP::SetDefaultSearchPaths( void )
m_searchPaths . Add ( fn . GetPath ( ) ) ;
/* The normal OS program file install paths allow for binary to be
* installed in a different path from the library files . This is
* useful for development purposes so the library and documentation
* files do not need to be installed separately . If someone can
* figure out a way to implement this without # ifdef , please do . */
* installed in a different path from the library files . This is
* useful for development purposes so the library and documentation
* files do not need to be installed separately . If someone can
* figure out a way to implement this without # ifdef , please do .
*/
# ifdef __WXMSW__
tmp . AddEnvList ( wxT ( " PROGRAMFILES " ) ) ;
# elif __WXMAC__
@ -545,7 +545,7 @@ void EDA_APP::SetDefaultSearchPaths( void )
m_searchPaths . Add ( fn . GetPath ( ) ) ;
}
/* Remove all non-existent paths from the list. */
// Remove all non-existent paths from the list.
for ( i = 0 ; i < m_searchPaths . GetCount ( ) ; i + + )
{
if ( ! wxFileName : : IsDirReadable ( m_searchPaths [ i ] ) )
@ -570,7 +570,7 @@ void EDA_APP::SetDefaultSearchPaths( void )
m_libSearchPaths . Add ( fn . GetPath ( ) ) ;
}
/* Add schematic doc file path (library/doc)to search path list. */
// Add schematic doc file path (library/doc)to search path list.
fn . AppendDir ( wxT ( " doc " ) ) ;
if ( fn . IsDirReadable ( ) )
@ -582,7 +582,7 @@ void EDA_APP::SetDefaultSearchPaths( void )
fn . RemoveLastDir ( ) ; // point to <kicad path>
}
/* Add PCB library file path to search path list. */
// Add PCB library file path to search path list.
if ( ( m_Id = = APP_PCBNEW_T ) | | ( m_Id = = APP_CVPCB_T ) )
{
fn . AppendDir ( wxT ( " modules " ) ) ;
@ -592,7 +592,7 @@ void EDA_APP::SetDefaultSearchPaths( void )
m_libSearchPaths . Add ( fn . GetPath ( ) ) ;
}
/* Add 3D module library file path to search path list. */
// Add 3D module library file path to search path list.
fn . AppendDir ( wxT ( " packages3d " ) ) ;
if ( fn . IsDirReadable ( ) )
@ -604,7 +604,7 @@ void EDA_APP::SetDefaultSearchPaths( void )
fn . RemoveLastDir ( ) ; // point to <kicad path>
}
/* Add KiCad template file path to search path list. */
// Add KiCad template file path to search path list.
fn . AppendDir ( wxT ( " template " ) ) ;
if ( fn . IsDirReadable ( ) )
@ -656,6 +656,7 @@ void EDA_APP::GetSettings( bool aReopenLastUsedDirectory )
}
int draw_bg_color ;
// FIXME OSX Mountain Lion (10.8)
// Seems that Read doesn't found anything and ColorFromInt Asserts - I'm unable to reproduce on 10.7
// In general terms i think is better have a failsafe BLACK default than an uninit variable
@ -688,7 +689,7 @@ void EDA_APP::SaveSettings()
m_settings - > Write ( wxT ( " WorkingDir " ) , wxGetCwd ( ) ) ;
m_settings - > Write ( wxT ( " BgColor " ) , ( long ) g_DrawBgColor ) ;
/* Save the file history list */
// Save the file history list
m_fileHistory . Save ( * m_settings ) ;
}
@ -771,7 +772,7 @@ bool EDA_APP::SetLanguage( bool first_time )
void EDA_APP : : SetLanguageIdentifier ( int menu_id )
{
wxLogDebug ( wxT ( " Select language ID %d from %d possible languages. " ) ,
wxLogDebug ( wxT ( " Select language ID %d from %z d possible languages. " ) ,
menu_id , LANGUAGE_DESCR_COUNT ) ;
for ( unsigned int ii = 0 ; ii < LANGUAGE_DESCR_COUNT ; ii + + )
@ -789,7 +790,7 @@ void EDA_APP::SetLanguagePath( void )
{
size_t i ;
/* Add defined search paths to locale paths */
// Add defined search paths to locale paths
if ( ! m_searchPaths . IsEmpty ( ) )
{
for ( i = 0 ; i < m_searchPaths . GetCount ( ) ; i + + )