![]() |
KiCad PCB EDA Suite
|
This file is part of the common library TODO brief description. More...
#include <wx/filename.h>
#include <wx/process.h>
Go to the source code of this file.
Macros | |
#define | UNIX_STRING_DIR_SEP wxT( "/" ) |
#define | WIN_STRING_DIR_SEP wxT( "\\" ) |
Functions | |
bool | OpenPDF (const wxString &file) |
Run the PDF viewer and display a PDF file. More... | |
void | OpenFile (const wxString &file) |
void | PrintFile (const wxString &file) |
bool | CanPrintFile (const wxString &file) |
void | KiCopyFile (const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors) |
wxString | EDA_FILE_SELECTOR (const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition=wxDefaultPosition, wxString *aMruPath=nullptr) |
A helper function that wraps a call to wxFileSelector. More... | |
int | ExecuteFile (wxWindow *frame, const wxString &ExecFile, const wxString ¶m=wxEmptyString, wxProcess *callback=nullptr) |
Call the executable file ExecFile with the command line parameters param. More... | |
void | AddDelimiterString (wxString &string) |
Add un " to the start and the end of string (if not already done). More... | |
wxString | FindKicadFile (const wxString &shortname) |
Search the executable file shortname in KiCad binary path and return full file name if found or shortname if the kicad binary path is kicad/bin. More... | |
wxString | QuoteFullPath (wxFileName &fn, wxPathFormat format=wxPATH_NATIVE) |
Quote return value of wxFileName::GetFullPath(). More... | |
This file is part of the common library TODO brief description.
Definition in file gestfich.h.
#define UNIX_STRING_DIR_SEP wxT( "/" ) |
Definition at line 43 of file gestfich.h.
#define WIN_STRING_DIR_SEP wxT( "\\" ) |
Definition at line 44 of file gestfich.h.
void AddDelimiterString | ( | wxString & | string | ) |
Add un " to the start and the end of string (if not already done).
string | string to modify. |
Definition at line 42 of file gestfich.cpp.
Referenced by KICAD_MANAGER_CONTROL::Execute(), ExecuteFile(), LaunchExternal(), DIALOG_BOM::OnEditGenerator(), PROJECT_TREE_PANE::onOpenDirectory(), PROJECT_TREE_PANE::onOpenSelectedFileWithTextEditor(), and PCB_EDIT_FRAME::PythonPluginsShowFolder().
bool CanPrintFile | ( | const wxString & | file | ) |
Definition at line 357 of file gestfich.cpp.
References doPrintFile().
Referenced by PROJECT_TREE_PANE::onRight().
wxString EDA_FILE_SELECTOR | ( | const wxString & | aTitle, |
const wxString & | aPath, | ||
const wxString & | aFileName, | ||
const wxString & | aExtension, | ||
const wxString & | aWildcard, | ||
wxWindow * | aParent, | ||
int | aStyle, | ||
const bool | aKeepWorkingDirectory, | ||
const wxPoint & | aPosition = wxDefaultPosition , |
||
wxString * | aMruPath = nullptr |
||
) |
A helper function that wraps a call to wxFileSelector.
aTitle | is a string to display in the dialog title bar. |
aPath | is a string contain the default path for the path dialog. |
aFileName | is a string containing the default file name. |
aExtension | is a string containing the default file extension. |
aWildcard | is a string containing the default wildcard. |
aParent | is the parent window of the dialog. |
aStyle | is the style of the path dialog, wxFD_???. |
aKeepWorkingDirectory | determines if current working directory should be set to the user selected path. |
aPosition | is the position of the dialog. |
aMruPath | is a pointer to a string to copy the path selected by the user when the OK button is pressed to dismiss the dialog. This can be NULL. |
Definition at line 52 of file gestfich.cpp.
References NULL.
Referenced by PGM_BASE::AskUserForPreferredEditor(), DIALOG_BOM::chooseGenerator(), PANEL_HOTKEYS_EDITOR::dumpHotkeys(), BOARD_EDITOR_CONTROL::ExportSpecctraDSN(), SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG(), GetAssociatedDocument(), PANEL_HOTKEYS_EDITOR::ImportHotKeys(), BOARD_EDITOR_CONTROL::ImportSpecctraSession(), NETLIST_DIALOG_ADD_GENERATOR::OnBrowseGenerators(), and MWAVE_POLYGONAL_SHAPE_DLG::ReadDataShapeDescr().
int ExecuteFile | ( | wxWindow * | frame, |
const wxString & | ExecFile, | ||
const wxString & | param = wxEmptyString , |
||
wxProcess * | callback = nullptr |
||
) |
Call the executable file ExecFile with the command line parameters param.
Definition at line 165 of file gestfich.cpp.
References _, AddDelimiterString(), DisplayError(), FindKicadFile(), and ProcessExecute().
Referenced by KICAD_MANAGER_CONTROL::Execute(), DIALOG_CONFIG_EQUFILES::OnEditEquFile(), DIALOG_BOM::OnEditGenerator(), SCH_EDIT_FRAME::OnOpenPcbnew(), PROJECT_TREE_PANE::onOpenSelectedFileWithTextEditor(), PCB_EDIT_FRAME::RunEeschema(), and GERBVIEW_INSPECTION_TOOL::ShowSource().
wxString FindKicadFile | ( | const wxString & | shortname | ) |
Search the executable file shortname in KiCad binary path and return full file name if found or shortname if the kicad binary path is kicad/bin.
The binary path is found from:
Definition at line 102 of file gestfich.cpp.
References arrayDim(), and Pgm().
Referenced by ExecuteFile().
void KiCopyFile | ( | const wxString & | aSrcPath, |
const wxString & | aDestPath, | ||
wxString & | aErrors | ||
) |
aSrcPath | is the full filename of the source. |
aDestPath | is the full filename of the target |
aErrors | a wxString to append any errors to |
Definition at line 363 of file gestfich.cpp.
References _.
Referenced by CreateWindow(), IfaceOrAddress(), SAVE_AS_TRAVERSER::OnFile(), MIGRATION_TRAVERSER::OnFile(), and SCH::IFACE::SaveFileAs().
void OpenFile | ( | const wxString & | file | ) |
Definition at line 257 of file gestfich.cpp.
References ProcessExecute().
Referenced by PROJECT_TREE_ITEM::Activate().
bool OpenPDF | ( | const wxString & | file | ) |
Run the PDF viewer and display a PDF file.
file | the PDF file to open. |
Definition at line 196 of file gestfich.cpp.
References _, DisplayError(), NULL, Pgm(), and ProcessExecute().
Referenced by PROJECT_TREE_ITEM::Activate(), and GetAssociatedDocument().
void PrintFile | ( | const wxString & | file | ) |
Definition at line 351 of file gestfich.cpp.
References doPrintFile().
Referenced by PROJECT_TREE_ITEM::Print().
wxString QuoteFullPath | ( | wxFileName & | fn, |
wxPathFormat | format = wxPATH_NATIVE |
||
) |
Quote return value of wxFileName::GetFullPath().
This allows file name paths with spaces to be used as parameters to ProcessExecute function calls.
fn | is the filename to wrap. |
format | if provided, can be used to transform the nature of the wrapped filename to another platform. |
Definition at line 378 of file gestfich.cpp.
Referenced by SCH_EDIT_FRAME::OnOpenPcbnew(), and GERBVIEW_INSPECTION_TOOL::ShowSource().