diff --git a/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp b/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp index 59cb289247..b1acf74ce9 100644 --- a/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp +++ b/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp @@ -100,8 +100,8 @@ void PANEL_PREV_3D::initPanel() m_spinXoffset,m_spinYoffset, m_spinZoffset }; - for( int ii = 0; ii < 9; ii++ ) - spinButtonList[ii]->SetRange( INT_MIN, INT_MAX ); + for( wxSpinButton* button : spinButtonList ) + button->SetRange(INT_MIN, INT_MAX ); } diff --git a/3d-viewer/3d_cache/dialogs/panel_prev_model.h b/3d-viewer/3d_cache/dialogs/panel_prev_model.h index b2c932a2ee..6787beaa6a 100644 --- a/3d-viewer/3d_cache/dialogs/panel_prev_model.h +++ b/3d-viewer/3d_cache/dialogs/panel_prev_model.h @@ -50,8 +50,8 @@ #define SCALE_INCREMENT_FINE 0.02 #define SCALE_INCREMENT 0.1 -#define ROTATION_INCREMENT 5 // in degrees, for spin button command -#define ROTATION_INCREMENT_WHEEL 15 // in degrees, for mouse wheel command +#define ROTATION_INCREMENT 90 // in degrees, for spin button command +#define ROTATION_INCREMENT_WHEEL 90 // in degrees, for mouse wheel command #define ROTATION_INCREMENT_WHEEL_FINE 1 // in degrees, for mouse wheel command #define OFFSET_INCREMENT_MM 0.5 diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp index ba1372859a..a547bd75c1 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_BoardEditor.cpp @@ -26,8 +26,6 @@ #include #include -#include -#include #include #include #include @@ -437,6 +435,10 @@ void DIALOG_FOOTPRINT_BOARD_EDITOR::On3DModelCellChanged( wxGridEvent& aEvent ) FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver(); wxString filename = m_modelsGrid->GetCellValue( aEvent.GetRow(), 0 ); + filename.Replace( "\n", "" ); + filename.Replace( "\r", "" ); + filename.Replace( "\t", "" ); + if( filename.empty() || !res->ValidateFileName( filename, hasAlias ) ) { m_delayedErrorMessage = wxString::Format( _( "Invalid filename: %s" ), filename ); @@ -456,6 +458,7 @@ void DIALOG_FOOTPRINT_BOARD_EDITOR::On3DModelCellChanged( wxGridEvent& aEvent ) #endif m_shapes3D_list[ aEvent.GetRow() ].m_Filename = filename; + m_modelsGrid->SetCellValue( aEvent.GetRow(), 0, filename ); } else if( aEvent.GetCol() == 1 ) { diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp index 91d1a7fecf..a3211cf682 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp @@ -4,7 +4,7 @@ * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2015 Dick Hollenbeck, dick@softplc.com * Copyright (C) 2008 Wayne Stambaugh - * Copyright (C) 2004-2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -25,8 +25,6 @@ */ #include -#include -#include #include #include #include @@ -358,6 +356,10 @@ void DIALOG_FOOTPRINT_FP_EDITOR::On3DModelCellChanged( wxGridEvent& aEvent ) FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver(); wxString filename = m_modelsGrid->GetCellValue( aEvent.GetRow(), 0 ); + filename.Replace( "\n", "" ); + filename.Replace( "\r", "" ); + filename.Replace( "\t", "" ); + if( filename.empty() || !res->ValidateFileName( filename, hasAlias ) ) { m_delayedErrorMessage = wxString::Format( _( "Invalid filename: %s" ), filename ); @@ -378,6 +380,7 @@ void DIALOG_FOOTPRINT_FP_EDITOR::On3DModelCellChanged( wxGridEvent& aEvent ) #endif m_shapes3D_list[ aEvent.GetRow() ].m_Filename = filename; + m_modelsGrid->SetCellValue( aEvent.GetRow(), 0, filename ); } else if( aEvent.GetCol() == 1 ) {