25#include <python_manager.h>
81 wxString interpreter = PYTHON_MANAGER::FindPythonInterpreter();
83 if( !interpreter.IsEmpty() )
103 m_stApiStatus->SetLabel( wxString::Format(
_(
"Listening at %s" ),
104 Pgm().GetApiServer().SocketPath() ) );
111 m_stApiStatus->SetLabel(
_(
"This installation of KiCad does not have API support enabled." ) );
120 m_stPythonStatus->SetLabel(
_(
"KiCad API is not enabled; external Python plugins will "
121 "not be available" ) );
129 if( !pythonExe.FileExists() )
131 m_stPythonStatus->SetLabel(
_(
"No valid Python interpreter chosen; external Python "
132 "plugins will not be available" ) );
136 PYTHON_MANAGER manager( pythonExe.GetFullPath() );
138 manager.Execute( wxS(
"--version" ),
139 [&](
int aRetCode,
const wxString& aStdOut,
const wxString& aStdErr )
143 if( aRetCode == 0 && aStdOut.Contains( wxS(
"Python 3" ) ) )
145 msg = wxString::Format(
_(
"Found %s" ), aStdOut );
150 msg =
_(
"Not a valid Python 3 interpreter" );
Class PANEL_PLUGIN_SETTINGS_BASE.
wxFilePickerCtrl * m_pickerPythonInterpreter
wxStaticText * m_stPythonStatus
wxCheckBox * m_cbEnableApi
wxStaticText * m_stApiStatus
void OnPythonInterpreterChanged(wxFileDirPickerEvent &event) override
void validatePythonInterpreter()
bool m_pythonInterpreterValid
void ResetPanel() override
Reset the contents of this panel.
PANEL_PLUGIN_SETTINGS(wxWindow *aParent)
void OnEnableApiChecked(wxCommandEvent &aEvent) override
void OnBtnDetectAutomaticallyClicked(wxCommandEvent &aEvent) override
bool TransferDataFromWindow() override
bool TransferDataToWindow() override
void updateApiStatusText()
virtual SETTINGS_MANAGER & GetSettingsManager() const
COMMON_SETTINGS * GetCommonSettings() const
Retrieves the common settings shared by all applications.
KICOMMON_API wxFont GetInfoFont(wxWindow *aWindow)
PGM_BASE & Pgm()
The global Program "get" accessor.
wxString python_interpreter
Functions to provide common constants and other functions to assist in making a consistent UI.