diff --git a/eeschema/fields_grid_table.cpp b/eeschema/fields_grid_table.cpp index 7801d791e2..1c05b4f27d 100644 --- a/eeschema/fields_grid_table.cpp +++ b/eeschema/fields_grid_table.cpp @@ -94,7 +94,7 @@ FIELDS_GRID_TABLE::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* a m_boolAttr = new wxGridCellAttr; m_boolAttr->SetRenderer( new wxGridCellBoolRenderer() ); m_boolAttr->SetEditor( new wxGridCellBoolEditor() ); - m_boolAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM ); + m_boolAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); wxArrayString vAlignNames; vAlignNames.Add( _( "Top" ) ); diff --git a/kicad/kicad.h b/kicad/kicad.h index 9606337fe6..628d28c629 100644 --- a/kicad/kicad.h +++ b/kicad/kicad.h @@ -56,6 +56,7 @@ enum TreeFileType { TREE_LEGACY_PCB, // board file (.brd) legacy format TREE_SEXP_PCB, // board file (.kicad_brd) new s expression format TREE_GERBER, // Gerber file (.pho, .g*) + TREE_GERBER_JOB_FILE, // Gerber file (.gbrjob) TREE_HTML, // HTML file (.htm, *.html) TREE_PDF, // PDF file (.pdf) TREE_TXT, // ascii text file (.txt) diff --git a/kicad/tree_project_frame.cpp b/kicad/tree_project_frame.cpp index 8a02cc9faf..990d2a4099 100644 --- a/kicad/tree_project_frame.cpp +++ b/kicad/tree_project_frame.cpp @@ -278,6 +278,10 @@ wxString TREE_PROJECT_FRAME::GetFileExt( TreeFileType type ) ext = GerberFileExtensionWildCard; break; + case TREE_GERBER_JOB_FILE: + ext = GerberJobFileExtension; + break; + case TREE_HTML: ext = HtmlFileExtension; break; @@ -535,6 +539,9 @@ bool TREE_PROJECT_FRAME::AddItemToTreeProject( const wxString& aName, if( ext == wxT( "" ) ) continue; + if( i == TREE_GERBER ) // For gerber files, the official ext is gbr + ext = "gbr"; + reg.Compile( wxString::FromAscii( "^.*\\" ) + ext + wxString::FromAscii( "$" ), wxRE_ICASE ); diff --git a/kicad/treeproject_item.cpp b/kicad/treeproject_item.cpp index e7ed9c9132..39ce967e39 100644 --- a/kicad/treeproject_item.cpp +++ b/kicad/treeproject_item.cpp @@ -223,6 +223,7 @@ void TREEPROJECT_ITEM::Activate( TREE_PROJECT_FRAME* aTreePrjFrame ) break; case TREE_GERBER: + case TREE_GERBER_JOB_FILE: case TREE_DRILL: case TREE_DRILL_NC: case TREE_DRILL_XNC: diff --git a/kicad/treeprojectfiles.cpp b/kicad/treeprojectfiles.cpp index fc2d1ef47c..504d325399 100644 --- a/kicad/treeprojectfiles.cpp +++ b/kicad/treeprojectfiles.cpp @@ -62,6 +62,7 @@ TREEPROJECTFILES::TREEPROJECTFILES( TREE_PROJECT_FRAME* parent ) : m_ImageList->Add( KiBitmap( pcbnew_xpm ) ); // TREE_LEGACY_PCB m_ImageList->Add( KiBitmap( pcbnew_xpm ) ); // TREE_SFMT_PCB m_ImageList->Add( KiBitmap( icon_gerbview_small_xpm ) ); // TREE_GERBER + m_ImageList->Add( KiBitmap( gerber_job_file_xpm ) ); // TREE_GERBER_JOB_FILE (.gbrjob) m_ImageList->Add( KiBitmap( html_xpm ) ); // TREE_HTML m_ImageList->Add( KiBitmap( datasheet_xpm ) ); // TREE_PDF m_ImageList->Add( KiBitmap( editor_xpm ) ); // TREE_TXT diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index bcd26ed01f..025f4189b4 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -1283,10 +1283,17 @@ void PCB_EDIT_FRAME::PythonSyncEnvironmentVariables() #if defined( KICAD_SCRIPTING ) const ENV_VAR_MAP& varMap = Pgm().GetLocalEnvVariables(); + // Set the environment variables for python scripts + // note: the string will be encoded UTF8 for python env for( ENV_VAR_MAP_CITER it = varMap.begin(); it != varMap.end(); ++it ) { pcbnewUpdatePythonEnvVar( it->first, it->second.GetValue() ); } + + // Because the env vars can de modifed by the python scripts (rewritten in UTF8 encoding), + // regenerate them (in unicode wide chars) for our normal environment + for( auto& var : varMap ) + wxSetEnv( var.first, var.second.GetValue() ); #endif } @@ -1297,6 +1304,10 @@ void PCB_EDIT_FRAME::PythonSyncProjectName() wxString evValue; wxGetEnv( PROJECT_VAR_NAME, &evValue ); pcbnewUpdatePythonEnvVar( wxString( PROJECT_VAR_NAME ).ToStdString(), evValue ); + + // Because PROJECT_VAR_NAME can be modifed by the python scripts (rewritten in UTF8), + // regenerate it (in unicode wide chars) for our normal environment + wxSetEnv( PROJECT_VAR_NAME, evValue ); #endif } diff --git a/pcbnew/text_mod_grid_table.cpp b/pcbnew/text_mod_grid_table.cpp index b93654bec7..eb7ade76f6 100644 --- a/pcbnew/text_mod_grid_table.cpp +++ b/pcbnew/text_mod_grid_table.cpp @@ -50,7 +50,7 @@ TEXT_MOD_GRID_TABLE::TEXT_MOD_GRID_TABLE( EDA_UNITS_T aUserUnits, PCB_BASE_FRAME m_boolColAttr = new wxGridCellAttr; m_boolColAttr->SetRenderer( new wxGridCellBoolRenderer() ); m_boolColAttr->SetEditor( new wxGridCellBoolEditor() ); - m_boolColAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM ); + m_boolColAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); if( g_menuOrientations.IsEmpty() ) {