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
e719b42e
Commit
e719b42e
authored
Apr 07, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made GetAssociatedDocument() compatible with last changes in kicad path handling.
parent
6e54ec71
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
60 additions
and
48 deletions
+60
-48
CHANGELOG.txt
CHANGELOG.txt
+4
-0
basicframe.cpp
common/basicframe.cpp
+1
-10
eda_doc.cpp
common/eda_doc.cpp
+20
-22
edaappl.cpp
common/edaappl.cpp
+10
-0
cvframe.cpp
cvpcb/cvframe.cpp
+1
-1
libframe.cpp
eeschema/libframe.cpp
+1
-1
schedit.cpp
eeschema/schedit.cpp
+3
-3
viewlibs.cpp
eeschema/viewlibs.cpp
+3
-3
eda_doc.h
include/eda_doc.h
+16
-7
edit.cpp
pcbnew/edit.cpp
+1
-1
No files found.
CHANGELOG.txt
View file @
e719b42e
...
@@ -10,6 +10,10 @@ email address.
...
@@ -10,6 +10,10 @@ email address.
fixed: bug 2738052 (Delete tool does not delete zones outlines)
fixed: bug 2738052 (Delete tool does not delete zones outlines)
++eeschema:
++eeschema:
fixed: void history file list in menu
fixed: void history file list in menu
++All:
made GetAssociatedDocument() compatible with last changes in kicad path handling.
Get PDF doc associated with a component now works
Some work still needed.
2009-apr-06 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
2009-apr-06 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
================================================================================
...
...
common/basicframe.cpp
View file @
e719b42e
...
@@ -259,15 +259,6 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
...
@@ -259,15 +259,6 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
}
}
#elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF
#elif defined ONLINE_HELP_FILES_FORMAT_IS_PDF
// wxString fullfilename = FindKicadHelpPath() + wxGetApp().m_HelpFileName;
// if ( wxFileExists(fullfilename) )
// GetAssociatedDocument( this, wxEmptyString, fullfilename );
// else // Try to find file in English format:
// {
// fullfilename = FindKicadHelpPath() + wxT("../en/") + wxGetApp().m_HelpFileName;;
// GetAssociatedDocument( this, wxEmptyString, fullfilename );
// }
wxString
helpFile
=
wxGetApp
().
GetHelpFile
();
wxString
helpFile
=
wxGetApp
().
GetHelpFile
();
if
(
!
helpFile
)
if
(
!
helpFile
)
{
{
...
@@ -276,7 +267,7 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
...
@@ -276,7 +267,7 @@ void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
DisplayError
(
this
,
msg
);
DisplayError
(
this
,
msg
);
}
}
else
else
GetAssociatedDocument
(
this
,
wxEmptyString
,
helpFile
);
GetAssociatedDocument
(
this
,
helpFile
);
#else
#else
# error Help files format not defined
# error Help files format not defined
...
...
common/eda_doc.cpp
View file @
e719b42e
...
@@ -71,21 +71,20 @@ static const wxFileTypeInfo EDAfallbacks[] =
...
@@ -71,21 +71,20 @@ static const wxFileTypeInfo EDAfallbacks[] =
};
};
/********************************************************************/
/** Function GetAssociatedDocument
bool
GetAssociatedDocument
(
wxFrame
*
frame
,
const
wxString
&
LibPath
,
* open a document (file) with the suitable browser
const
wxString
&
DocName
)
* @param aFrame = main frame
/*********************************************************************/
/* Launch the viewer for the doc file DocName (mime type)
* LibPath is the doc file search path:
* (kicad/library)
* DocName is the short filename with ext. Wildcarts are allowed
* Seach file is made in LibPath/doc/DocName
*
* if DocName is starting by http: or ftp: or www. the default internet browser is launched
* if DocName is starting by http: or ftp: or www. the default internet browser is launched
*/
* @param aDocName = filename of file to open (Full filename or short filename)
* @param aPaths = a wxPathList to explore.
* if NULL or aDocName is a full filename, aPath is not used.
*/
bool
GetAssociatedDocument
(
wxFrame
*
aFrame
,
const
wxString
&
aDocName
,
const
wxPathList
*
aPaths
)
{
{
wxString
docpath
,
fullfilename
,
file_ext
;
wxString
fullfilename
,
file_ext
;
wxString
msg
;
wxString
msg
;
wxString
command
;
wxString
command
;
bool
success
=
FALSE
;
bool
success
=
FALSE
;
...
@@ -95,20 +94,19 @@ bool GetAssociatedDocument( wxFrame* frame, const wxString& LibPath,
...
@@ -95,20 +94,19 @@ bool GetAssociatedDocument( wxFrame* frame, const wxString& LibPath,
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
for
(
int
ii
=
0
;
ii
<
3
;
ii
++
)
{
{
if
(
DocName
.
First
(
url_header
[
ii
]
)
==
0
)
//. seems an internet url
if
(
a
DocName
.
First
(
url_header
[
ii
]
)
==
0
)
//. seems an internet url
{
{
wxLaunchDefaultBrowser
(
DocName
);
wxLaunchDefaultBrowser
(
a
DocName
);
return
TRUE
;
return
TRUE
;
}
}
}
}
/* Compute the full file name */
/* Compute the full file name */
if
(
wxIsAbsolutePath
(
DocName
)
)
if
(
wxIsAbsolutePath
(
aDocName
)
||
aPaths
==
NULL
)
fullfilename
=
DocName
;
fullfilename
=
a
DocName
;
else
else
{
{
docpath
=
LibPath
+
wxT
(
"doc/"
);
fullfilename
=
aPaths
->
FindValidPath
(
aDocName
);
fullfilename
=
docpath
+
DocName
;
}
}
#ifdef __WINDOWS__
#ifdef __WINDOWS__
...
@@ -132,7 +130,7 @@ bool GetAssociatedDocument( wxFrame* frame, const wxString& LibPath,
...
@@ -132,7 +130,7 @@ bool GetAssociatedDocument( wxFrame* frame, const wxString& LibPath,
fullfilename
,
/* nom fichier par defaut */
fullfilename
,
/* nom fichier par defaut */
extension
,
/* extension par defaut */
extension
,
/* extension par defaut */
mask
,
/* Masque d'affichage */
mask
,
/* Masque d'affichage */
f
rame
,
/* parent frame */
aF
rame
,
/* parent frame */
wxFD_OPEN
,
/* wxSAVE, wxFD_OPEN ..*/
wxFD_OPEN
,
/* wxSAVE, wxFD_OPEN ..*/
TRUE
,
/* true = ne change pas le repertoire courant */
TRUE
,
/* true = ne change pas le repertoire courant */
wxPoint
(
-
1
,
-
1
)
wxPoint
(
-
1
,
-
1
)
...
@@ -145,7 +143,7 @@ bool GetAssociatedDocument( wxFrame* frame, const wxString& LibPath,
...
@@ -145,7 +143,7 @@ bool GetAssociatedDocument( wxFrame* frame, const wxString& LibPath,
{
{
msg
=
_
(
"Doc File "
);
msg
=
_
(
"Doc File "
);
msg
<<
wxT
(
"
\"
"
)
<<
fullfilename
<<
wxT
(
"
\"
"
)
<<
_
(
" not found"
);
msg
<<
wxT
(
"
\"
"
)
<<
fullfilename
<<
wxT
(
"
\"
"
)
<<
_
(
" not found"
);
DisplayError
(
f
rame
,
msg
);
DisplayError
(
aF
rame
,
msg
);
return
FALSE
;
return
FALSE
;
}
}
...
@@ -186,7 +184,7 @@ bool GetAssociatedDocument( wxFrame* frame, const wxString& LibPath,
...
@@ -186,7 +184,7 @@ bool GetAssociatedDocument( wxFrame* frame, const wxString& LibPath,
{
{
msg
.
Printf
(
_
(
"Unknown MIME type for doc file <%s>"
),
msg
.
Printf
(
_
(
"Unknown MIME type for doc file <%s>"
),
fullfilename
.
GetData
()
);
fullfilename
.
GetData
()
);
DisplayError
(
f
rame
,
msg
);
DisplayError
(
aF
rame
,
msg
);
}
}
return
success
;
return
success
;
...
...
common/edaappl.cpp
View file @
e719b42e
...
@@ -540,6 +540,16 @@ void WinEDA_App::SetDefaultSearchPaths( void )
...
@@ -540,6 +540,16 @@ void WinEDA_App::SetDefaultSearchPaths( void )
m_libSearchPaths
.
Add
(
fn
.
GetPath
()
);
m_libSearchPaths
.
Add
(
fn
.
GetPath
()
);
}
}
/* Add schematic doc file path (library/doc)to search path list. */
fn
.
AppendDir
(
wxT
(
"doc"
)
);
if
(
fn
.
IsDirReadable
()
)
{
wxLogDebug
(
wxT
(
"Adding <%s> to library search path list"
),
fn
.
GetPath
().
c_str
()
);
m_libSearchPaths
.
Add
(
fn
.
GetPath
()
);
}
fn
.
RemoveLastDir
();
/* Add kicad template file path to search path list. */
/* Add kicad template file path to search path list. */
fn
.
RemoveLastDir
();
fn
.
RemoveLastDir
();
fn
.
AppendDir
(
wxT
(
"template"
)
);
fn
.
AppendDir
(
wxT
(
"template"
)
);
...
...
cvpcb/cvframe.cpp
View file @
e719b42e
...
@@ -521,7 +521,7 @@ void WinEDA_CvpcbFrame::DisplayDocFile( wxCommandEvent& event )
...
@@ -521,7 +521,7 @@ void WinEDA_CvpcbFrame::DisplayDocFile( wxCommandEvent& event )
else
else
fullfilename
=
FindKicadHelpPath
()
+
wxT
(
"../"
)
+
DocModuleFileName
;
fullfilename
=
FindKicadHelpPath
()
+
wxT
(
"../"
)
+
DocModuleFileName
;
GetAssociatedDocument
(
this
,
wxEmptyString
,
fullfilename
);
GetAssociatedDocument
(
this
,
fullfilename
);
}
}
...
...
eeschema/libframe.cpp
View file @
e719b42e
...
@@ -494,7 +494,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
...
@@ -494,7 +494,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
docfilename
=
CurrentLibEntry
->
m_DocFile
;
docfilename
=
CurrentLibEntry
->
m_DocFile
;
if
(
!
docfilename
.
IsEmpty
()
)
if
(
!
docfilename
.
IsEmpty
()
)
GetAssociatedDocument
(
this
,
g_RealLibDirBuffer
,
docfilename
);
GetAssociatedDocument
(
this
,
docfilename
,
&
wxGetApp
().
GetLibraryPathList
()
);
}
}
break
;
break
;
...
...
eeschema/schedit.cpp
View file @
e719b42e
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "gr_basic.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "common.h"
#include "class_drawpanel.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "confirm.h"
...
@@ -619,9 +620,8 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
...
@@ -619,9 +620,8 @@ void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
wxEmptyString
,
FIND_ALIAS
);
wxEmptyString
,
FIND_ALIAS
);
if
(
LibEntry
&&
LibEntry
->
m_DocFile
!=
wxEmptyString
)
if
(
LibEntry
&&
LibEntry
->
m_DocFile
!=
wxEmptyString
)
{
{
GetAssociatedDocument
(
this
,
GetAssociatedDocument
(
this
,
LibEntry
->
m_DocFile
,
g_RealLibDirBuffer
,
&
wxGetApp
().
GetLibraryPathList
()
);
LibEntry
->
m_DocFile
);
}
}
}
}
break
;
break
;
...
...
eeschema/viewlibs.cpp
View file @
e719b42e
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "gr_basic.h"
#include "common.h"
#include "common.h"
#include "appl_wxstruct.h"
#include "class_drawpanel.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "confirm.h"
#include "eda_doc.h"
#include "eda_doc.h"
...
@@ -59,9 +60,8 @@ void WinEDA_ViewlibFrame::Process_Special_Functions( wxCommandEvent& event )
...
@@ -59,9 +60,8 @@ void WinEDA_ViewlibFrame::Process_Special_Functions( wxCommandEvent& event )
LibEntry
=
FindLibPart
(
g_CurrentViewComponentName
.
GetData
(),
LibEntry
=
FindLibPart
(
g_CurrentViewComponentName
.
GetData
(),
g_CurrentViewLibraryName
.
GetData
(),
FIND_ALIAS
);
g_CurrentViewLibraryName
.
GetData
(),
FIND_ALIAS
);
if
(
LibEntry
&&
(
!
LibEntry
->
m_DocFile
.
IsEmpty
()
)
)
if
(
LibEntry
&&
(
!
LibEntry
->
m_DocFile
.
IsEmpty
()
)
)
GetAssociatedDocument
(
this
,
GetAssociatedDocument
(
this
,
LibEntry
->
m_DocFile
,
g_RealLibDirBuffer
,
&
wxGetApp
().
GetLibraryPathList
());
LibEntry
->
m_DocFile
);
break
;
break
;
case
ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT
:
case
ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT
:
...
...
include/eda_doc.h
View file @
e719b42e
...
@@ -8,19 +8,28 @@
...
@@ -8,19 +8,28 @@
#define __INCLUDE__EDA_DOC_H__ 1
#define __INCLUDE__EDA_DOC_H__ 1
int
KeyWordOk
(
const
wxString
&
KeyList
,
const
wxString
&
Database
);
/* Recherche si dans le texte Database on retrouve tous les mots
/* Recherche si dans le texte Database on retrouve tous les mots
* cles donnes dans KeyList ( KeyList = suite de mots cles
* cles donnes dans KeyList ( KeyList = suite de mots cles
* separes par des espaces
* separes par des espaces
* Retourne:
* Retourne:
* 0 si aucun mot cle trouv
�
* 0 si aucun mot cle trouv
e
* 1 si mot cle trouv
�
* 1 si mot cle trouv
e
*/
*/
bool
GetAssociatedDocument
(
wxFrame
*
frame
,
int
KeyWordOk
(
const
wxString
&
KeyList
,
const
wxString
&
LibPath
,
const
wxString
&
Database
);
const
wxString
&
DocName
);
/** Function GetAssociatedDocument
* open a document (file) with the suitable browser
* @param aFrame = main frame
* @param aDocName = filename of file to open (Full filename or short filename)
* if DocName is starting by http: or ftp: or www. the default internet browser is launched
* @param aPaths = a wxPathList to explore.
* if NULL or aDocName is a full filename, aPath is not used.
*/
bool
GetAssociatedDocument
(
wxFrame
*
aFrame
,
const
wxString
&
aDocName
,
const
wxPathList
*
aPaths
=
NULL
);
#endif
/* __INCLUDE__EDA_DOC_H__ */
#endif
/* __INCLUDE__EDA_DOC_H__ */
...
...
pcbnew/edit.cpp
View file @
e719b42e
...
@@ -1032,7 +1032,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
...
@@ -1032,7 +1032,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
wxString
msg
=
FindKicadHelpPath
();
wxString
msg
=
FindKicadHelpPath
();
msg
+=
cfg
->
Read
(
wxT
(
"module_doc_file"
),
msg
+=
cfg
->
Read
(
wxT
(
"module_doc_file"
),
wxT
(
"pcbnew/footprints.pdf"
)
);
wxT
(
"pcbnew/footprints.pdf"
)
);
GetAssociatedDocument
(
this
,
wxEmptyString
,
msg
);
GetAssociatedDocument
(
this
,
msg
);
}
}
break
;
break
;
...
...
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