Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
89e5909f
Commit
89e5909f
authored
Feb 03, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Solved: problem when searching non english help files
parent
c3918aad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
21 deletions
+47
-21
edaappl.cpp
common/edaappl.cpp
+47
-21
No files found.
common/edaappl.cpp
View file @
89e5909f
...
...
@@ -406,7 +406,7 @@ bool WinEDA_App::SetBinDir()
delete
[]
native_str
;
/* Linux and Unix */
#elif defined
(__UNIX__)
#elif defined(__UNIX__)
// Under Linux, if argv[0] doesn't the complete path to the executable,
// it's necessary to obtain it using "which <filename>".
...
...
@@ -454,6 +454,7 @@ bool WinEDA_App::SetBinDir()
return
TRUE
;
}
/**
* Set search paths for libraries, modules, internationalization files, etc.
*/
...
...
@@ -527,9 +528,9 @@ void WinEDA_App::GetSettings()
/* Load the last file history settings from legacy version if this is the
* first time wxFileHistory was used to manage the file history. */
if
(
m_fileHistory
.
GetCount
()
==
(
size_t
)
0
)
if
(
m_fileHistory
.
GetCount
()
==
(
size_t
)
0
)
{
for
(
ii
=
0
;
ii
<
(
unsigned
)
m_fileHistory
.
GetMaxFiles
();
ii
++
)
for
(
ii
=
0
;
ii
<
(
unsigned
)
m_fileHistory
.
GetMaxFiles
();
ii
++
)
{
entry
=
wxT
(
"LastProject"
);
if
(
ii
!=
0
)
...
...
@@ -721,7 +722,6 @@ void WinEDA_App::SetLanguageIdentifier( int menu_id )
}
void
WinEDA_App
::
SetLanguagePath
(
void
)
{
size_t
i
;
...
...
@@ -734,6 +734,7 @@ void WinEDA_App::SetLanguagePath( void )
wxFileName
fn
(
m_searchPaths
[
i
],
wxEmptyString
);
fn
.
AppendDir
(
wxT
(
"share"
)
);
#ifndef __WXMSW__
/* Up on level relative to binary path with "share/kicad" appended
* for all other platforms. */
fn
.
AppendDir
(
wxT
(
"kicad"
)
);
...
...
@@ -842,6 +843,10 @@ wxString WinEDA_App::FindFileInSearchPaths( const wxString& filename,
* for the current locale is not found, an attempt to find the English
* version of the help file is made. wxEmptyString is returned if the
* help file is not found.
* Help file is searched in directories in this order:
* help/<canonical name> like help/en_GB
* help/<short name> like help/en
* help/en
*/
wxString
WinEDA_App
::
GetHelpFile
(
void
)
{
...
...
@@ -860,10 +865,29 @@ wxString WinEDA_App::GetHelpFile( void )
subdirs
.
Add
(
wxT
(
"kicad"
)
);
#endif
subdirs
.
Add
(
_T
(
"help"
)
);
/* Search for a help file.
* we *must* find a help file.
* so help is searched in directories in this order:
* help/<canonical name> like help/en_GB
* help/<short name> like help/en
* help/en
*/
// Step 1 : Try to find help file in help/<canonical name>
subdirs
.
Add
(
m_Locale
->
GetCanonicalName
()
);
fn
=
FindFileInSearchPaths
(
m_HelpFileName
,
&
subdirs
);
if
(
!
fn
&&
m_Locale
->
GetCanonicalName
()
!=
wxLocale
::
GetLanguageInfo
(
wxLANGUAGE_ENGLISH
)
->
CanonicalName
)
// Step 2 : if not found Try to find help file in help/<short name>
if
(
!
fn
)
{
subdirs
.
RemoveAt
(
subdirs
.
GetCount
()
-
1
);
subdirs
.
Add
(
m_Locale
->
GetName
().
BeforeLast
(
'_'
)
);
// GetName( ) does not return always the short name
fn
=
FindFileInSearchPaths
(
m_HelpFileName
,
&
subdirs
);
}
// Step 3 : if not found Try to find help file in help/en
if
(
!
fn
)
{
subdirs
.
RemoveAt
(
subdirs
.
GetCount
()
-
1
);
subdirs
.
Add
(
_T
(
"en"
)
);
...
...
@@ -873,12 +897,14 @@ wxString WinEDA_App::GetHelpFile( void )
return
fn
;
}
wxString
WinEDA_App
::
GetLibraryFile
(
const
wxString
&
filename
)
{
wxArrayString
subdirs
;
subdirs
.
Add
(
wxT
(
"share"
)
);
#ifndef __WXMSW__
/* Up on level relative to binary path with "share/kicad" appended for
* all other platforms. */
subdirs
.
Add
(
wxT
(
"kicad"
)
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment