KiCad PCB EDA Suite
Loading...
Searching...
No Matches
eda_doc.cpp File Reference
#include <pgm_base.h>
#include <common.h>
#include <confirm.h>
#include <gestfich.h>
#include <settings/common_settings.h>
#include <wx/mimetype.h>
#include <wx/filename.h>
#include <wx/uri.h>
#include <wx/filedlg.h>

Go to the source code of this file.

Functions

bool GetAssociatedDocument (wxWindow *aParent, const wxString &aDocName, PROJECT *aProject, SEARCH_STACK *aPaths)
 Open a document (file) with the suitable browser.
 

Variables

static wxMimeTypesManager * mimeDatabase
 
static const wxFileTypeInfo EDAfallbacks []
 

Function Documentation

◆ GetAssociatedDocument()

bool GetAssociatedDocument ( wxWindow *  aParent,
const wxString &  aDocName,
PROJECT aProject,
SEARCH_STACK aPaths = nullptr 
)

Open a document (file) with the suitable browser.

Environmental variables are substituted before the document name is resolved for either browser or file. If aDocName begins with http: or ftp: or www. the default internet browser is launched.

Parameters
aParentmain frame.
aDocNamefilename of file to open (Full filename or short filename).
aPathsAdditional paths to search for local disk datasheet files

Definition at line 60 of file eda_doc.cpp.

References _, DisplayError(), EDAfallbacks, mimeDatabase, OpenPDF(), ResolveUriByEnvVars(), UNIX_STRING_DIR_SEP, and WIN_STRING_DIR_SEP.

Referenced by FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), FIELDS_GRID_TRICKS::doPopupSelection(), SCH_NAVIGATE_TOOL::HypertextCommand(), TEXT_BUTTON_URL::OnButtonClick(), LIB_TREE::onDetailsLink(), EE_INSPECTION_TOOL::ShowDatasheet(), and COMMON_CONTROL::ShowHelp().

Variable Documentation

◆ EDAfallbacks

const wxFileTypeInfo EDAfallbacks[]
static
Initial value:
=
{
wxFileTypeInfo( wxT( "text/html" ),
wxT( "wxhtml %s" ),
wxT( "wxhtml %s" ),
wxT( "html document (from KiCad)" ),
wxT( "htm" ),
wxT( "html" ),wxNullPtr ),
wxFileTypeInfo( wxT( "application/sch" ),
wxT( "eeschema %s" ),
wxT( "eeschema -p %s" ),
wxT( "sch document (from KiCad)" ),
wxT( "sch" ),
wxT( "SCH" ), wxNullPtr ),
wxFileTypeInfo()
}

Definition at line 39 of file eda_doc.cpp.

Referenced by GetAssociatedDocument().

◆ mimeDatabase

wxMimeTypesManager* mimeDatabase
static

Definition at line 38 of file eda_doc.cpp.

Referenced by GetAssociatedDocument().