from Florian Delizy
This patch applies on the very last svn (r2402) and removes all disfunctionnal python code (including deletion of unused strings)
This commit is contained in:
parent
47bfe663fd
commit
52dbb13c2f
|
@ -23,9 +23,6 @@ option(USE_WX_ZOOM "Use wxDC to perform zooming (default OFF). Warning, this is
|
|||
option(USE_WX_GRAPHICS_CONTEXT
|
||||
"Use wxGraphicsContext for rendering (default OFF). Warning, this is experimental")
|
||||
|
||||
# Comment this out if you don't want to build with Python support.
|
||||
# OPTION(KICAD_PYTHON "enable/disable building with Python support (default OFF)")
|
||||
|
||||
|
||||
#================================================
|
||||
# Set flags for GCC.
|
||||
|
|
|
@ -210,8 +210,6 @@ These should be set from command line:
|
|||
|
||||
KICAD_MINIZIP ON/OFF
|
||||
|
||||
KICAD_PYTHON ON/OFF
|
||||
|
||||
USE_WX_ZOOM ON/OFF (OPTIONAL)
|
||||
Experimental coordinate translation code using wxDC instead of custom
|
||||
Kicad version.
|
||||
|
|
|
@ -163,9 +163,6 @@ configured and builded with "--disable-monolithic --enable-shared" parameters.
|
|||
-DKICAD_MINIZIP=ON
|
||||
Build the "minizip" executable. Use OFF to disable it building.
|
||||
|
||||
-DKICAD_PYTHON=ON
|
||||
Build the KiCad with Python support.
|
||||
|
||||
-DwxUSE_UNICODE=ON
|
||||
Require on locale utf8 for build the KiCad with cyrillic fonts support.
|
||||
|
||||
|
|
1
TODO.txt
1
TODO.txt
|
@ -4,7 +4,6 @@ KiCad TODO List
|
|||
CMAKE
|
||||
-----
|
||||
* Add install targets for binaries and resources on Mac.
|
||||
* Add Python.
|
||||
|
||||
WXMAC Platform
|
||||
--------------
|
||||
|
|
|
@ -157,8 +157,6 @@ set(BITMAP_SRCS
|
|||
icon_kicad.xpm
|
||||
icon_modedit.xpm
|
||||
icon_pcbnew.xpm
|
||||
icon_python_small.xpm
|
||||
icon_python.xpm
|
||||
icon_txt.xpm
|
||||
import3d.xpm
|
||||
import_hierarchical_label.xpm
|
||||
|
@ -258,7 +256,6 @@ set(BITMAP_SRCS
|
|||
New_Module.xpm
|
||||
new_pcb.xpm
|
||||
New_Project.xpm
|
||||
new_python.xpm
|
||||
new_sch.xpm
|
||||
new_txt.xpm
|
||||
new.xpm
|
||||
|
|
|
@ -9,10 +9,6 @@
|
|||
* (locale handling)
|
||||
***/
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
# include <pyhandler.h>
|
||||
#endif
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "wx/html/htmlwin.h"
|
||||
|
@ -334,9 +330,6 @@ void WinEDA_App::InitEDA_Appl( const wxString& aName, id_app_type aId )
|
|||
/* Set locale option for separator used in float numbers */
|
||||
SetLocaleTo_Default();
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
PyHandler::GetInstance()->SetAppName( name );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -1129,17 +1122,3 @@ void WinEDA_App::InsertLibraryPath( const wxString& aPaths, size_t aIndex )
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Run Python scripts
|
||||
*
|
||||
* @return The default OnRun() value (exit codes not used in kicad, so value
|
||||
* has no special meaning)
|
||||
*/
|
||||
int WinEDA_App::OnRun()
|
||||
{
|
||||
#ifdef KICAD_PYTHON
|
||||
PyHandler::GetInstance()->RunScripts();
|
||||
#endif
|
||||
return wxApp::OnRun();
|
||||
}
|
||||
|
|
|
@ -77,7 +77,6 @@ protected:
|
|||
public: WinEDA_App();
|
||||
~WinEDA_App();
|
||||
bool OnInit();
|
||||
int OnRun();
|
||||
|
||||
bool SetBinDir();
|
||||
void SetDefaultSearchPaths( void );
|
||||
|
|
|
@ -147,8 +147,6 @@ extern const char* icon_eeschema_xpm[];
|
|||
extern const char* icon_gerbview_small_xpm[];
|
||||
extern const char* icon_gerbview_xpm[];
|
||||
extern const char* icon_modedit_xpm[];
|
||||
extern const char* icon_python_small_xpm[];
|
||||
extern const char* icon_python_xpm[];
|
||||
extern const char* icon_txt_xpm[];
|
||||
extern const char* icon_w3d_xpm[];
|
||||
extern const char* import_hierarchical_label_xpm[];
|
||||
|
|
|
@ -107,10 +107,6 @@ public:
|
|||
const wxString& title,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
|
||||
#ifdef KICAD_PYTHON
|
||||
WinEDA_BasicFrame( const WinEDA_BasicFrame& ) { } // Should throw!!
|
||||
WinEDA_BasicFrame() { } // Should throw!!
|
||||
#endif
|
||||
~WinEDA_BasicFrame();
|
||||
|
||||
void GetKicadHelp( wxCommandEvent& event );
|
||||
|
|
|
@ -547,10 +547,6 @@ msgstr "Součástka %s %s vývod %s : Rozdílné sítě"
|
|||
msgid "&Run"
|
||||
msgstr "&Spustit"
|
||||
|
||||
#: /home/martin/kicad/kicad/treeprj_frame.cpp:127
|
||||
msgid "Run the Python Script"
|
||||
msgstr "Spustit Python skript"
|
||||
|
||||
#: /home/martin/kicad/kicad/treeprj_frame.cpp:136
|
||||
#: /home/martin/kicad/kicad/treeprj_frame.cpp:211
|
||||
msgid "&Edit in a text editor"
|
||||
|
@ -572,10 +568,6 @@ msgstr "Vytvořit nový adresář"
|
|||
msgid "New P&ython Script"
|
||||
msgstr "Nový P&ython skript"
|
||||
|
||||
#: /home/martin/kicad/kicad/treeprj_frame.cpp:165
|
||||
msgid "Create a New Python Script"
|
||||
msgstr "Vytvořit nový Python skript"
|
||||
|
||||
#: /home/martin/kicad/kicad/treeprj_frame.cpp:174
|
||||
msgid "New &Text File"
|
||||
msgstr "Nový &textový soubor"
|
||||
|
@ -876,14 +868,6 @@ msgstr ""
|
|||
"Připraven\n"
|
||||
"Pracovní adresář: %s\n"
|
||||
|
||||
#: /home/martin/kicad/kicad/mainframe.cpp:307
|
||||
msgid "Execute Python Script"
|
||||
msgstr "Spustit Python skript:"
|
||||
|
||||
#: /home/martin/kicad/kicad/mainframe.cpp:308
|
||||
msgid "Python script (*.py)|*.py"
|
||||
msgstr "Python skript (*.py)|*.py"
|
||||
|
||||
#: /home/martin/kicad/kicad/mainframe.cpp:326
|
||||
msgid "Text file ("
|
||||
msgstr "Textový soubor ("
|
||||
|
@ -908,10 +892,6 @@ msgstr "Pcbnew (editor desek)"
|
|||
msgid "GerbView (Gerber viewer)"
|
||||
msgstr "GerbView (prohlížeč Gerber)"
|
||||
|
||||
#: /home/martin/kicad/kicad/commandframe.cpp:74
|
||||
msgid "Run Python Script"
|
||||
msgstr "Spustit Python skript"
|
||||
|
||||
#: /home/martin/kicad/kicad/preferences.cpp:48
|
||||
msgid "You must choose a PDF viewer before use this option"
|
||||
msgstr "Před použitím musíte zvolit PDF prohlížeč"
|
||||
|
|
|
@ -5447,14 +5447,6 @@ msgstr ""
|
|||
"Bereit\n"
|
||||
"Arbeitsverzeichnis: %s\n"
|
||||
|
||||
#: kicad/mainframe.cpp:307
|
||||
msgid "Execute Python Script"
|
||||
msgstr "Führe Python Skript aus"
|
||||
|
||||
#: kicad/mainframe.cpp:308
|
||||
msgid "Python script (*.py)|*.py"
|
||||
msgstr "Python Skript (*.py)|*.py"
|
||||
|
||||
#: kicad/mainframe.cpp:326
|
||||
msgid "Text file ("
|
||||
msgstr "Textdatei ("
|
||||
|
@ -5694,10 +5686,6 @@ msgstr ""
|
|||
msgid "&Run"
|
||||
msgstr "&Starte"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:125
|
||||
msgid "Run the Python Script"
|
||||
msgstr "Starte das Python Skript"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:134
|
||||
#: kicad/treeprj_frame.cpp:209
|
||||
msgid "&Edit in a text editor"
|
||||
|
@ -5719,10 +5707,6 @@ msgstr "Erstelle ein neues Verzeichnis"
|
|||
msgid "New P&ython Script"
|
||||
msgstr "Neues P&ython Skript"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:163
|
||||
msgid "Create a New Python Script"
|
||||
msgstr "Erstelle ein neues Pythonskript"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:172
|
||||
msgid "New &Text File"
|
||||
msgstr "Neue &Textdatei"
|
||||
|
@ -5845,10 +5829,6 @@ msgstr "PCBnew (Layouteditor)"
|
|||
msgid "GerbView (Gerber viewer)"
|
||||
msgstr "GerbView (Gerber-Betrachter)"
|
||||
|
||||
#: kicad/commandframe.cpp:67
|
||||
msgid "Run Python Script"
|
||||
msgstr "Starte Python Skript"
|
||||
|
||||
#: pcbnew/edit.cpp:253
|
||||
msgid "Module Editor"
|
||||
msgstr "Bauteil Editor"
|
||||
|
|
|
@ -9077,10 +9077,6 @@ msgstr "Pcbnew (Editor de circuitos impresos)"
|
|||
msgid "GerbView (Gerber viewer)"
|
||||
msgstr "GerbView (Visualizador Gerber)"
|
||||
|
||||
#: kicad/commandframe.cpp:78
|
||||
msgid "Run Python Script"
|
||||
msgstr "Ejecutar Script Python:"
|
||||
|
||||
#: kicad/files-io.cpp:70
|
||||
msgid "Create Project files:"
|
||||
msgstr "Crear proyecto"
|
||||
|
@ -9159,10 +9155,6 @@ msgstr ""
|
|||
"Listo\n"
|
||||
"Directorio de trabajo: %s\n"
|
||||
|
||||
#: kicad/mainframe.cpp:338
|
||||
msgid "Execute Python Script:"
|
||||
msgstr "Ejecutar Script Python:"
|
||||
|
||||
#: kicad/mainframe.cpp:361
|
||||
msgid "Load file:"
|
||||
msgstr "Cargar Archivo:"
|
||||
|
@ -9249,10 +9241,6 @@ msgstr "En este directorio no hay archivos kicad"
|
|||
msgid "&Run"
|
||||
msgstr "Ejecuta&r"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:95
|
||||
msgid "Run the Python Script"
|
||||
msgstr "Ejecutar el Script de Python"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:102
|
||||
#: kicad/treeprj_frame.cpp:156
|
||||
msgid "&Edit in a text editor"
|
||||
|
@ -9274,11 +9262,6 @@ msgstr "Crear Directorio"
|
|||
msgid "New P&ython Script"
|
||||
msgstr "Nuevo Script de P&ython"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:125
|
||||
msgid "Create a New Python Script"
|
||||
msgstr "Crear Script de Python"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:131
|
||||
msgid "New &Text File"
|
||||
msgstr "Nuevo Archivo de Texto: "
|
||||
|
||||
|
|
|
@ -11168,14 +11168,6 @@ msgstr ""
|
|||
"Valmis\n"
|
||||
"Työhakemisto: %s\n"
|
||||
|
||||
#: kicad/mainframe.cpp:231
|
||||
msgid "Execute Python Script"
|
||||
msgstr "Suorita Python-komentosarja"
|
||||
|
||||
#: kicad/mainframe.cpp:232
|
||||
msgid "Python script (*.py)|*.py"
|
||||
msgstr "Python-komentosarja (*.py)|*.py"
|
||||
|
||||
#: kicad/mainframe.cpp:253
|
||||
msgid "Text file ("
|
||||
msgstr "Tekstitiedosto ("
|
||||
|
@ -11200,18 +11192,10 @@ msgstr "PCBnew (Piirilevyeditori)"
|
|||
msgid "GerbView (Gerber viewer)"
|
||||
msgstr "GerbView (Gerber-tiedostojen näytin)"
|
||||
|
||||
#: kicad/commandframe.cpp:91
|
||||
msgid "Run Python Script"
|
||||
msgstr "Suorita Python-komentosarja"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:157
|
||||
msgid "&Run"
|
||||
msgstr "&Käynnistä"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:158
|
||||
msgid "Run the Python Script"
|
||||
msgstr "Suorita Python-komentosarja"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:167
|
||||
#: kicad/tree_project_frame.cpp:224
|
||||
msgid "&Edit in a text editor"
|
||||
|
@ -11229,14 +11213,6 @@ msgstr "Uusi &hakemisto"
|
|||
msgid "Create a New Directory"
|
||||
msgstr "Luo uusi hakemisto"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:195
|
||||
msgid "New P&ython Script"
|
||||
msgstr "Uusi &Python-komentosarja"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:196
|
||||
msgid "Create a New Python Script"
|
||||
msgstr "Luo uusi Python-komentosarja"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:211
|
||||
msgid "&Rename file"
|
||||
msgstr "&Nimeä tiedosto uudelleen"
|
||||
|
|
|
@ -11517,14 +11517,6 @@ msgstr ""
|
|||
"Prêt\n"
|
||||
"Répertoire de travail: %s\n"
|
||||
|
||||
#: kicad/mainframe.cpp:231
|
||||
msgid "Execute Python Script"
|
||||
msgstr "Executer un Script Python"
|
||||
|
||||
#: kicad/mainframe.cpp:232
|
||||
msgid "Python script (*.py)|*.py"
|
||||
msgstr "Script Python (*.py)|*.py"
|
||||
|
||||
#: kicad/mainframe.cpp:253
|
||||
msgid "Text file ("
|
||||
msgstr "Fichier Texte ("
|
||||
|
@ -11549,10 +11541,6 @@ msgstr "PCBnew (Editeur de circuits imprimés)"
|
|||
msgid "GerbView (Gerber viewer)"
|
||||
msgstr "GerbView (Visualisateur Gerber)"
|
||||
|
||||
#: kicad/commandframe.cpp:91
|
||||
msgid "Run Python Script"
|
||||
msgstr "Exécuter le Script Python"
|
||||
|
||||
#: kicad/preferences.cpp:47
|
||||
msgid "You must choose a PDF viewer before using this option."
|
||||
msgstr "Vous devez choisir un Visualisateur PDF avant d'utiliser cette option."
|
||||
|
@ -11577,10 +11565,6 @@ msgstr "Sélection Editeur Préféré"
|
|||
msgid "&Run"
|
||||
msgstr "Exécute&r"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:158
|
||||
msgid "Run the Python Script"
|
||||
msgstr "Exécuter le Script Python"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:167
|
||||
#: kicad/tree_project_frame.cpp:224
|
||||
msgid "&Edit in a text editor"
|
||||
|
@ -11602,10 +11586,6 @@ msgstr "Créer un nouveau Répertoire"
|
|||
msgid "New P&ython Script"
|
||||
msgstr "Nouveau Script P&ython"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:196
|
||||
msgid "Create a New Python Script"
|
||||
msgstr "Créer un nouveau script Python"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:211
|
||||
msgid "&Rename file"
|
||||
msgstr "&Renommer fichier"
|
||||
|
|
|
@ -9304,18 +9304,10 @@ msgstr "사용자 크기"
|
|||
msgid "&Run"
|
||||
msgstr "실행 (&R)"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:64
|
||||
msgid "Run the Python Script"
|
||||
msgstr "Python 스크립트 실행"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:70
|
||||
msgid "&Edit in a text editor"
|
||||
msgstr "텍스트 에디터로 편집 (&E)"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:71
|
||||
msgid "Edit the Python Script in a Text Editor"
|
||||
msgstr "텍스트 에디터로 Python 스크립트 편집"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:84
|
||||
msgid "New D&irectory"
|
||||
msgstr "새 디렉토리 (&I)"
|
||||
|
@ -9356,14 +9348,6 @@ msgstr "새 네트리스트 (&N)"
|
|||
msgid "Create a New Netlist"
|
||||
msgstr "새 네트리스트 만들기"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:107
|
||||
msgid "New P&ython Script"
|
||||
msgstr "새 Python 스크립트 (&Y)"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:107
|
||||
msgid "Create a New Python Script"
|
||||
msgstr "새 Python 스크립트 만들기"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:112
|
||||
msgid "New &Text File"
|
||||
msgstr "새 텍스트 파일 (&T)"
|
||||
|
|
|
@ -10628,10 +10628,6 @@ msgstr "naamloos"
|
|||
msgid "&Run"
|
||||
msgstr "&Uitvoeren"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:124
|
||||
msgid "Run the Python Script"
|
||||
msgstr "Uitvoeren van Python Script"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:133
|
||||
#: kicad/treeprj_frame.cpp:208
|
||||
msgid "&Edit in a text editor"
|
||||
|
@ -10653,10 +10649,6 @@ msgstr "Creëer een Nieuwe Map"
|
|||
msgid "New P&ython Script"
|
||||
msgstr "Nieuw P&ython Script"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:162
|
||||
msgid "Create a New Python Script"
|
||||
msgstr "Creëer een Nieuw Python Script"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:171
|
||||
msgid "New &Text File"
|
||||
msgstr "Nieuw &Tekst Bestand"
|
||||
|
@ -10770,10 +10762,6 @@ msgstr "PCBnew (Printplaat ontwerper)"
|
|||
msgid "GerbView (Gerber viewer)"
|
||||
msgstr "GerbView (Gerber viewer)"
|
||||
|
||||
#: kicad/commandframe.cpp:91
|
||||
msgid "Run Python Script"
|
||||
msgstr "Start Python Script"
|
||||
|
||||
#: kicad/mainframe.cpp:82
|
||||
#, c-format
|
||||
msgid ""
|
||||
|
@ -10783,14 +10771,6 @@ msgstr ""
|
|||
"Klaar\n"
|
||||
"Huidige map: %s\n"
|
||||
|
||||
#: kicad/mainframe.cpp:275
|
||||
msgid "Execute Python Script"
|
||||
msgstr "Python Script Uitvoeren"
|
||||
|
||||
#: kicad/mainframe.cpp:276
|
||||
msgid "Python script (*.py)|*.py"
|
||||
msgstr "Python script (*.py)|*.py"
|
||||
|
||||
#: kicad/mainframe.cpp:297
|
||||
msgid "Text file ("
|
||||
msgstr "Tekst bestand ("
|
||||
|
|
|
@ -10145,15 +10145,6 @@ msgstr ""
|
|||
"Gotowy\n"
|
||||
"Katalog roboczy: %s\n"
|
||||
|
||||
#: kicad/kicad/mainframe.cpp:307
|
||||
#, fuzzy
|
||||
msgid "Execute Python Script"
|
||||
msgstr "Wykonaj skrypt Pythona:"
|
||||
|
||||
#: kicad/kicad/mainframe.cpp:308
|
||||
msgid "Python script (*.py)|*.py"
|
||||
msgstr ""
|
||||
|
||||
#: kicad/kicad/mainframe.cpp:326
|
||||
#, fuzzy
|
||||
msgid "Text file ("
|
||||
|
@ -10228,10 +10219,6 @@ msgstr ""
|
|||
msgid "&Run"
|
||||
msgstr "&Uruchom"
|
||||
|
||||
#: kicad/kicad/treeprj_frame.cpp:127
|
||||
msgid "Run the Python Script"
|
||||
msgstr "Uruchom skrypt Pythona"
|
||||
|
||||
#: kicad/kicad/treeprj_frame.cpp:136
|
||||
#: kicad/kicad/treeprj_frame.cpp:211
|
||||
msgid "&Edit in a text editor"
|
||||
|
@ -10253,10 +10240,6 @@ msgstr "Utwórz nowy katalog"
|
|||
msgid "New P&ython Script"
|
||||
msgstr "Nowy skrypt P&ythona"
|
||||
|
||||
#: kicad/kicad/treeprj_frame.cpp:165
|
||||
msgid "Create a New Python Script"
|
||||
msgstr "Utwórz nowy skrypt Pythona"
|
||||
|
||||
#: kicad/kicad/treeprj_frame.cpp:174
|
||||
msgid "New &Text File"
|
||||
msgstr "Nowy plik &tekstowy"
|
||||
|
@ -10381,10 +10364,6 @@ msgstr "Pcbnew (edytor płytek drukowanych)"
|
|||
msgid "GerbView (Gerber viewer)"
|
||||
msgstr "Gerbview (przeglądarka plików Gerbera)"
|
||||
|
||||
#: kicad/kicad/commandframe.cpp:74
|
||||
msgid "Run Python Script"
|
||||
msgstr "Uruchom skrypt Pythona"
|
||||
|
||||
#: kicad/kicad/buildmnu.cpp:98
|
||||
msgid "&Open\tCtrl+O"
|
||||
msgstr ""
|
||||
|
|
|
@ -12096,10 +12096,6 @@ msgstr "Pcbnew (Editor de placas de circuito impresso)"
|
|||
msgid "GerbView (Gerber viewer)"
|
||||
msgstr "GerbView (Visualisador de arquivos Gerber)"
|
||||
|
||||
#: kicad/commandframe.cpp:91
|
||||
msgid "Run Python Script"
|
||||
msgstr "Rodar Script Python"
|
||||
|
||||
#: kicad/files-io.cpp:50
|
||||
msgid "Unzip Project"
|
||||
msgstr "Descomprimir Projeto"
|
||||
|
@ -12176,14 +12172,6 @@ msgstr ""
|
|||
"Pronto\n"
|
||||
"Diretório de trabalho: %s\n"
|
||||
|
||||
#: kicad/mainframe.cpp:230
|
||||
msgid "Execute Python Script"
|
||||
msgstr "Executar Script Python"
|
||||
|
||||
#: kicad/mainframe.cpp:231
|
||||
msgid "Python script (*.py)|*.py"
|
||||
msgstr "Script Python (*.py)|*.py"
|
||||
|
||||
#: kicad/mainframe.cpp:252
|
||||
msgid "Text file ("
|
||||
msgstr "Arquivo de texto ("
|
||||
|
@ -12376,10 +12364,6 @@ msgstr "nenhum arquivo Kicad encontrado neste diret
|
|||
msgid "&Run"
|
||||
msgstr "&Executar"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:127
|
||||
msgid "Run the Python Script"
|
||||
msgstr "Rodar o Script Python"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:136
|
||||
#: kicad/treeprj_frame.cpp:211
|
||||
msgid "&Edit in a text editor"
|
||||
|
@ -12401,10 +12385,6 @@ msgstr "Criar Novo Diret
|
|||
msgid "New P&ython Script"
|
||||
msgstr "Novo Script P&ython"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:165
|
||||
msgid "Create a New Python Script"
|
||||
msgstr "Criar um Novo Script Python"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:174
|
||||
msgid "New &Text File"
|
||||
msgstr "Novo Arquivo &Texto"
|
||||
|
|
|
@ -4975,14 +4975,6 @@ msgstr ""
|
|||
"Готово\n"
|
||||
"Рабочая папка: %s\n"
|
||||
|
||||
#: kicad/mainframe.cpp:231
|
||||
msgid "Execute Python Script"
|
||||
msgstr "Выполнить скрипт Python"
|
||||
|
||||
#: kicad/mainframe.cpp:232
|
||||
msgid "Python script (*.py)|*.py"
|
||||
msgstr "Python script (*.py)|*.py"
|
||||
|
||||
#: kicad/mainframe.cpp:253
|
||||
msgid "Text file ("
|
||||
msgstr "Текстовый файл ("
|
||||
|
@ -5230,18 +5222,10 @@ msgstr "pcbnew (редактор плат)"
|
|||
msgid "GerbView (Gerber viewer)"
|
||||
msgstr "gerbview (программа просмотра Gerber файлов)"
|
||||
|
||||
#: kicad/commandframe.cpp:91
|
||||
msgid "Run Python Script"
|
||||
msgstr "Выполнить скрипт Python"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:157
|
||||
msgid "&Run"
|
||||
msgstr "Выполнить"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:158
|
||||
msgid "Run the Python Script"
|
||||
msgstr "Выполнить скрипт Python"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:167
|
||||
#: kicad/tree_project_frame.cpp:224
|
||||
msgid "&Edit in a text editor"
|
||||
|
@ -5259,14 +5243,6 @@ msgstr "Новая директория"
|
|||
msgid "Create a New Directory"
|
||||
msgstr "Создать новую директорию"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:195
|
||||
msgid "New P&ython Script"
|
||||
msgstr "Новый скрипт Python"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:196
|
||||
msgid "Create a New Python Script"
|
||||
msgstr "Создать новый скрипт Python"
|
||||
|
||||
#: kicad/tree_project_frame.cpp:211
|
||||
msgid "&Rename file"
|
||||
msgstr "Переименовать файл"
|
||||
|
|
|
@ -4893,10 +4893,6 @@ msgstr "Spara projektfil"
|
|||
msgid "&Run"
|
||||
msgstr "&Kör"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:77
|
||||
msgid "Run the Python Script"
|
||||
msgstr ""
|
||||
|
||||
#: kicad/treeprj_frame.cpp:84
|
||||
#: kicad/treeprj_frame.cpp:138
|
||||
msgid "&Edit in a text editor"
|
||||
|
@ -4918,10 +4914,6 @@ msgstr "Skapa en ny mapp"
|
|||
msgid "New P&ython Script"
|
||||
msgstr "Nyt P&ythons-skript"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:107
|
||||
msgid "Create a New Python Script"
|
||||
msgstr ""
|
||||
|
||||
#: kicad/treeprj_frame.cpp:113
|
||||
msgid "New &Text File"
|
||||
msgstr "Ny &textfil"
|
||||
|
@ -5036,10 +5028,6 @@ msgid ""
|
|||
"Working dir: %s\n"
|
||||
msgstr ""
|
||||
|
||||
#: kicad/mainframe.cpp:330
|
||||
msgid "Execute Python Script:"
|
||||
msgstr ""
|
||||
|
||||
#: kicad/mainframe.cpp:353
|
||||
msgid "Load file:"
|
||||
msgstr ""
|
||||
|
@ -5060,10 +5048,6 @@ msgstr "pcbnew (PCB-redigerare)"
|
|||
msgid "gerbview (Gerber viewer)"
|
||||
msgstr "gerbview (Gerber-visare)"
|
||||
|
||||
#: kicad/commandframe.cpp:78
|
||||
msgid "Run Python Script"
|
||||
msgstr ""
|
||||
|
||||
#: pcbnew/dialog_track_options.cpp:125
|
||||
msgid "Via Size"
|
||||
msgstr ""
|
||||
|
|
|
@ -8831,10 +8831,6 @@ msgstr "打开 cvpcb 手册"
|
|||
msgid "&Run"
|
||||
msgstr "运行 (&R)"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:79
|
||||
msgid "Run the Python Script"
|
||||
msgstr "运行 Python 脚本"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:86
|
||||
#: kicad/treeprj_frame.cpp:140
|
||||
msgid "&Edit in a text editor"
|
||||
|
@ -8856,10 +8852,6 @@ msgstr "建立一个新目录"
|
|||
msgid "New P&ython Script"
|
||||
msgstr "新建 P&ython 脚本"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:109
|
||||
msgid "Create a New Python Script"
|
||||
msgstr "建立一个新的 Python 脚本文件"
|
||||
|
||||
#: kicad/treeprj_frame.cpp:115
|
||||
msgid "New &Text File"
|
||||
msgstr "新建文本文件 (&T)"
|
||||
|
@ -9180,10 +9172,6 @@ msgstr ""
|
|||
"就绪\n"
|
||||
"工作目录: %s\n"
|
||||
|
||||
#: kicad/mainframe.cpp:334
|
||||
msgid "Execute Python Script:"
|
||||
msgstr "运行 Python 脚本: "
|
||||
|
||||
#: kicad/mainframe.cpp:357
|
||||
msgid "Load file:"
|
||||
msgstr "加载文件: "
|
||||
|
@ -9212,10 +9200,6 @@ msgstr ""
|
|||
"gerbview\n"
|
||||
"(Gerber 文件查看程序)"
|
||||
|
||||
#: kicad/commandframe.cpp:78
|
||||
msgid "Run Python Script"
|
||||
msgstr "运行 Python 脚本"
|
||||
|
||||
#: kicad/prjconfig.cpp:26
|
||||
msgid "Project File <"
|
||||
msgstr "工程文件 <"
|
||||
|
|
|
@ -10,7 +10,6 @@ set(KICAD_SRCS
|
|||
commandframe.cpp
|
||||
files-io.cpp
|
||||
kicad.cpp
|
||||
kicad-python.cpp
|
||||
mainframe.cpp
|
||||
menubar.cpp
|
||||
preferences.cpp
|
||||
|
|
|
@ -5,10 +5,6 @@
|
|||
* store info about a file or directory shown in the Kicad tree project files
|
||||
*/
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
#include <pyhandler.h>
|
||||
#endif
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "gestfich.h"
|
||||
|
@ -42,22 +38,6 @@ TREEPROJECT_ITEM::TREEPROJECT_ITEM( enum TreeFileType type, const wxString& data
|
|||
m_WasPopulated = false;
|
||||
}
|
||||
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
using namespace boost::python;
|
||||
|
||||
// Convert the data to an id
|
||||
object TREEPROJECT_ITEM::GetIdPy() const
|
||||
{
|
||||
wxTreeItemId* id = new wxTreeItemId();
|
||||
|
||||
*id = GetId();
|
||||
return object( handle<>( borrowed( wxPyConstructObject( id,
|
||||
wxT( "wxTreeItemId" ),
|
||||
true ) ) ) );
|
||||
}
|
||||
#endif
|
||||
|
||||
// Set the state used in the icon list
|
||||
void TREEPROJECT_ITEM::SetState( int state )
|
||||
{
|
||||
|
@ -150,12 +130,6 @@ void TREEPROJECT_ITEM::Move( TREEPROJECT_ITEM* dest )
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
object param = make_tuple( PyHandler::Convert( m_FileName ),
|
||||
PyHandler::Convert( destName ) );
|
||||
PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::MoveFile" ), param );
|
||||
#endif
|
||||
|
||||
SetFileName( destName );
|
||||
|
||||
if( TREE_DIRECTORY != GetType() )
|
||||
|
@ -232,11 +206,6 @@ type.\n Do you want to continue ?" ),
|
|||
}
|
||||
SetFileName( newFile );
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
object param = make_tuple( PyHandler::Convert( m_FileName ),
|
||||
PyHandler::Convert( newFile ) );
|
||||
PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::RenameFile" ), param );
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -269,10 +238,6 @@ bool TREEPROJECT_ITEM::Delete( bool check )
|
|||
}
|
||||
m_Parent->Delete( GetId() );
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::DeleteFile" ),
|
||||
PyHandler::Convert( m_FileName ) );
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -304,12 +269,6 @@ void TREEPROJECT_ITEM::Activate( TREE_PROJECT_FRAME* prjframe )
|
|||
ExecuteFile( m_Parent, PCBNEW_EXE, FullFileName );
|
||||
break;
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
case TREE_PY:
|
||||
PyHandler::GetInstance()->RunScript( FullFileName );
|
||||
break;
|
||||
#endif
|
||||
|
||||
case TREE_GERBER:
|
||||
ExecuteFile( m_Parent, GERBVIEW_EXE, FullFileName );
|
||||
break;
|
||||
|
|
|
@ -74,16 +74,4 @@ public:
|
|||
|
||||
void SetState( int state );
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
boost::python::object GetFileNamePy() const;
|
||||
bool RenamePy( const boost::python::str& newname,
|
||||
bool check = true );
|
||||
|
||||
boost::python::object GetDirPy() const;
|
||||
|
||||
boost::python::object GetIdPy() const;
|
||||
|
||||
boost::python::object GetMenuPy();
|
||||
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -37,7 +37,6 @@ TREEPROJECTFILES::TREEPROJECTFILES( TREE_PROJECT_FRAME* parent ) :
|
|||
m_ImageList->Add( wxBitmap( kicad_icon_small_xpm ) ); // TREE_PROJECT
|
||||
m_ImageList->Add( wxBitmap( eeschema_xpm ) ); // TREE_SCHEMA
|
||||
m_ImageList->Add( wxBitmap( pcbnew_xpm ) ); // TREE_PCB
|
||||
m_ImageList->Add( wxBitmap( icon_python_small_xpm ) ); // TREE_PY
|
||||
m_ImageList->Add( wxBitmap( icon_gerbview_small_xpm ) ); // TREE_GERBER
|
||||
m_ImageList->Add( wxBitmap( datasheet_xpm ) ); // TREE_PDF
|
||||
m_ImageList->Add( wxBitmap( icon_txt_xpm ) ); // TREE_TXT
|
||||
|
|
|
@ -84,13 +84,6 @@ void RIGHT_KM_FRAME::CreateCommandToolbar( void )
|
|||
btn->SetToolTip( _( "GerbView (Gerber viewer)" ) );
|
||||
AddFastLaunch( btn );
|
||||
|
||||
|
||||
// Set up toolbar
|
||||
#ifdef KICAD_PYTHON
|
||||
btn = new wxBitmapButton( parent, ID_RUN_PYTHON, wxBitmap( icon_python_xpm ) );
|
||||
btn->SetToolTip( _( "Run Python Script" ) );
|
||||
AddFastLaunch( btn );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -24,11 +24,6 @@
|
|||
|
||||
#include "build_version.h"
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
#include <pyhandler.h>
|
||||
using namespace boost::python;
|
||||
#endif
|
||||
|
||||
|
||||
/* Import functions */
|
||||
char* GetFileName( char* FullPathName );
|
||||
|
@ -155,11 +150,5 @@ bool WinEDA_App::OnInit()
|
|||
frame->Show( TRUE );
|
||||
frame->Raise();
|
||||
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
PyHandler::GetInstance()->AddToModule( wxT( "kicad" ), &py_kicad_init );
|
||||
PyHandler::GetInstance()->AddToModule( wxT( "common" ), &py_common_init );
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -5,10 +5,6 @@
|
|||
#ifndef KICAD_H
|
||||
#define KICAD_H
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
#include <pyhandler.h>
|
||||
#endif
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <wx/treectrl.h>
|
||||
|
@ -37,8 +33,6 @@ enum id_kicad_frm {
|
|||
ID_PROJECT_TREE,
|
||||
ID_PROJECT_TXTEDIT,
|
||||
ID_PROJECT_TREE_REFRESH,
|
||||
ID_PROJECT_RUNPY,
|
||||
ID_PROJECT_NEWPY,
|
||||
ID_PROJECT_NEWDIR,
|
||||
ID_PROJECT_DELETE,
|
||||
ID_PROJECT_RENAME,
|
||||
|
@ -47,7 +41,6 @@ enum id_kicad_frm {
|
|||
ID_TO_EDITOR,
|
||||
ID_TO_EESCHEMA,
|
||||
ID_TO_GERBVIEW,
|
||||
ID_RUN_PYTHON,
|
||||
ID_BROWSE_AN_SELECT_FILE,
|
||||
ID_SELECT_PREFERED_EDITOR,
|
||||
ID_SELECT_PREFERED_PDF_BROWSER_NAME,
|
||||
|
@ -63,7 +56,6 @@ enum id_kicad_frm {
|
|||
*/
|
||||
class WinEDA_MainFrame : public WinEDA_BasicFrame
|
||||
{
|
||||
/* This class is the main entry point of the py API */
|
||||
public:
|
||||
TREE_PROJECT_FRAME* m_LeftWin;
|
||||
RIGHT_KM_FRAME* m_RightWin;
|
||||
|
@ -97,11 +89,6 @@ public:
|
|||
void OnRunEeschema( wxCommandEvent& event );
|
||||
void OnRunGerbview( wxCommandEvent& event );
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
void OnRunPythonScript( wxCommandEvent& event );
|
||||
|
||||
#endif
|
||||
|
||||
void OnOpenTextEditor( wxCommandEvent& event );
|
||||
void OnOpenFileInTextEditor( wxCommandEvent& event );
|
||||
void OnOpenFileInEditor( wxCommandEvent& event );
|
||||
|
@ -127,21 +114,6 @@ public:
|
|||
void LoadSettings();
|
||||
void SaveSettings();
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
void OnRefreshPy();
|
||||
|
||||
boost::python::object GetPrjName() const;
|
||||
|
||||
WinEDA_MainFrame( const WinEDA_MainFrame& ) { }
|
||||
|
||||
WinEDA_MainFrame() { }
|
||||
|
||||
boost::python::object ToWx();
|
||||
void AddFastLaunchPy( boost::python::object& button );
|
||||
TREE_PROJECT_FRAME* GetTree() const;
|
||||
|
||||
#endif
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
@ -151,7 +123,6 @@ enum TreeFileType {
|
|||
TREE_PROJECT = 1,
|
||||
TREE_SCHEMA,
|
||||
TREE_PCB,
|
||||
TREE_PY,
|
||||
TREE_GERBER,
|
||||
TREE_PDF,
|
||||
TREE_TXT,
|
||||
|
|
|
@ -6,10 +6,6 @@
|
|||
#pragma implementation
|
||||
#endif
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
#include <pyhandler.h>
|
||||
#endif
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
#include "common.h"
|
||||
|
@ -72,10 +68,6 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
|
|||
line.Printf( _( "Ready\nWorking dir: %s\n" ), msg.GetData() );
|
||||
PrintMsg( line );
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::LoadProject" ) );
|
||||
#endif
|
||||
|
||||
RecreateBaseHToolbar();
|
||||
|
||||
m_auimgr.SetManagedWindow( this );
|
||||
|
@ -225,23 +217,6 @@ void WinEDA_MainFrame::OnOpenTextEditor( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
void WinEDA_MainFrame::OnRunPythonScript( wxCommandEvent& event )
|
||||
{
|
||||
wxFileDialog dlg( this, _( "Execute Python Script" ), wxEmptyString,
|
||||
wxEmptyString, _( "Python script (*.py)|*.py" ),
|
||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
||||
|
||||
if( dlg.ShowModal() == wxID_CANCEL )
|
||||
return;
|
||||
|
||||
PyHandler::GetInstance()->RunScript( dlg.GetPath() );
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void WinEDA_MainFrame::OnOpenFileInTextEditor( wxCommandEvent& event )
|
||||
{
|
||||
wxString mask( wxT( "*" ) );
|
||||
|
@ -309,12 +284,3 @@ void WinEDA_MainFrame::SaveSettings()
|
|||
cfg->Write( TreeFrameWidthEntry, m_LeftWin->GetSize().x );
|
||||
}
|
||||
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
|
||||
void WinEDA_MainFrame::OnRefreshPy()
|
||||
{
|
||||
m_LeftWin->ReCreateTreePrj();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -61,10 +61,6 @@ BEGIN_EVENT_TABLE( WinEDA_MainFrame, WinEDA_BasicFrame )
|
|||
EVT_UPDATE_UI( ID_SELECT_PREFERED_PDF_BROWSER,
|
||||
WinEDA_MainFrame::OnUpdatePreferredPdfBrowser )
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
EVT_BUTTON( ID_RUN_PYTHON, WinEDA_MainFrame::OnRunPythonScript )
|
||||
#endif
|
||||
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
|
|
|
@ -2,9 +2,6 @@
|
|||
* @file prjconfig.cpp
|
||||
* Load and save project configuration files (*.pro)
|
||||
*/
|
||||
#ifdef KICAD_PYTHON
|
||||
#include <pyhandler.h>
|
||||
#endif
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
|
@ -122,10 +119,6 @@ void WinEDA_MainFrame::OnLoadProject( wxCommandEvent& event )
|
|||
_( "\nProject: " ) + m_ProjectFileName.GetFullName() +
|
||||
wxT( "\n" ) );
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::LoadProject" ),
|
||||
PyHandler::Convert( m_ProjectFileName.GetFullPath() ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
#include <pyhandler.h>
|
||||
#endif
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "confirm.h"
|
||||
|
@ -66,11 +62,9 @@ const wxChar* s_AllowedExtensionsToList[] =
|
|||
* library as required. */
|
||||
|
||||
/* File extension definitions. */
|
||||
const wxString PythonFileExtension( wxT( "py" ) );
|
||||
const wxString TextFileExtension( wxT( "txt" ) );
|
||||
|
||||
/* File wildcard definitions. */
|
||||
const wxString PythonFileWildcard( wxT( "Python files (*.py)|*.py" ) );
|
||||
const wxString TextFileWildcard( wxT( "Text files (*.txt)|*.txt" ) );
|
||||
|
||||
|
||||
|
@ -93,12 +87,8 @@ BEGIN_EVENT_TABLE( TREE_PROJECT_FRAME, wxSashLayoutWindow )
|
|||
EVT_TREE_END_DRAG( ID_PROJECT_TREE, TREE_PROJECT_FRAME::OnDragEnd )
|
||||
EVT_MENU( ID_PROJECT_TXTEDIT, TREE_PROJECT_FRAME::OnTxtEdit )
|
||||
EVT_MENU( ID_PROJECT_NEWDIR, TREE_PROJECT_FRAME::OnNewDirectory )
|
||||
EVT_MENU( ID_PROJECT_NEWPY, TREE_PROJECT_FRAME::OnNewPyFile )
|
||||
EVT_MENU( ID_PROJECT_DELETE, TREE_PROJECT_FRAME::OnDeleteFile )
|
||||
EVT_MENU( ID_PROJECT_RENAME, TREE_PROJECT_FRAME::OnRenameFile )
|
||||
#ifdef KICAD_PYTHON
|
||||
EVT_MENU( ID_PROJECT_RUNPY, TREE_PROJECT_FRAME::OnRunPy )
|
||||
#endif /* KICAD_PYTHON */
|
||||
END_EVENT_TABLE()
|
||||
/*****************************************************************************/
|
||||
|
||||
|
@ -131,44 +121,10 @@ TREE_PROJECT_FRAME::TREE_PROJECT_FRAME( WinEDA_MainFrame* parent ) :
|
|||
|
||||
m_Filters.push_back( wxT( "^no kicad files found" ) );
|
||||
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
m_Filters.push_back( wxT( "^.*\\.py$" ) );
|
||||
|
||||
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RunScript" ) );
|
||||
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::EditScript" ) );
|
||||
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::TreeContextMenu" ) );
|
||||
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::TreeAddFile" ) );
|
||||
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::NewDirectory" ) );
|
||||
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::DeleteFile" ) );
|
||||
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::RenameFile" ) );
|
||||
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::MoveFile" ) );
|
||||
#endif /* KICAD_PYTHON */
|
||||
|
||||
|
||||
for( int i = 0; i < TREE_MAX; i++ )
|
||||
m_ContextMenus.push_back( new wxMenu() );
|
||||
|
||||
wxMenu* menu = m_ContextMenus[TREE_PY];
|
||||
|
||||
// Python script context menu
|
||||
#ifdef KICAD_PYTHON
|
||||
item = new wxMenuItem( menu, ID_PROJECT_RUNPY,
|
||||
_( "&Run" ),
|
||||
_( "Run the Python Script" ) );
|
||||
item->SetBitmap( icon_python_small_xpm );
|
||||
menu->Append( item );
|
||||
#endif /* KICAD_PYTHON */
|
||||
|
||||
|
||||
// ID_PROJECT_TXTEDIT
|
||||
item = new wxMenuItem( menu,
|
||||
ID_PROJECT_TXTEDIT,
|
||||
_( "&Edit in a text editor" ),
|
||||
_( "&Open the file in a Text Editor" ) );
|
||||
item->SetBitmap( icon_txt_xpm );
|
||||
menu->Append( item );
|
||||
|
||||
wxMenu *menu;
|
||||
|
||||
// New files context menu:
|
||||
wxMenu* menus[2];
|
||||
|
@ -187,16 +143,6 @@ TREE_PROJECT_FRAME::TREE_PROJECT_FRAME( WinEDA_MainFrame* parent ) :
|
|||
item->SetBitmap( directory_xpm );
|
||||
menu->Append( item );
|
||||
|
||||
|
||||
// ID_PROJECT_NEWPY
|
||||
#ifdef KICAD_PYTHON
|
||||
item = new wxMenuItem( menu,
|
||||
ID_PROJECT_NEWPY,
|
||||
_( "New P&ython Script" ),
|
||||
_( "Create a New Python Script" ) );
|
||||
item->SetBitmap( new_python_xpm );
|
||||
menu->Append( item );
|
||||
#endif /* KICAD_PYTHON */
|
||||
}
|
||||
|
||||
|
||||
|
@ -351,103 +297,6 @@ void TREE_PROJECT_FRAME::RemoveFilter( const wxString& filter )
|
|||
}
|
||||
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
|
||||
|
||||
/**
|
||||
* @brief Return the data corresponding to the file, or NULL
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
TREEPROJECT_ITEM* TREE_PROJECT_FRAME::FindItemData( const boost::python::str& name )
|
||||
/*****************************************************************************/
|
||||
{
|
||||
// (Interative tree parsing)
|
||||
std::vector< wxTreeItemId > roots1, roots2;
|
||||
std::vector< wxTreeItemId >* root, * reserve;
|
||||
wxString filename = PyHandler::MakeStr( name );
|
||||
|
||||
root = &roots1;
|
||||
reserve = &roots2;
|
||||
|
||||
root->push_back( m_TreeProject->GetRootItem() );
|
||||
|
||||
// if we look for the root, return it ...
|
||||
TREEPROJECT_ITEM* data = dynamic_cast< TREEPROJECT_ITEM*>(
|
||||
m_TreeProject->GetItemData( root->at( 0 ) ) );
|
||||
|
||||
if( data->GetFileName() == filename )
|
||||
return data;
|
||||
|
||||
// Then find in its child
|
||||
while( root->size() )
|
||||
{
|
||||
// look in all roots
|
||||
for( unsigned int i = 0; i < root->size(); i++ )
|
||||
{
|
||||
wxTreeItemId id = root->at( i );
|
||||
|
||||
// for each root check any child:
|
||||
void* cookie = NULL;
|
||||
wxTreeItemId child = m_TreeProject->GetFirstChild( id, cookie );
|
||||
|
||||
while( child.IsOk() )
|
||||
{
|
||||
TREEPROJECT_ITEM* data = dynamic_cast< TREEPROJECT_ITEM*>(
|
||||
m_TreeProject->GetItemData( child ) );
|
||||
|
||||
if( data )
|
||||
{
|
||||
if( data->GetFileName() == filename )
|
||||
return data;
|
||||
if( m_TreeProject->ItemHasChildren( child ) )
|
||||
reserve->push_back( child );
|
||||
}
|
||||
child = m_TreeProject->GetNextSibling( child );
|
||||
}
|
||||
}
|
||||
|
||||
// Swap the roots
|
||||
root->clear();
|
||||
std::vector< wxTreeItemId >* tmp;
|
||||
tmp = root;
|
||||
root = reserve;
|
||||
reserve = tmp;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief TODO
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
void TREE_PROJECT_FRAME::RemoveFilterPy( const boost::python::str& filter )
|
||||
/*****************************************************************************/
|
||||
{
|
||||
RemoveFilter( PyHandler::MakeStr( filter ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief TODO
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
void TREE_PROJECT_FRAME::AddFilter( const boost::python::str& filter )
|
||||
/*****************************************************************************/
|
||||
{
|
||||
wxRegEx reg;
|
||||
wxString text = PyHandler::MakeStr( filter );
|
||||
|
||||
if( !reg.Compile( text ) )
|
||||
return;
|
||||
m_Filters.push_back( text );
|
||||
}
|
||||
|
||||
|
||||
#endif /* KICAD_PYTHON */
|
||||
|
||||
|
||||
/**
|
||||
* @brief TODO
|
||||
*/
|
||||
|
@ -481,17 +330,6 @@ void TREE_PROJECT_FRAME::OnNewDirectory( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief TODO
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
void TREE_PROJECT_FRAME::OnNewPyFile( wxCommandEvent& event )
|
||||
/*****************************************************************************/
|
||||
{
|
||||
NewFile( TREE_PY );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief TODO
|
||||
*/
|
||||
|
@ -557,20 +395,10 @@ void TREE_PROJECT_FRAME::NewFile( const wxString& name,
|
|||
if( TREE_DIRECTORY != type )
|
||||
{
|
||||
wxFile( name, wxFile::write );
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::NewFile" ),
|
||||
PyHandler::Convert( name ) );
|
||||
#endif /* KICAD_PYTHON */
|
||||
}
|
||||
else
|
||||
{
|
||||
wxMkdir( name );
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::NewDirectory" ),
|
||||
PyHandler::Convert( name ) );
|
||||
#endif /* KICAD_PYTHON */
|
||||
}
|
||||
|
||||
AddFile( name, root );
|
||||
|
@ -600,10 +428,6 @@ wxString TREE_PROJECT_FRAME::GetFileExt( TreeFileType type )
|
|||
ext = BoardFileExtension;
|
||||
break;
|
||||
|
||||
case TREE_PY:
|
||||
ext = PythonFileExtension;
|
||||
break;
|
||||
|
||||
case TREE_GERBER:
|
||||
ext = GerberFileExtension;
|
||||
break;
|
||||
|
@ -647,10 +471,6 @@ wxString TREE_PROJECT_FRAME::GetFileWildcard( TreeFileType type )
|
|||
ext = BoardFileWildcard;
|
||||
break;
|
||||
|
||||
case TREE_PY:
|
||||
ext = PythonFileWildcard;
|
||||
break;
|
||||
|
||||
case TREE_GERBER:
|
||||
ext = GerberFileWildcard;
|
||||
break;
|
||||
|
@ -813,13 +633,6 @@ bool TREE_PROJECT_FRAME::AddFile( const wxString& aName,
|
|||
else
|
||||
data->m_IsRootFile = false;
|
||||
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::TreeAddFile" ),
|
||||
PyHandler::Convert( aName ) );
|
||||
#endif /* KICAD_PYTHON */
|
||||
|
||||
|
||||
// This section adds dirs and files found in the subdirs
|
||||
// in this case AddFile is recursive, but for the first level only.
|
||||
if( TREE_DIRECTORY == type && aRecurse )
|
||||
|
@ -983,15 +796,6 @@ void TREE_PROJECT_FRAME::OnRight( wxTreeEvent& Event )
|
|||
}
|
||||
}
|
||||
|
||||
// At last, call python to let python add menu items "on the fly"
|
||||
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::TreeContextMenu" ),
|
||||
PyHandler::Convert( FullFileName ) );
|
||||
#endif /* KICAD_PYTHON */
|
||||
|
||||
|
||||
if( m_PopupMenu )
|
||||
PopupMenu( m_PopupMenu );
|
||||
}
|
||||
|
@ -1014,14 +818,7 @@ void TREE_PROJECT_FRAME::OnTxtEdit( wxCommandEvent& event )
|
|||
wxString editorname = wxGetApp().GetEditorName();
|
||||
|
||||
if( !editorname.IsEmpty() )
|
||||
{
|
||||
#ifdef KICAD_PYTHON
|
||||
PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::EditScript" ),
|
||||
PyHandler::Convert( FullFileName ) );
|
||||
#endif
|
||||
|
||||
ExecuteFile( this, editorname, FullFileName );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1064,61 +861,6 @@ void TREE_PROJECT_FRAME::OnRenameFile( wxCommandEvent& )
|
|||
}
|
||||
|
||||
|
||||
#ifdef KICAD_PYTHON
|
||||
|
||||
/**
|
||||
* @brief TODO
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
void TREE_PROJECT_FRAME::OnRunPy( wxCommandEvent& event )
|
||||
/*****************************************************************************/
|
||||
{
|
||||
TREEPROJECT_ITEM* tree_data = GetSelectedData();
|
||||
|
||||
if( !tree_data )
|
||||
return;
|
||||
|
||||
wxString FullFileName = tree_data->GetFileName();
|
||||
PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::RunScript" ),
|
||||
PyHandler::Convert( FullFileName ) );
|
||||
PyHandler::GetInstance()->RunScript( FullFileName );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Add a state to the image list
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
int TREE_PROJECT_FRAME::AddStatePy( boost::python::object& bitmap )
|
||||
/*****************************************************************************/
|
||||
{
|
||||
wxBitmap* image;
|
||||
bool success = wxPyConvertSwigPtr( bitmap.ptr(),
|
||||
(void**) &image, _T( "wxBitmap" ) );
|
||||
|
||||
if( !success )
|
||||
return -1;
|
||||
|
||||
wxImageList* list = m_TreeProject->GetImageList();
|
||||
int ret = list->GetImageCount() / ( TREE_MAX - 2 );
|
||||
|
||||
for( int i = 0; i < TREE_MAX - 1; i++ )
|
||||
{
|
||||
wxBitmap composed( list->GetBitmap( i ) );
|
||||
|
||||
wxMemoryDC dc;
|
||||
dc.SelectObject( composed );
|
||||
dc.DrawBitmap( *image, 0, 0, true );
|
||||
list->Add( composed );
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#endif /* KICAD_PYTHON */
|
||||
|
||||
|
||||
/**
|
||||
* @brief Prevent the main project to be renamed
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue